<?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.ruoyi.project.dc.emergencyTeam.mapper.EmergencyTeamMapper">
|
|
<resultMap type="com.ruoyi.project.dc.emergencyTeam.domain.EmergencyTeam" id="EmergencyTeamResult">
|
<result property="emergencyTeamId" column="emergency_team_id" />
|
<result property="companyId" column="company_id"/>
|
<result property="createBy" column="create_by" />
|
<result property="createUserId" column="create_user_id" />
|
<result property="createTime" column="create_time" />
|
<result property="updateBy" column="update_by" />
|
<result property="updateUserId" column="update_user_id" />
|
<result property="updateTime" column="update_time" />
|
<result property="remark" column="remark" />
|
<result property="teamType" column="team_type" />
|
<result property="teamName" column="team_name" />
|
<result property="teamLocation" column="team_location" />
|
<result property="nameOfLeader" column="name_of_leader" />
|
<result property="phoneOfLeader" column="phone_of_leader" />
|
<result property="nameOfSecondLeader" column="name_of_second_leader" />
|
<result property="phoneOfSecondLeader" column="phone_of_second_leader" />
|
<result property="teamMembers" column="team_members" />
|
</resultMap>
|
|
<sql id="selectEmergencyTeamVo">
|
select emergency_team_id, company_id, create_by, create_user_id, create_time, update_by, update_user_id, update_time, remark, team_type, team_name, team_location, name_of_leader, phone_of_leader, name_of_second_leader, phone_of_second_leader, team_members from dc_emergency_team
|
</sql>
|
|
<select id="selectEmergencyTeamList" parameterType="EmergencyTeam" resultMap="EmergencyTeamResult">
|
<include refid="selectEmergencyTeamVo"/>
|
<where>
|
<if test="companyId != null "> and company_id = #{companyId}</if>
|
<if test="createUserId != null "> and create_user_id = #{createUserId}</if>
|
<if test="updateUserId != null "> and update_user_id = #{updateUserId}</if>
|
<if test="teamType != null and teamType != ''"> and team_type = #{teamType}</if>
|
<if test="teamName != null and teamName != ''"> and team_name like concat('%', #{teamName}, '%')</if>
|
<if test="teamLocation != null and teamLocation != ''"> and team_location = #{teamLocation}</if>
|
<if test="nameOfLeader != null and nameOfLeader != ''"> and name_of_leader like concat('%', #{nameOfLeader}, '%')</if>
|
<if test="phoneOfLeader != null and phoneOfLeader != ''"> and phone_of_leader = #{phoneOfLeader}</if>
|
<if test="nameOfSecondLeader != null and nameOfSecondLeader != ''"> and name_of_second_leader = #{nameOfSecondLeader}</if>
|
<if test="phoneOfSecondLeader != null and phoneOfSecondLeader != ''"> and phone_of_second_leader = #{phoneOfSecondLeader}</if>
|
<if test="teamMembers != null and teamMembers != ''"> and team_members = #{teamMembers}</if>
|
</where>
|
</select>
|
|
<select id="selectEmergencyTeamById" parameterType="Long" resultMap="EmergencyTeamResult">
|
<include refid="selectEmergencyTeamVo"/>
|
where emergency_team_id = #{emergencyTeamId}
|
</select>
|
|
<insert id="insertEmergencyTeam" parameterType="EmergencyTeam" useGeneratedKeys="true" keyProperty="emergencyTeamId">
|
insert into dc_emergency_team
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="companyId != null ">company_id,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="createUserId != null ">create_user_id,</if>
|
<if test="createTime != null ">create_time,</if>
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
<if test="updateUserId != null ">update_user_id,</if>
|
<if test="updateTime != null ">update_time,</if>
|
<if test="remark != null and remark != ''">remark,</if>
|
<if test="teamType != null and teamType != ''">team_type,</if>
|
<if test="teamName != null and teamName != ''">team_name,</if>
|
<if test="teamLocation != null and teamLocation != ''">team_location,</if>
|
<if test="nameOfLeader != null and nameOfLeader != ''">name_of_leader,</if>
|
<if test="phoneOfLeader != null and phoneOfLeader != ''">phone_of_leader,</if>
|
<if test="nameOfSecondLeader != null and nameOfSecondLeader != ''">name_of_second_leader,</if>
|
<if test="phoneOfSecondLeader != null and phoneOfSecondLeader != ''">phone_of_second_leader,</if>
|
<if test="teamMembers != null and teamMembers != ''">team_members,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="companyId != null ">#{companyId},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createUserId != null ">#{createUserId},</if>
|
<if test="createTime != null ">#{createTime},</if>
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
<if test="updateUserId != null ">#{updateUserId},</if>
|
<if test="updateTime != null ">#{updateTime},</if>
|
<if test="remark != null and remark != ''">#{remark},</if>
|
<if test="teamType != null and teamType != ''">#{teamType},</if>
|
<if test="teamName != null and teamName != ''">#{teamName},</if>
|
<if test="teamLocation != null and teamLocation != ''">#{teamLocation},</if>
|
<if test="nameOfLeader != null and nameOfLeader != ''">#{nameOfLeader},</if>
|
<if test="phoneOfLeader != null and phoneOfLeader != ''">#{phoneOfLeader},</if>
|
<if test="nameOfSecondLeader != null and nameOfSecondLeader != ''">#{nameOfSecondLeader},</if>
|
<if test="phoneOfSecondLeader != null and phoneOfSecondLeader != ''">#{phoneOfSecondLeader},</if>
|
<if test="teamMembers != null and teamMembers != ''">#{teamMembers},</if>
|
</trim>
|
</insert>
|
|
<update id="updateEmergencyTeam" parameterType="EmergencyTeam">
|
update dc_emergency_team
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="companyId != null ">company_id = #{companyId},</if>
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
<if test="createUserId != null ">create_user_id = #{createUserId},</if>
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
<if test="updateUserId != null ">update_user_id = #{updateUserId},</if>
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
<if test="teamType != null and teamType != ''">team_type = #{teamType},</if>
|
<if test="teamName != null and teamName != ''">team_name = #{teamName},</if>
|
<if test="teamLocation != null and teamLocation != ''">team_location = #{teamLocation},</if>
|
<if test="nameOfLeader != null and nameOfLeader != ''">name_of_leader = #{nameOfLeader},</if>
|
<if test="phoneOfLeader != null and phoneOfLeader != ''">phone_of_leader = #{phoneOfLeader},</if>
|
<if test="nameOfSecondLeader != null and nameOfSecondLeader != ''">name_of_second_leader = #{nameOfSecondLeader},</if>
|
<if test="phoneOfSecondLeader != null and phoneOfSecondLeader != ''">phone_of_second_leader = #{phoneOfSecondLeader},</if>
|
<if test="teamMembers != null and teamMembers != ''">team_members = #{teamMembers},</if>
|
</trim>
|
where emergency_team_id = #{emergencyTeamId}
|
</update>
|
|
<delete id="deleteEmergencyTeamById" parameterType="Long">
|
delete from dc_emergency_team where emergency_team_id = #{emergencyTeamId}
|
</delete>
|
|
<delete id="deleteEmergencyTeamByIds" parameterType="String">
|
delete from dc_emergency_team where emergency_team_id in
|
<foreach item="emergencyTeamId" collection="array" open="(" separator="," close=")">
|
#{emergencyTeamId}
|
</foreach>
|
</delete>
|
|
</mapper>
|