From 52d79c7e5a1fb4316f34886ec336f69f56d5edb2 Mon Sep 17 00:00:00 2001
From: lxp <1928192722@qq.com>
Date: 星期六, 15 三月 2025 10:48:46 +0800
Subject: [PATCH] 工时管理日工时管理以及辅助工时配置

---
 performance-server/src/main/resources/mapper/AuxiliaryWorkingHoursDayMapper.xml |   41 ++++++++++++++++++-----------------------
 1 files changed, 18 insertions(+), 23 deletions(-)

diff --git a/performance-server/src/main/resources/mapper/AuxiliaryWorkingHoursDayMapper.xml b/performance-server/src/main/resources/mapper/AuxiliaryWorkingHoursDayMapper.xml
index 48e6bb2..806befc 100644
--- a/performance-server/src/main/resources/mapper/AuxiliaryWorkingHoursDayMapper.xml
+++ b/performance-server/src/main/resources/mapper/AuxiliaryWorkingHoursDayMapper.xml
@@ -25,16 +25,15 @@
         <result column="update_user" property="updateUser"/>
         <result column="state" property="state"/>
     </resultMap>
-
-    <sql id="selectAuxiliaryWorkingHours">
+    <select id="selectAuxiliaryWorkingHoursDay" resultType="com.ruoyi.performance.dto.AuxiliaryWorkingHoursDayDto">
         select A.*
         from (
         select awhd.*,name
         FROM auxiliary_working_hours_day awhd
-        left join user on name_user=user.id
+        left join user on awhd.name_user=user.id
         WHERE 1=1
-        <if test="ids !=null and ids.size() > 0">
-            and name_user in
+        <if test="ids !=null and ids.size()>0">
+            and awhd.name_user in
             <foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
                 #{val}
             </foreach>
@@ -43,17 +42,13 @@
         <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
             ${ew.customSqlSegment}
         </if>
-    </sql>
-
-    <select id="selectAuxiliaryWorkingHoursDay" resultType="com.ruoyi.performance.dto.AuxiliaryWorkingHoursDayDto">
-        <include refid="selectAuxiliaryWorkingHours"/>
     </select>
     <select id="selectDataByUser" resultType="com.ruoyi.performance.dto.AuxiliaryWorkingHoursDayDto">
         select awhd.*,name
         FROM auxiliary_working_hours_day awhd
         left join user on name_user=user.id
         WHERE 1=1
-        <if test="ids !=null and ids.size() > 0">
+        <if test="ids !=null and ids.size()>0">
             and name_user in
             <foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
                 #{val}
@@ -63,7 +58,7 @@
     <select id="selectListByIds" resultType="com.ruoyi.performance.pojo.AuxiliaryWorkingHoursDay">
         select * from auxiliary_working_hours_day
         where state='宸插鏍�'
-        <if test="ids !=null and ids != ''">
+        <if test="ids !=null and ids.size()>0">
             and name_user in
             <foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
                 #{val}
@@ -76,20 +71,23 @@
         FORMAT(SUM(manHour), 4)as manHours
         from(
         select user.name,
-        case when reviewer_nonproductive_time is null then nonproductive_time
-        else reviewer_nonproductive_time end as manHour,
+        case
+        when reviewer_nonproductive_time is not null then reviewer_nonproductive_time
+        when reviewer_nonproductive_time is null and nonproductive_time is not null then nonproductive_time
+        else 0
+        end as manHour,
         date_time as month
         from auxiliary_working_hours_day awhd
         left join user on user.id=awhd.name_user
         left join department_lims dl on depart_lims_id=dl.id
         where date_time LIKE CONCAT('%', #{month}, '%')
         and awhd.state='宸叉壒鍑�'
-         <if test="ids !=null and ids.size() > 0">
-             and name_user in
-             <foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
-                 #{val}
-             </foreach>
-         </if>
+        <if test="ids !=null and ids.size()>0">
+            and name_user in
+            <foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
+                #{val}
+            </foreach>
+        </if>
         order by month,user.name
         )A
         group by A.name,A.month
@@ -99,7 +97,7 @@
     <select id="selectLists" resultMap="BaseResultMap">
         select * from(select * from auxiliary_working_hours_day
         WHERE 1=1
-        <if test="ids !=null and ids.size() > 0">
+        <if test="ids !=null and ids.size()>0">
             and name_user in
             <foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
                 #{val}
@@ -109,8 +107,5 @@
         <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
             ${ew.customSqlSegment}
         </if>
-    </select>
-    <select id="selectAuxiliaryWorkingHoursDayList" resultType="com.ruoyi.performance.dto.AuxiliaryWorkingHoursDayDto">
-        <include refid="selectAuxiliaryWorkingHours"/>
     </select>
 </mapper>

--
Gitblit v1.9.3