<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.gkhy.safePlatform.emergency.repository.EmergencyDrillPlanInfoRepository">
|
|
<resultMap type="com.gkhy.safePlatform.emergency.entity.EmergencyDrillPlanInfoPageDO"
|
id="emergencyDrillPlanInfoPageDOResult">
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
<result column="drill_name" property="drillName"/>
|
<result column="drill_address" property="drillAddress"/>
|
<result column="drill_way" property="drillWay"/>
|
<result column="drill_level" property="drillLevel"/>
|
<result column="drill_plan_date" property="drillPlanDate"/>
|
<result column="gmt_moditify" property="gmtModitify"/>
|
</resultMap>
|
|
<select id="selectEmergencyDrillPlanList" resultMap="emergencyDrillPlanInfoPageDOResult">
|
select id,`drill_name`,`drill_address`,`drill_way`,`drill_level`,drill_plan_date ,gmt_moditify
|
from emergency_drill_plan where del_flag = 0
|
<if test="query.drillName != null and query.drillName != ''">and `drill_name` like concat('%', #{query.drillName}, '%')</if>
|
</select>
|
|
<insert id="addEmergencyDrillPlan" parameterType="com.gkhy.safePlatform.emergency.entity.EmergencyDrillPlanInfo"
|
keyProperty="id" useGeneratedKeys="true">
|
insert into emergency_drill_plan
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null ">id,</if>
|
<if test="delFlag != null ">del_flag,</if>
|
<if test="gmtCreate != null ">gmt_create,</if>
|
<if test="gmtModitify != null ">gmt_moditify,</if>
|
<if test="createUid != null ">create_uid,</if>
|
<if test="updateUid != null ">update_uid,</if>
|
<if test="status != null ">status,</if>
|
<if test="makingPlanDate != null ">making_plan_date,</if>
|
<if test="drillPlanDate != null ">drill_plan_date,</if>
|
<if test="makingUserUid != null ">making_user_uid,</if>
|
<if test="makingUserName != null and makingUserName != ''">`making_user_name`,</if>
|
<if test="makingDepartmentId != null ">making_department_id,</if>
|
<if test="planId != null ">plan_id,</if>
|
<if test="departmentId != null ">department_id,</if>
|
<if test="drillExpense != null ">drill_expense,</if>
|
<if test="drillLevel != null and drillLevel != ''">`drill_level`,</if>
|
<if test="drillAddress != null and drillAddress != ''">`drill_address`,</if>
|
<if test="drillName != null and drillName != ''">`drill_name`,</if>
|
<if test="drillWay != null and drillWay != ''">`drill_way`,</if>
|
<if test="insuranceMeasures != null and insuranceMeasures != ''">`insurance_measures`,</if>
|
<if test="remark != null and remark != ''">`remark`,</if>
|
<if test="purpose != null and purpose != ''">`purpose`,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null ">#{id},</if>
|
<if test="delFlag != null ">#{delFlag},</if>
|
<if test="gmtCreate != null ">#{gmtCreate},</if>
|
<if test="gmtModitify != null ">#{gmtModitify},</if>
|
<if test="createUid != null ">#{createUid},</if>
|
<if test="updateUid != null ">#{updateUid},</if>
|
<if test="status != null ">#{status},</if>
|
<if test="makingPlanDate != null ">#{makingPlanDate},</if>
|
<if test="drillPlanDate != null ">#{drillPlanDate},</if>
|
<if test="makingUserUid != null ">#{makingUserUid},</if>
|
<if test="makingUserName != null and makingUserName != ''">#{makingUserName},</if>
|
<if test="makingDepartmentId != null ">#{makingDepartmentId},</if>
|
<if test="planId != null ">#{planId},</if>
|
<if test="departmentId != null ">#{departmentId},</if>
|
<if test="drillExpense != null ">#{drillExpense},</if>
|
<if test="drillLevel != null and drillLevel != ''">#{drillLevel},</if>
|
<if test="drillAddress != null and drillAddress != ''">#{drillAddress},</if>
|
<if test="drillName != null and drillName != ''">#{drillName},</if>
|
<if test="drillWay != null and drillWay != ''">#{drillWay},</if>
|
<if test="insuranceMeasures != null and insuranceMeasures != ''">#{insuranceMeasures},</if>
|
<if test="remark != null and remark != ''">#{remark},</if>
|
<if test="purpose != null and purpose != ''">#{purpose},</if>
|
</trim>
|
</insert>
|
|
|
<resultMap type="com.gkhy.safePlatform.emergency.entity.EmergencyDrillPlanInfoDetailDO"
|
id="emergencyDrillPlanInfoDetailDOResult">
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
<result column="status" property="status"/>
|
<result column="gmt_moditify" property="gmtModitify"/>
|
<result column="making_plan_date" property="makingPlanDate"/>
|
<result column="drill_plan_date" property="drillPlanDate"/>
|
<result column="making_user_uid" property="makingUserUid"/>
|
<result column="making_user_name" property="makingUserName"/>
|
<result column="making_department_id" property="makingDepartmentId"/>
|
<result column="plan_id" property="planId"/>
|
<result column="department_id" property="departmentId"/>
|
<result column="drill_expense" property="drillExpense"/>
|
<result column="drill_name" property="drillName"/>
|
<result column="drill_address" property="drillAddress"/>
|
<result column="drill_way" property="drillWay"/>
|
<result column="drill_level" property="drillLevel"/>
|
<result column="insurance_measures" property="insuranceMeasures"/>
|
<result column="remark" property="remark"/>
|
<result column="purpose" property="purpose"/>
|
</resultMap>
|
|
<select id="selectEmergencyDrillPlanById" resultMap="emergencyDrillPlanInfoDetailDOResult">
|
SELECT
|
a.id,
|
a.`status`,
|
a.`gmt_moditify`,
|
a.`making_plan_date`,
|
a.`drill_plan_date`,
|
a.making_user_uid,
|
a.making_user_name,
|
a.making_department_id,
|
a.plan_id,
|
a.department_id,
|
a.drill_expense,
|
a.drill_name,
|
a.drill_address,
|
a.drill_way,
|
a.drill_level,
|
a.insurance_measures,
|
a.remark,
|
a.purpose,
|
b.`name` AS planName
|
FROM
|
emergency_drill_plan a
|
LEFT JOIN emergency_plan b ON a.plan_id = b.id
|
WHERE
|
a.del_flag = 0
|
AND a.id = #{id}
|
</select>
|
|
<update id="updateEmergencyDrillPlan" parameterType="com.gkhy.safePlatform.emergency.entity.EmergencyDrillPlanInfo">
|
update emergency_drill_plan
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="gmtModitify != null ">gmt_moditify = #{gmtModitify},</if>
|
<if test="updateUid != null ">update_uid = #{updateUid},</if>
|
<if test="status != null ">status = #{status},</if>
|
<if test="makingPlanDate != null ">making_plan_date=#{makingPlanDate},</if>
|
<if test="drillPlanDate != null ">drill_plan_date=#{drillPlanDate},</if>
|
<if test="makingUserUid != null ">making_user_uid=#{makingUserUid},</if>
|
<if test="makingUserName != null and makingUserName != ''">making_user_name=#{makingUserName},</if>
|
<if test="makingDepartmentId != null ">making_department_id=#{makingDepartmentId},</if>
|
<if test="planId != null ">plan_id=#{planId},</if>
|
<if test="departmentId != null ">department_id=#{departmentId},</if>
|
<if test="drillExpense != null ">drill_expense=#{drillExpense},</if>
|
<if test="drillLevel != null and drillLevel != ''">drill_level=#{drillLevel},</if>
|
<if test="drillAddress != null and drillAddress != ''">drill_address=#{drillAddress},</if>
|
<if test="drillName != null and drillName != ''">drill_name=#{drillName},</if>
|
<if test="drillWay != null and drillWay != ''">drill_way=#{drillWay},</if>
|
<if test="insuranceMeasures != null and insuranceMeasures != ''">insurance_measures=#{insuranceMeasures},</if>
|
<if test="remark != null and remark != ''">remark=#{remark},</if>
|
<if test="purpose != null and purpose != ''">purpose=#{purpose},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<update id="deleteEmergencyDrillPlan">
|
update emergency_drill_plan set del_flag = 1 where id = #{id}
|
</update>
|
</mapper>
|