songhuangfeng123
2022-08-18 233fb69fa9d1694e97337d74fa3da72cacda04c1
emergency/emergency-service/src/main/resource/config/mapper/emergency/EmergencyDrillEvaluationInfoMapper.xml
@@ -7,11 +7,28 @@
    <resultMap type="com.gkhy.safePlatform.emergency.entity.EmergencyDrillEvaluationInfoPageDO"
               id="emergencyDrillEvaluationInfoPageDOResult">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="drill_plan_id" property="drillPlanId"/>
        <result column="drill_execute_id" property="drillExecuteId"/>
    </resultMap>
    <select id="selectEmergencyDrillEvaluationList" resultMap="emergencyDrillEvaluationInfoPageDOResult">
        select id,`drill_plan_id`  from emergency_drill_evaluation where del_flag = 0
        SELECT
            a.id,
            a.drill_execute_id,
            c.drill_name AS drillName,
            c.drill_address AS drillAddress,
            c.drill_way AS drillWay,
            c.drill_level AS drillLevel,
            c.drill_plan_date AS drillPlanDate,
            b.`drill_record_date` AS drillRecordDate,
            d.`name` AS emergencyPlanName
        FROM
            emergency_drill_evaluation a
            LEFT JOIN emergency_drill_execute b ON a.drill_execute_id = b.id
            LEFT JOIN emergency_drill_plan c ON b.drill_plan_id = c.id
            LEFT JOIN emergency_plan d ON c.plan_id = d.id
        WHERE
            a.del_flag = 0
    </select>
    <insert id="addEmergencyDrillEvaluation" parameterType="com.gkhy.safePlatform.emergency.entity.EmergencyDrillEvaluationInfo"
@@ -24,7 +41,7 @@
            <if test="gmtModitify != null ">gmt_moditify,</if>
            <if test="createUid != null ">create_uid,</if>
            <if test="updateUid != null ">update_uid,</if>
            <if test="drillPlanId != null ">drill_plan_id,</if>
            <if test="drillExecuteId != null ">drill_execute_id,</if>
            <if test="suitable != null and suitable != ''">`suitable`,</if>
            <if test="sufficient != null and sufficient != ''">`sufficient`,</if>
            <if test="arrival != null and arrival != ''">`arrival`,</if>
@@ -48,7 +65,7 @@
            <if test="gmtModitify != null ">#{gmtModitify},</if>
            <if test="createUid != null ">#{createUid},</if>
            <if test="updateUid != null ">#{updateUid},</if>
            <if test="drillPlanId != null ">#{drillPlanId},</if>
            <if test="drillExecuteId != null ">#{drillExecuteId},</if>
            <if test="suitable != null and suitable != ''">#{suitable},</if>
            <if test="sufficient != null and sufficient != ''">#{sufficient},</if>
            <if test="arrival != null and arrival != ''">#{arrival},</if>
@@ -70,7 +87,7 @@
    <resultMap type="com.gkhy.safePlatform.emergency.entity.EmergencyDrillEvaluationInfoDetailDO" id="emergencyDrillEvaluationInfoDetailDOResult">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="drill_plan_id" property="drillPlanId"/>
        <result column="drill_execute_id" property="drillExecuteId"/>
        <result column="suitable" property="suitable"/>
        <result column="sufficient" property="sufficient"/>
        <result column="arrival" property="arrival"/>
@@ -88,11 +105,53 @@
        <result column="modify_content" property="modifyContent"/>
    </resultMap>
    <select id="selectEmergencyDrillEvaluationById" resultMap="emergencyDrillEvaluationInfoDetailDOResult">
        select id ,`drill_plan_id`,`suitable`,`sufficient`,`arrival`,supplies ,protection ,whole ,division,
         effect ,report ,safety ,rescue ,evacuate ,need_modify ,question_and_improve ,modify_content
        from emergency_drill_evaluation
        where del_flag = 0 and id = #{id}
    <select id="selectEmergencyDrillEvaluationByExecuteId" resultMap="emergencyDrillEvaluationInfoDetailDOResult">
    SELECT
        a.id,
        a.`drill_execute_id`,
        a.`suitable`,
        a.`sufficient`,
        a.`arrival`,
        a.supplies,
        a.protection,
        a.whole,
        a.division,
        a.effect,
        a.report,
        a.safety,
        a.rescue,
        a.evacuate,
        a.need_modify,
        a.question_and_improve,
        a.modify_content,
        b.drill_record_date AS drillRecordDate,
        b.record_user_uid AS recordUserUid,
        b.record_user_name AS recordUserName,
        b.process_desc AS processDesc,
        b.drill_plan_id AS drillPlanId,
        c.making_plan_date AS makingPlanDate,
        c.drill_plan_date AS drillPlanDate,
        c.making_user_uid AS makingUserUid,
        c.making_user_name AS makingUserName,
        c.making_department_id AS makingDepartmentId,
        c.department_id AS departmentId,
        c.drill_expense AS drillExpense,
        c.drill_level AS drillLevel,
        c.drill_address AS drillAddress,
        c.drill_name AS drillName,
        c.drill_way AS drillWay,
        c.insurance_measures AS insuranceMeasures,
        c.remark AS remark,
        c.purpose AS purpose,
        d.`name` AS emergencyPlanName
    FROM
        emergency_drill_evaluation a
        LEFT JOIN emergency_drill_execute b ON a.drill_execute_id = b.id
        LEFT JOIN emergency_drill_plan c ON b.drill_plan_id = c.id
        LEFT JOIN emergency_plan d ON c.plan_id = d.id
    WHERE
        a.del_flag = 0
        AND a.drill_execute_id = #{id}
    </select>
    <update id="updateEmergencyDrillEvaluation" parameterType="com.gkhy.safePlatform.emergency.entity.EmergencyDrillEvaluationInfo">
@@ -100,7 +159,7 @@
        <trim prefix="SET" suffixOverrides=",">
            <if test="gmtModitify != null ">gmt_moditify = #{gmtModitify},</if>
            <if test="updateUid != null ">update_uid = #{updateUid},</if>
            <if test="drillPlanId != null ">drill_plan_id = #{drillPlanId},</if>
            <if test="drillExecuteId != null ">drill_execute_id = #{drillExecuteId},</if>
            <if test="suitable != null and suitable != ''">suitable = #{suitable},</if>
            <if test="sufficient != null and sufficient != ''">sufficient = #{sufficient},</if>
            <if test="arrival != null and arrival != ''">arrival = #{arrival},</if>