From b591b26cc9290e1469281e3bc22b8aea4f8d061a Mon Sep 17 00:00:00 2001
From: songhuangfeng123 <shf18767906695@163.com>
Date: 星期三, 06 七月 2022 15:30:05 +0800
Subject: [PATCH] 应急队伍

---
 emergency/emergency-service/src/main/resource/config/mapper/emergency/EmergencyTeamInfoMapper.xml |  114 +++++++++++++++++++++++++++++++++++----------------------
 1 files changed, 70 insertions(+), 44 deletions(-)

diff --git a/emergency/emergency-service/src/main/resource/config/mapper/emergency/EmergencyTeamInfoMapper.xml b/emergency/emergency-service/src/main/resource/config/mapper/emergency/EmergencyTeamInfoMapper.xml
index 94d5405..8cc914f 100644
--- a/emergency/emergency-service/src/main/resource/config/mapper/emergency/EmergencyTeamInfoMapper.xml
+++ b/emergency/emergency-service/src/main/resource/config/mapper/emergency/EmergencyTeamInfoMapper.xml
@@ -6,59 +6,63 @@
 
     <resultMap type="com.gkhy.safePlatform.emergency.entity.EmergencyTeamInfoPageDO" id="emergencyTeamInfoPageDOResult">
         <id column="id" property="id" jdbcType="BIGINT"/>
-        <result column="team_level" property="teamLevel" />
-        <result column="team_name" property="teamName" />
-        <result column="principal_phone" property="principalPhone" />
-        <result column="team_desc" property="teamDesc" />
+        <result column="team_level" property="teamLevel"/>
+        <result column="team_name" property="teamName"/>
+        <result column="principal_phone" property="principalPhone"/>
+        <result column="team_desc" property="teamDesc"/>
     </resultMap>
 
     <select id="selectEmergencyTeamList" resultMap="emergencyTeamInfoPageDOResult">
         select id,`team_level`,`team_name`,`principal_phone`,`team_desc` from emergency_team where del_flag = 0
-        <if test="query.teamName != null  and query.teamName != ''"> and `team_name` like concat('%', #{query.teamName}, '%')</if>
-        <if test="query.teamLevel != null  and query.teamLevel != ''"> and `team_level` = #{query.teamLevel}</if>
+        <if test="query.teamName != null  and query.teamName != ''">and `team_name` like concat('%', #{query.teamName},'%')</if>
+        <if test="query.teamLevel != null  and query.teamLevel != ''">and `team_level` = #{query.teamLevel}</if>
     </select>
 
-    <insert id="addEmergencyTeam" parameterType="com.gkhy.safePlatform.emergency.entity.EmergencyTeamInfo" keyProperty="id" useGeneratedKeys="true">
-        insert into emergency_team(
-        <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="principalUid != null ">principal_uid,</if>
-        <if test="principalDepartmentId != null ">principal_department_id,</if>
-        <if test="teamLevel != null and teamLevel != ''">team_level,</if>
-        <if test="teamName != null and teamName != ''">team_name,</if>
-        <if test="principalPhone != null and principalPhone != ''">principal_phone,</if>
-        <if test="telephoneNumber != null and telephoneNumber != ''">telephone_number,</if>
-        <if test="teamDesc != null and teamDesc != ''">team_desc</if>
-        )values(
-        <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="principalUid != null ">#{principalUid},</if>
-        <if test="principalDepartmentId != null ">#{principalDepartmentId},</if>
-        <if test="teamLevel != null and teamLevel != ''">#{teamLevel},</if>
-        <if test="teamName != null and teamName != ''">#{teamName},</if>
-        <if test="principalPhone != null and principalPhone != ''">#{principalPhone},</if>
-        <if test="telephoneNumber != null and telephoneNumber != ''">#{telephoneNumber},</if>
-        <if test="teamDesc != null and teamDesc != ''">#{teamDesc}</if>
-        )
+    <insert id="addEmergencyTeam" parameterType="com.gkhy.safePlatform.emergency.entity.EmergencyTeamInfo"
+            keyProperty="id" useGeneratedKeys="true">
+        insert into emergency_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="principalUid != null ">principal_uid,</if>
+            <if test="principalDepartmentId != null ">principal_department_id,</if>
+            <if test="teamLevel != null and teamLevel != ''">team_level,</if>
+            <if test="teamName != null and teamName != ''">team_name,</if>
+            <if test="principalPhone != null and principalPhone != ''">principal_phone,</if>
+            <if test="telephoneNumber != null and telephoneNumber != ''">telephone_number,</if>
+            <if test="teamDesc != null and teamDesc != ''">team_desc,</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="principalUid != null ">#{principalUid},</if>
+            <if test="principalDepartmentId != null ">#{principalDepartmentId},</if>
+            <if test="teamLevel != null and teamLevel != ''">#{teamLevel},</if>
+            <if test="teamName != null and teamName != ''">#{teamName},</if>
+            <if test="principalPhone != null and principalPhone != ''">#{principalPhone},</if>
+            <if test="telephoneNumber != null and telephoneNumber != ''">#{telephoneNumber},</if>
+            <if test="teamDesc != null and teamDesc != ''">#{teamDesc},</if>
+        </trim>
     </insert>
 
-    <resultMap type="com.gkhy.safePlatform.emergency.entity.EmergencyTeamInfoDetailDO" id="emergencyTeamInfoDetailDOResult">
+    <resultMap type="com.gkhy.safePlatform.emergency.entity.EmergencyTeamInfoDetailDO"
+               id="emergencyTeamInfoDetailDOResult">
         <id column="id" property="id" jdbcType="BIGINT"/>
-        <result column="principal_uid" property="principalUid" />
-        <result column="principal_department_id" property="principalDepartmentId" />
-        <result column="team_level" property="teamLevel" />
-        <result column="team_name" property="teamName" />
-        <result column="principal_phone" property="principalPhone" />
-        <result column="telephone_number" property="telephoneNumber" />
-        <result column="team_desc" property="teamDesc" />
+        <result column="principal_uid" property="principalUid"/>
+        <result column="principal_department_id" property="principalDepartmentId"/>
+        <result column="team_level" property="teamLevel"/>
+        <result column="team_name" property="teamName"/>
+        <result column="principal_phone" property="principalPhone"/>
+        <result column="telephone_number" property="telephoneNumber"/>
+        <result column="team_desc" property="teamDesc"/>
     </resultMap>
 
     <select id="selectEmergencyTeamById" resultMap="emergencyTeamInfoDetailDOResult">
@@ -66,4 +70,26 @@
         from emergency_team where del_flag = 0 and id = #{id}
     </select>
 
+    <update id="updateEmergencyTeam" parameterType="com.gkhy.safePlatform.emergency.entity.EmergencyTeamInfo">
+        update emergency_team
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="gmtCreate != null ">gmt_create = #{gmtCreate},</if>
+            <if test="gmtModitify != null ">gmt_moditify = #{gmtModitify},</if>
+            <if test="createUid != null ">create_uid = #{createUid},</if>
+            <if test="updateUid != null ">update_uid = #{updateUid},</if>
+            <if test="principalUid != null ">principal_uid = #{principalUid},</if>
+            <if test="principalDepartmentId != null ">principal_department_id = #{principalDepartmentId},</if>
+            <if test="teamLevel != null and teamLevel != ''">team_level = #{teamLevel},</if>
+            <if test="teamName != null and teamName != ''">team_name = #{teamName},</if>
+            <if test="principalPhone != null and principalPhone != ''">principal_phone = #{principalPhone},</if>
+            <if test="telephoneNumber != null and telephoneNumber != ''">telephone_number = #{telephoneNumber},</if>
+            <if test="teamDesc != null and teamDesc != ''">team_desc = #{teamDesc},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="deleteEmergencyTeamById">
+        update emergency_team set del_flag = 1 where id = #{teamId}
+    </update>
+
 </mapper>

--
Gitblit v1.9.2