From c428cfbdb79fdbb6b61ff10db62426d567e664a8 Mon Sep 17 00:00:00 2001 From: Crunchy <3114200645@qq.com> Date: 星期三, 17 七月 2024 16:37:21 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- performance-server/src/main/resources/mapper/AuxiliaryOutputWorkingHoursMapper.xml | 45 ++++++++++++++++++++------------------------- 1 files changed, 20 insertions(+), 25 deletions(-) diff --git a/performance-server/src/main/resources/mapper/AuxiliaryOutputWorkingHoursMapper.xml b/performance-server/src/main/resources/mapper/AuxiliaryOutputWorkingHoursMapper.xml index 0117578..de3994d 100644 --- a/performance-server/src/main/resources/mapper/AuxiliaryOutputWorkingHoursMapper.xml +++ b/performance-server/src/main/resources/mapper/AuxiliaryOutputWorkingHoursMapper.xml @@ -35,17 +35,18 @@ output_work_time, date_time, week, - week_day, + SUBSTRING(week_day, 2) AS week_day, 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> </if> - ) data + ) A <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> ${ew.customSqlSegment} </if> @@ -54,47 +55,41 @@ select aowh.*,name FROM auxiliary_output_working_hours aowh left join user on user.id=aowh.`check` - <if test="ids !=null and ids != ''"> - WHERE `check` in - <foreach collection="ids" index="index" open="(" separator="," close=")" item="val"> - #{val} - </foreach> - </if> + 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> </select> <select id="totalHours" resultType="java.util.Map"> select A.name, A.month, - A.output_work_time + A.manHours from( select user.name, - user.id, - depart_lims_id, - output_work_time, - date_time as month + date_time as month, + FORMAT(SUM(output_work_time), 2) 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}, '%') + <!--and `check` in (#{ids})--> <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 + group by user.name,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 </select> <select id="selectListByIds" resultType="com.yuanchu.mom.pojo.AuxiliaryOutputWorkingHours"> select * from auxiliary_output_working_hours where 1=1 + <!--and `check` in(#{ids})--> <if test="ids !=null and ids != ''"> and `check` in <foreach collection="ids" index="index" open="(" separator="," close=")" item="val"> -- Gitblit v1.9.3