From 5ae5596b024929f6ecd857411e7c2d64c1c96aca Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期五, 25 十月 2024 17:23:25 +0800
Subject: [PATCH] 总报告调试
---
performance-server/src/main/resources/mapper/AuxiliaryOutputWorkingHoursMapper.xml | 62 +++++++++++++++++++-----------
1 files changed, 39 insertions(+), 23 deletions(-)
diff --git a/performance-server/src/main/resources/mapper/AuxiliaryOutputWorkingHoursMapper.xml b/performance-server/src/main/resources/mapper/AuxiliaryOutputWorkingHoursMapper.xml
index 0117578..b37e74b 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,9 @@
select *
from (
select aowh.id,
- inspect_project,
+ inspection_item,
+ num,
+ inspection_item_subclass,
overtime_order_no,
overtime_work_time,
overtime_amount,
@@ -36,16 +40,18 @@
date_time,
week,
week_day,
- name
+ name,
+ sample
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>
</if>
- ) data
+ ) A
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
${ew.customSqlSegment}
</if>
@@ -54,8 +60,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,33 +71,27 @@
<select id="totalHours" resultType="java.util.Map">
select A.name,
A.month,
- A.output_work_time
+ FORMAT(SUM(A.manHours), 4) manHours
from(
select user.name,
- user.id,
- depart_lims_id,
- output_work_time,
- date_time as month
+ date_time as month,
+ case when #{type}='鍔犵彮宸ユ椂' then case when overtime_work_time is null then 0 else overtime_work_time end
+ else case when work_time is null then 0 else work_time end end 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 between #{startTime} and #{endTime}
+ 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>
- order by date_time
+ order by user.name,date_time
)A
- where 1=1
- <if test="userId !=null and userId != ''">
- and A.user_id=#{userId}
- </if>
- <if test="departId !=null and departId != ''">
- and A.depart_lims_id=#{departId}
- </if>
- group by A.name,A.month
+ 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
@@ -102,4 +103,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