From c6e38b6c66de5f5a8df5b8b2ab03a82c3b605db8 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期三, 03 十二月 2025 00:48:44 +0800
Subject: [PATCH] feat:优化同步
---
ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml
index ebc0e2d..d8abfba 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml
@@ -34,6 +34,7 @@
<result property="creatorName" column="creator_name" />
<result property="assigneeName" column="assignee_name" />
<result property="deptName" column="dept_name" />
+ <result property="vehicleNo" column="vehicle_no" />
<collection property="assignedVehicles" ofType="SysTaskVehicle">
<result property="id" column="tv_id" />
<result property="taskId" column="tv_task_id" />
@@ -57,6 +58,14 @@
t.actual_start_time, t.actual_end_time, t.creator_id, t.assignee_id, t.dept_id,
t.create_time, t.update_time, t.create_by, t.update_by, t.remark, t.del_flag, t.legacy_synced,
u1.nick_name as creator_name, u2.nick_name as assignee_name, d.dept_name,
+ (
+ select v2.vehicle_no
+ from sys_task_vehicle tv2
+ left join tb_vehicle_info v2 on tv2.vehicle_id = v2.vehicle_id
+ where tv2.task_id = t.task_id
+ order by tv2.assign_time asc
+ limit 1
+ ) as vehicle_no,
tv.id as tv_id, tv.task_id as tv_task_id, tv.vehicle_id as tv_vehicle_id,
v.vehicle_no as tv_vehicle_no, v.vehicle_type as tv_vehicle_type,
v.vehicle_brand as tv_vehicle_brand, v.vehicle_model as tv_vehicle_model,
@@ -77,6 +86,7 @@
<if test="taskCode != null and taskCode != ''"> and t.task_code like concat('%', #{taskCode}, '%')</if>
<if test="taskType != null and taskType != ''"> and t.task_type = #{taskType}</if>
<if test="taskStatus != null and taskStatus != ''"> and t.task_status = #{taskStatus}</if>
+ <if test="vehicleNo != null and vehicleNo != ''"> and v.vehicle_no like concat('%', #{vehicleNo}, '%')</if>
<!-- 缁煎悎鏌ヨ锛氬綋鍓嶇敤鎴锋墍鍦ㄦ満鏋� OR 褰撳墠鐢ㄦ埛鍒涘缓 OR 鍒嗛厤缁欏綋鍓嶇敤鎴� -->
<if test="(creatorId != null and creatorId != 0) or (assigneeId != null and assigneeId != 0) or (deptId != null and deptId != 0)">
and (
@@ -186,10 +196,6 @@
<if test="creatorId != null">creator_id,</if>
<if test="assigneeId != null">assignee_id,</if>
<if test="deptId != null">dept_id,</if>
- <if test="plannedStartTime!=null">planned_start_time,</if>
- <if test="plannedEndTime!=null">planned_end_time,</if>
- <if test="plannedStartTime!=null">planned_start_time,</if>
- <if test="plannedEndTime!=null">planned_end_time,</if>
<if test="createTime != null">create_time,</if>
update_time,
<if test="createBy != null">create_by,</if>
@@ -216,10 +222,6 @@
<if test="creatorId != null">#{creatorId},</if>
<if test="assigneeId != null">#{assigneeId},</if>
<if test="deptId != null">#{deptId},</if>
- <if test="plannedStartTime!=null">#{plannedStartTime},</if>
- <if test="plannedEndTime!=null">#{plannedEndTime},</if>
- <if test="actualStartTime!=null">#{actualStartTime},</if>
- <if test="actualEndTime!=null">#{actualEndTime},</if>
<if test="createTime != null">#{createTime},</if>
now(),
<if test="createBy != null">#{createBy},</if>
@@ -249,6 +251,7 @@
<if test="actualEndTime != null">actual_end_time = #{actualEndTime},</if>
<if test="creatorId != null">creator_id = #{creatorId},</if>
<if test="assigneeId != null">assignee_id = #{assigneeId},</if>
+
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
--
Gitblit v1.9.1