zss
2024-05-31 94adc6f8c317f26da2f1f3b65224ac262670bdd8
performance-server/src/main/resources/mapper/AuxiliaryWorkingHoursDayMapper.xml
@@ -57,10 +57,35 @@
        select * from auxiliary_working_hours_day
        where 1=1
        <if test="ids !=null and ids != ''">
           and name_user in
            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,
        sum(A.manHour)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>
</mapper>