<?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.EmergencyDrillPlanUserInfoRepository">
|
|
<insert id="addEmergencyDrillPlanUser">
|
insert into emergency_drill_plan_user
|
<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="drillPlanId != null ">drill_plan_id,</if>
|
<if test="userUid != null ">user_uid,</if>
|
<if test="userName != null and userName != ''">user_name,</if>
|
<if test="type != null ">type</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="drillPlanId != null ">#{drillPlanId},</if>
|
<if test="userUid != null ">#{userUid},</if>
|
<if test="userName != null and userName != ''">#{userName},</if>
|
<if test="type != null ">#{type}</if>
|
</trim>
|
</insert>
|
|
<resultMap type="com.gkhy.safePlatform.emergency.entity.EmergencyDrillPlanUserInfoDO" id="emergencyDrillPlanUserInfoDOResult">
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
<result column="drill_plan_id" property="drillPlanId" />
|
<result column="user_uid" property="userUid" />
|
<result column="user_name" property="userName" />
|
<result column="type" property="type" />
|
</resultMap>
|
|
<select id="selectEmergencyDrillPlanUserByDrillPlanId" resultMap="emergencyDrillPlanUserInfoDOResult">
|
select id,`drill_plan_id`,`user_uid`,user_name,`type` from emergency_drill_plan_user where del_flag = 0 and drill_plan_id = #{drillPlanId}
|
</select>
|
|
<update id = "deleteEmergencyDrillPlanUserByIds" >
|
update emergency_drill_plan_user set del_flag = 1 where id in
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</update>
|
|
<update id="deleteEmergencyDrillPlanUserByDrillPlanId">
|
update emergency_drill_plan_user set del_flag = 1 where drill_plan_id = #{drillPlanId}
|
</update>
|
|
</mapper>
|