lxp
2025-03-15 52d79c7e5a1fb4316f34886ec336f69f56d5edb2
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>