From 94e5611b79ba1440d042eb062fb36b1b9f01a0be Mon Sep 17 00:00:00 2001
From: baizonghao <1719256278@qq.com>
Date: 星期四, 30 三月 2023 20:00:15 +0800
Subject: [PATCH] 过期时间

---
 ycl-platform/src/main/resources/mapper/caseHandler/WritMapper.xml |   32 ++++++++++++++++++++++++++------
 1 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/ycl-platform/src/main/resources/mapper/caseHandler/WritMapper.xml b/ycl-platform/src/main/resources/mapper/caseHandler/WritMapper.xml
index 0def7c2..c7b4f8c 100644
--- a/ycl-platform/src/main/resources/mapper/caseHandler/WritMapper.xml
+++ b/ycl-platform/src/main/resources/mapper/caseHandler/WritMapper.xml
@@ -23,20 +23,40 @@
         <result column="create_time" property="createTime"/>
     </resultMap>
 
+    <resultMap id="VoMap" type="com.ycl.vo.writ.WritVO" extends="BaseResultMap">
+        <result column="writ_type_name" property="writTypeName" jdbcType="VARCHAR"/>
+        <result column="category_name" property="categoryName" jdbcType="VARCHAR"/>
+        <result column="event_code" property="eventCode" jdbcType="VARCHAR"/>
+        <result column="template_code" property="templateCode" jdbcType="VARCHAR"/>
+
+    </resultMap>
     <!-- 閫氱敤鏌ヨ缁撴灉鍒� -->
     <sql id="Base_Column_List">
         base_case_id
         , illegal_building_id, writ_type, writ_code, illegal_type, send_time, limit_time, send_content, rectify_time, rectify_situation, remark, writ_pic, original_pic, rectified_pic, othen_pic, create_user, create_time
     </sql>
-    <select id="selectWritPage" resultType="com.ycl.vo.writ.WritVO">
-        SELECT t1.*, t2.`name` as writTemplateName
-        FROM ums_writ t1
-        LEFT JOIN ums_writ_template t2 on t1.writ_type = t2.id
+    <update id="deleteValueByCaseId">
+        update ums_writ set value = null where base_case_id = #{baseCaseId}
+    </update>
+<!--    <delete id="deleteValueByCaseId">-->
+<!--        delete from ums_writ where base_case_id = #{baseCaseId}-->
+<!--    </delete>-->
+    <select id="selectWritPage" resultMap="VoMap">
+        SELECT w.*, wt.`name` as writ_type_name,bc.`code` event_code,dd.`name` category_name,wt.code template_code
+        FROM ums_writ w
+        LEFT JOIN ums_writ_template wt on w.writ_type = wt.id
+        LEFT JOIN ums_illegal_building ib on w.illegal_building_id = ib.base_case_id
+        LEFT JOIN ums_data_dictionary dd on ib.category_id = dd.id
+        LEFT JOIN ums_base_case bc on ib.base_case_id = bc.id
         <where>
-            <if test="writType != null">
-                t1.writ_type=#{writType}
+            w.value is not null
+            <if test="keyword != null">
+                w.writ_code like CONCAT('%',#{keyword},'%')
+                or bc.`code` like CONCAT('%',#{keyword},'%')
+                or wt.name like CONCAT('%',#{keyword},'%')
             </if>
         </where>
+        order by w.create_time desc
     </select>
 
 </mapper>

--
Gitblit v1.8.0