From f14c50cb0036d3ddd655ce4e34732ba396a836c4 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期二, 30 五月 2023 12:42:03 +0800
Subject: [PATCH] optimize 统计
---
java110-db/src/main/resources/mapper/community/MaintainanceTaskV1ServiceDaoImplMapper.xml | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 52 insertions(+), 3 deletions(-)
diff --git a/java110-db/src/main/resources/mapper/community/MaintainanceTaskV1ServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/community/MaintainanceTaskV1ServiceDaoImplMapper.xml
index 792d954..a512b3a 100644
--- a/java110-db/src/main/resources/mapper/community/MaintainanceTaskV1ServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/community/MaintainanceTaskV1ServiceDaoImplMapper.xml
@@ -24,8 +24,11 @@
authDesc,t.original_plan_user_id,t.original_plan_user_id originalPlanUserId,t.task_type,t.task_type
taskType,t.plan_id,t.plan_id planId,t.plan_end_time,t.plan_end_time
planEndTime,t.plan_user_name,t.plan_user_name planUserName,t.community_id,t.community_id
- communityId,t.act_user_id,t.act_user_id actUserId,t.task_id,t.task_id taskId,t.mps_id,t.mps_id mpsId
+ communityId,t.act_user_id,t.act_user_id actUserId,t.task_id,t.task_id taskId,t.mps_id,t.mps_id mpsId,
+ mp.plan_name planName,td.`name` stateName
from maintainance_task t
+ left join maintainance_plan mp on t.plan_id = mp.plan_id and mp.status_cd = '0'
+ left join t_dict td on t.state = td.status_cd and td.table_name = 'maintainance_task' and td.table_columns = 'state'
where 1 =1
<if test="planUserId !=null and planUserId != ''">
and t.plan_user_id= #{planUserId}
@@ -34,7 +37,7 @@
and t.act_ins_time= #{actInsTime}
</if>
<if test="planInsTime !=null and planInsTime != ''">
- and t.plan_ins_time= #{planInsTime}
+ and DATE_FORMAT(t.plan_ins_time,'%Y-%m-%d')= #{planInsTime}
</if>
<if test="originalPlanUserName !=null and originalPlanUserName != ''">
and t.original_plan_user_name= #{originalPlanUserName}
@@ -77,6 +80,15 @@
</if>
<if test="mpsId !=null and mpsId != ''">
and t.mps_id= #{mpsId}
+ </if>
+ <if test="state !=null and state != ''">
+ and t.state= #{state}
+ </if>
+ <if test="states !=null ">
+ and t.state in
+ <foreach collection="states" item="item" open="(" close=")" separator=",">
+ #{item}
+ </foreach>
</if>
order by t.create_time desc
<if test="page != -1 and page != null ">
@@ -137,6 +149,9 @@
<if test="mpsId !=null and mpsId != ''">
, t.mps_id= #{mpsId}
</if>
+ <if test="state !=null and state != ''">
+ , t.state= #{state}
+ </if>
where 1=1
<if test="taskId !=null and taskId != ''">
and t.task_id= #{taskId}
@@ -156,7 +171,7 @@
and t.act_ins_time= #{actInsTime}
</if>
<if test="planInsTime !=null and planInsTime != ''">
- and t.plan_ins_time= #{planInsTime}
+ and DATE_FORMAT(t.plan_ins_time,'%Y-%m-%d')= #{planInsTime}
</if>
<if test="originalPlanUserName !=null and originalPlanUserName != ''">
and t.original_plan_user_name= #{originalPlanUserName}
@@ -200,8 +215,42 @@
<if test="mpsId !=null and mpsId != ''">
and t.mps_id= #{mpsId}
</if>
+ <if test="state !=null and state != ''">
+ and t.state= #{state}
+ </if>
+ <if test="states !=null ">
+ and t.state in
+ <foreach collection="states" item="item" open="(" close=")" separator=",">
+ #{item}
+ </foreach>
+ </if>
</select>
+ <!-- 淇濆瓨娲诲姩淇℃伅 add by wuxw 2018-07-03 -->
+ <insert id="insertMaintainanceTask" parameterType="Map">
+ insert into maintainance_task(
+ plan_user_id,act_ins_time,plan_ins_time,original_plan_user_name,transfer_desc,act_user_name,auth_desc,original_plan_user_id,task_type,plan_id,plan_end_time,plan_user_name,community_id,act_user_id,task_id,mps_id
+ ) values
+ <foreach collection="tasks" item="item" separator=",">
+ (
+ #{item.planUserId},#{item.actInsTime},#{item.planInsTime},#{item.originalPlanUserName},#{item.transferDesc},#{item.actUserName},#{item.authDesc},#{item.originalPlanUserId},#{item.taskType},#{item.planId},#{item.planEndTime},#{item.planUserName},#{item.communityId},#{item.actUserId},#{item.taskId},#{item.mpsId}
+ )
+ </foreach>
+ </insert>
+
+ <!-- 淇濆瓨娲诲姩淇℃伅 add by wuxw 2018-07-03 -->
+ <insert id="insertMaintainanceTaskDetail" parameterType="Map">
+ insert into maintainance_task_detail(
+ send_flag,point_end_time,inspection_time,sort_number,machine_name,act_user_name,task_detail_id,machine_id,point_start_time,state,community_id,act_user_id,task_id
+ ) values
+ <foreach collection="tasks" item="task" separator=",">
+ (
+ #{task.sendFlag},#{task.pointEndTime},#{task.inspectionTime},#{task.sortNumber},#{task.machineName},#{task.actUserName},#{task.taskDetailId},#{task.machineId},#{task.pointStartTime},#{task.state},#{task.communityId},#{task.actUserId},#{task.taskId}
+ )
+ </foreach>
+ </insert>
+
+
</mapper>
--
Gitblit v1.8.0