From 051414acd3a8c3e761d1010b14014d6b9bddd7fb Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期二, 15 十月 2024 15:52:06 +0800
Subject: [PATCH] statistic workload change
---
pms-parent/pms-global/src/main/resources/mapper/OthStatisticWorkloadMapper.xml | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/pms-parent/pms-global/src/main/resources/mapper/OthStatisticWorkloadMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/OthStatisticWorkloadMapper.xml
index 88aac97..6e49e54 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/OthStatisticWorkloadMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/OthStatisticWorkloadMapper.xml
@@ -66,11 +66,11 @@
</insert>
<insert id="insertBatch">
INSERT INTO oth_statistic_workload
- (statistic_date,user_id
+ (id,statistic_date,user_id
,user_name,type,node_content
,number)
WITH total as (select
- DISTINCT(t.device_no),t.curr_node,t.node_content,t.number,p.pro_name, p.plan_name,u.id user_id,u.`name` user_name
+ DISTINCT(t.device_no) device_no,t.curr_node,t.node_content,t.number,p.pro_name, p.plan_name,u.id user_id,u.`name` user_name
FROM
(select * from sta_device_production_log_past
where repair_id IS NULL and out_time BETWEEN #{startDt} AND #{endDt}
@@ -81,12 +81,12 @@
left join (select pap.id,pap.`name` as plan_name,pp.`name` as pro_name
from pr_assembly_plan pap, plt_product pp where pap.pro_id = pp.id) p on t.plan_id = p.id
left JOIN ba_user u on u.id=t.updated_by)
- select DATE_FORMAT(#{startDt}, '%Y-%m-%d') as statistic_date,user_id, user_name,'璁″垝浠诲姟' AS type, node_content ,sum(number) as number from total where curr_node IS NOT NULL GROUP BY user_id,user_name,node_content
+ select null AS id, DATE_FORMAT(#{startDt}, '%Y-%m-%d') as statistic_date,user_id, user_name,'璁″垝浠诲姟' AS type, node_content ,sum(number) as number from total where curr_node IS NOT NULL GROUP BY user_id,user_name,node_content
UNION
- select DATE_FORMAT(#{startDt}, '%Y-%m-%d') as statistic_date, user_id, user_name,'涓存椂浠诲姟' AS type, node_content, sum(number) as number from total where curr_node IS NULL AND (device_no !='' AND device_no IS NOT NULL)
+ select null AS id, DATE_FORMAT(#{startDt}, '%Y-%m-%d') as statistic_date, user_id, user_name,'涓存椂浠诲姟' AS type, node_content, sum(number) as number from total where curr_node IS NULL AND (device_no !='' AND device_no IS NOT NULL)
GROUP BY user_id,user_name,node_content
UNION
- select DATE_FORMAT(#{startDt}, '%Y-%m-%d') as statistic_date,user_id , user_name,'涓存椂浠诲姟(鏃犺澶囩爜)' AS type,node_content, sum(number) as number from total where curr_node IS NULL AND (device_no IS NULL OR device_no ='')
+ select null AS id, DATE_FORMAT(#{startDt}, '%Y-%m-%d') as statistic_date,user_id , user_name,'涓存椂浠诲姟(鏃犺澶囩爜)' AS type,node_content, sum(number) as number from total where curr_node IS NULL AND (device_no IS NULL OR device_no ='')
GROUP BY user_id,user_name,node_content;
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoOth.OthStatisticWorkload">
--
Gitblit v1.8.0