From 16d63c3d68d131ad0cc4a8bd9f22a0c0515aa6bf Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期三, 17 七月 2024 18:23:57 +0800
Subject: [PATCH] 工时的各需求+检验任务修改

---
 performance-server/src/main/resources/mapper/AuxiliaryWorkingHoursDayMapper.xml |   82 ++++++++++++++++++++++++++++++++++++++---
 1 files changed, 76 insertions(+), 6 deletions(-)

diff --git a/performance-server/src/main/resources/mapper/AuxiliaryWorkingHoursDayMapper.xml b/performance-server/src/main/resources/mapper/AuxiliaryWorkingHoursDayMapper.xml
index 0fedc4f..476beb0 100644
--- a/performance-server/src/main/resources/mapper/AuxiliaryWorkingHoursDayMapper.xml
+++ b/performance-server/src/main/resources/mapper/AuxiliaryWorkingHoursDayMapper.xml
@@ -4,7 +4,7 @@
     <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
     <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.AuxiliaryWorkingHoursDay">
         <id column="id" property="id"/>
-        <result column="name" property="name"/>
+        <result column="nameUser" property="nameUser"/>
         <result column="number" property="number"/>
         <result column="auxiliary_project" property="auxiliaryProject"/>
         <result column="approved_working_hour" property="approvedWorkingHour"/>
@@ -25,12 +25,82 @@
         <result column="update_user" property="updateUser"/>
         <result column="state" property="state"/>
     </resultMap>
-    <select id="selectAuxiliaryWorkingHoursDay" resultType="com.yuanchu.mom.pojo.AuxiliaryWorkingHoursDay">
-        select data.*
+    <select id="selectAuxiliaryWorkingHoursDay" resultType="com.yuanchu.mom.dto.AuxiliaryWorkingHoursDayDto">
+        select A.*
         from (
-        select *
-        FROM auxiliary_working_hours_day
-        ) data
+        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 != ''">
+            and name_user 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>
+    <select id="selectDataByUser" resultType="com.yuanchu.mom.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 != ''">
+            and name_user in
+            <foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
+                #{val}
+            </foreach>
+        </if>
+    </select>
+    <select id="selectListByIds" resultType="com.yuanchu.mom.pojo.AuxiliaryWorkingHoursDay">
+        select * from auxiliary_working_hours_day
+        where state='宸插鏍�'
+        <if test="ids !=null and ids != ''">
+            and name_user 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,
+        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,
+        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 != ''">
+             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
+        order by A.name,A.month
+    </select>
+
+    <select id="selectLists" resultMap="BaseResultMap">
+        select * from(select * from auxiliary_working_hours_day
+        WHERE 1=1
+        <if test="ids !=null and ids != ''">
+            and name_user 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>

--
Gitblit v1.9.3