From dd43f10cba754d4a7b371b9bf39db262b94d3c10 Mon Sep 17 00:00:00 2001
From: Crunchy <3114200645@qq.com>
Date: 星期二, 23 七月 2024 15:43:59 +0800
Subject: [PATCH] 数采报错修复
---
performance-server/src/main/resources/mapper/AuxiliaryOutputWorkingHoursMapper.xml | 50 +++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 41 insertions(+), 9 deletions(-)
diff --git a/performance-server/src/main/resources/mapper/AuxiliaryOutputWorkingHoursMapper.xml b/performance-server/src/main/resources/mapper/AuxiliaryOutputWorkingHoursMapper.xml
index 8210a83..31958ad 100644
--- a/performance-server/src/main/resources/mapper/AuxiliaryOutputWorkingHoursMapper.xml
+++ b/performance-server/src/main/resources/mapper/AuxiliaryOutputWorkingHoursMapper.xml
@@ -4,7 +4,9 @@
<!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
<resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.AuxiliaryOutputWorkingHours">
<id column="id" property="id"/>
- <result column="inspect_project" property="inspectProject"/>
+ <result column="inspection_item" property="inspectionItem"/>
+ <result column="inspection_item_subclass" property="inspectionItemSubclass"/>
+ <result column="sample" property="sample"/>
<result column="overtime_order_no" property="overtimeOrderNo"/>
<result column="overtime_work_time" property="overtimeWorkTime"/>
<result column="overtime_amount" property="overtimeAmount"/>
@@ -25,7 +27,8 @@
select *
from (
select aowh.id,
- inspect_project,
+ inspection_item,
+ inspection_item_subclass,
overtime_order_no,
overtime_work_time,
overtime_amount,
@@ -39,8 +42,9 @@
name
FROM auxiliary_output_working_hours aowh
left join user on user.id=aowh.`check`
+ WHERE 1=1
<if test="ids !=null and ids != ''">
- WHERE `check` in
+ and `check` in
<foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
#{val}
</foreach>
@@ -54,8 +58,9 @@
select aowh.*,name
FROM auxiliary_output_working_hours aowh
left join user on user.id=aowh.`check`
+ WHERE 1=1
<if test="ids !=null and ids != ''">
- WHERE `check` in
+ and `check` in
<foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
#{val}
</foreach>
@@ -64,24 +69,36 @@
<select id="totalHours" resultType="java.util.Map">
select A.name,
A.month,
- A.manHours
+ FORMAT(SUM(A.manHours), 4) manHours
from(
select user.name,
date_time as month,
- sum(output_work_time) as manHours
+ order_no,
+ sample,
+ man_hour_group,
+ output_work_time as manHours
+ -- FORMAT(SUM(output_work_time), 4) as manHours
from auxiliary_output_working_hours aowh
left join user on user.id=aowh.`check`
left join department_lims dl on depart_lims_id=dl.id
where date_time LIKE CONCAT('%', #{month}, '%')
<if test="ids !=null and ids != ''">
and `check` in
- <foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
+ <foreach collection="ids" open="(" separator="," close=")" item="val">
#{val}
</foreach>
</if>
- group by user.name,month
- order by month,user.name
+ group by user.name,date_time,order_no,
+ sample,
+ man_hour_group
+ order by user.name,date_time,order_no,
+ sample,
+ man_hour_group
)A
+ group by A.name,
+ A.month
+ order by A.name,
+ A.month
</select>
<select id="selectListByIds" resultType="com.yuanchu.mom.pojo.AuxiliaryOutputWorkingHours">
select * from auxiliary_output_working_hours
@@ -93,4 +110,19 @@
</foreach>
</if>
</select>
+
+ <select id="selectLists" resultMap="BaseResultMap">
+ select * from(select * from auxiliary_output_working_hours
+ WHERE 1=1
+ <if test="ids !=null and ids != ''">
+ and `check` in
+ <foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
+ #{val}
+ </foreach>
+ </if>
+ ) A
+ <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
+ ${ew.customSqlSegment}
+ </if>
+ </select>
</mapper>
--
Gitblit v1.9.3