优化
This commit is contained in:
@ -45,22 +45,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
fpt.task_describe,
|
||||
fpt.task_address,
|
||||
fpt.create_time,
|
||||
#{dto.myTask} as myTask,
|
||||
COALESCE(apply.applyNum, 0) as applyNum,
|
||||
COALESCE(wage.taskReceiveAmount, 0) as taskReceiveAmount
|
||||
taskApply.applyNum as applyNum,
|
||||
wage.taskReceiveAmount as taskReceiveAmount,
|
||||
#{dto.myTask} as myTask
|
||||
FROM fbs_project_task fpt
|
||||
LEFT JOIN zbf_project zp ON fpt.project_id = zp.id
|
||||
LEFT JOIN
|
||||
(SELECT task_id, COUNT(*) as applyNum
|
||||
FROM fbs_project_task_apply
|
||||
GROUP BY task_id)
|
||||
apply ON fpt.id = apply.task_id
|
||||
GROUP BY task_id) taskApply ON fpt.id = taskApply.task_id
|
||||
LEFT JOIN
|
||||
(SELECT task_id, SUM(applicant_amount) as taskReceiveAmount
|
||||
FROM bgt_wage_application
|
||||
WHERE audit_status = '2'
|
||||
GROUP BY task_id)
|
||||
wage ON fpt.id = wage.task_id
|
||||
GROUP BY task_id) wage ON fpt.id = wage.task_id
|
||||
<where>
|
||||
<if test='!dto.myTask and dto.status != null and dto.status == "0"'>
|
||||
AND NOT EXISTS (
|
||||
|
@ -53,22 +53,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
wdc.auditor_type,
|
||||
wdc.dily_time,
|
||||
wu.avatar_name,
|
||||
wu.username
|
||||
wu.username,
|
||||
wu.status,
|
||||
wu.create_time
|
||||
from wgz_daily_clock wdc
|
||||
left join wgz_user wu on wdc.user_id = wu.user_id
|
||||
where wdc.auditor_user_id = #{dto.auditorUserId}
|
||||
and wdc.recruit_id in (select id from bgt_project_recruit where task_id = #{dto.taskId})
|
||||
<if test="dto.recruitId != null">
|
||||
and wdc.recruit_id = #{dto.recruitId}
|
||||
</if>
|
||||
<if test="dto.username != null and dto.username != ''">
|
||||
and wu.username like concat('%', #{dto.username}, '%')
|
||||
</if>
|
||||
<if test="dto.auditorType != null and dto.auditorType != ''">
|
||||
and wdc.auditor_type = #{dto.auditorType}
|
||||
</if>
|
||||
<if test="dto.recruit_id != null">
|
||||
<if test="dto.dilyTime != null">
|
||||
and DATE(wdc.dily_time) = #{dto.dilyTime}
|
||||
</if>
|
||||
order by wdc.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
@ -182,13 +182,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where w.auditor_user_id = #{dto.auditorUserId}
|
||||
|
||||
<if test="dto.taskId != null">
|
||||
and a.task_id = #{dto.taskId}
|
||||
and w.task_id = #{dto.taskId}
|
||||
</if>
|
||||
<if test="dto.username != null and dto.username != ''">
|
||||
and w.user_name like concat('%', #{dto.userName}, '%')
|
||||
</if>
|
||||
<if test="dto.auditorTypes != null and dto.auditorTypes.size() > 0">
|
||||
AND bpra.auditor_type IN
|
||||
AND w.auditor_type IN
|
||||
<foreach collection="dto.auditorTypes" item="auditorType" open="(" separator="," close=")">
|
||||
#{auditorType}
|
||||
</foreach>
|
||||
|
Reference in New Issue
Block a user