From 90276a76b56cc1e744f7fa68ce921a28a8a9c92f Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期三, 08 一月 2025 11:52:10 +0800
Subject: [PATCH] 运行监控报表导出时间少一天问题

---
 ycl-server/src/main/resources/mapper/zgyw/WorkOrderYwConditionRecordMapper.xml |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/ycl-server/src/main/resources/mapper/zgyw/WorkOrderYwConditionRecordMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/WorkOrderYwConditionRecordMapper.xml
index 24fc1cd..992bf4f 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/WorkOrderYwConditionRecordMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/WorkOrderYwConditionRecordMapper.xml
@@ -7,16 +7,29 @@
         <result column="id" property="id"/>
         <result column="create_time" property="createTime"/>
         <result column="yw_condition" property="ywCondition"/>
-        <result column="commit_user" property="commitUser"/>
-        <result column="nick_name" property="commitUserName"/>
+        <result column="unitId" property="unitId"/>
+        <result column="unit_name" property="unitName"/>
+        <result column="sys_msg" property="sysMsg"/>
         <result column="yw_proofMaterials" property="ywProofMaterials"/>
+        <result column="user_id" property="userId"/>
     </resultMap>
 
     <select id="selectYwConditionByYwId" resultMap="BaseResultMap">
-        SELECT yw.id, yw.commit_user, yw.yw_condition, yw.yw_proofMaterials, yw.create_time, yw.sys_msg, su.nick_name
+        SELECT DISTINCT yw.id, yu.id as unit_id, yu.unit_name,yw.yw_condition, yw.yw_proofMaterials ,yw.create_time, yw.sys_msg, su.nick_name,su.user_id
         FROM t_work_order_yw_condition_record yw
-                 INNER JOIN sys_user su ON yw.commit_user = su.user_id AND yw.deleted = 0 AND yw.work_order_id = #{workOrderId}
+                 LEFT JOIN sys_user su ON yw.commit_user = su.user_id AND yw.deleted = 0
+                 LEFT JOIN t_yw_unit yu ON su.unit_id = yu.id
+        WHERE
+            yw.work_order_no = #{workOrderNo}
         ORDER BY yw.create_time DESC
     </select>
 
+    <insert id="insertMany">
+        insert into t_work_order_yw_condition_record (work_order_no, commit_user, yw_condition, deleted, create_time)
+        values
+        <foreach collection="ywRecordList" item="item" separator=",">
+            (#{item.workOrderNo}, #{item.commitUser}, #{item.ywCondition}, 0, now())
+        </foreach>
+    </insert>
+
 </mapper>

--
Gitblit v1.8.0