<?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.EmergencyPlanTeamInfoRepository">
|
|
<insert id="addEmergencyPlanTeam">
|
insert into emergency_plan_team
|
<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="planId != null ">plan_id,</if>
|
<if test="teamId != null ">team_id,</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="planId != null ">#{planId},</if>
|
<if test="teamId != null ">#{teamId},</if>
|
</trim>
|
</insert>
|
|
<resultMap type="com.gkhy.safePlatform.emergency.entity.EmergencyPlanTeamInfoDO" id="emergencyPlanTeamInfoDOResult">
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
<result column="plan_id" property="planId"/>
|
<result column="team_id" property="teamId"/>
|
</resultMap>
|
|
<select id="selectEmergencyPlanTeamByPlanId" resultMap="emergencyPlanTeamInfoDOResult">
|
SELECT
|
a.id,
|
a.plan_id,
|
a.team_id,
|
b.team_name AS teamName
|
FROM
|
emergency_plan_team a
|
LEFT JOIN emergency_team b ON a.team_id = b.id
|
WHERE
|
a.plan_id = #{planId}
|
AND a.del_flag = 0
|
</select>
|
|
<update id = "deleteEmergencyPlanTeamByIds" >
|
update emergency_plan_team set del_flag = 1 where id in
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</update>
|
|
<update id="deleteEmergencyPlanTeamByPlanId">
|
update emergency_plan_team set del_flag = 1 where plan_id = #{planId}
|
</update>
|
|
</mapper>
|