From 2f71d2a6f77277766f81ecfcfc1df19a4784e897 Mon Sep 17 00:00:00 2001
From: songhuangfeng123 <shf18767906695@163.com>
Date: 星期一, 08 八月 2022 19:05:40 +0800
Subject: [PATCH] 事故rpc接口

---
 emergency/emergency-service/src/main/resource/config/mapper/emergency/EmergencyDrillPlanInfoMapper.xml |   40 +++++++++++++++++++++++++++++++++-------
 1 files changed, 33 insertions(+), 7 deletions(-)

diff --git a/emergency/emergency-service/src/main/resource/config/mapper/emergency/EmergencyDrillPlanInfoMapper.xml b/emergency/emergency-service/src/main/resource/config/mapper/emergency/EmergencyDrillPlanInfoMapper.xml
index 5c6c409..0ab2386 100644
--- a/emergency/emergency-service/src/main/resource/config/mapper/emergency/EmergencyDrillPlanInfoMapper.xml
+++ b/emergency/emergency-service/src/main/resource/config/mapper/emergency/EmergencyDrillPlanInfoMapper.xml
@@ -16,7 +16,9 @@
     </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
+        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"
@@ -33,6 +35,7 @@
             <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>
@@ -56,6 +59,7 @@
             <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>
@@ -79,6 +83,7 @@
         <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"/>
@@ -93,23 +98,44 @@
     </resultMap>
 
     <select id="selectEmergencyDrillPlanById" resultMap="emergencyDrillPlanInfoDetailDOResult">
-        select id ,`status`,`gmt_moditify`,`making_plan_date`,`drill_plan_date`,making_user_uid ,making_department_id ,plan_id ,department_id,
-         drill_expense ,drill_name ,drill_address ,drill_way ,drill_level ,insurance_measures ,remark ,purpose
-        from emergency_drill_plan
-        where del_flag = 0 and id = #{id}
+    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="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="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>

--
Gitblit v1.9.2