|
@@ -244,16 +244,17 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getPersonWorkHoursWagesWithNotReport" resultType="java.util.Map">
|
|
|
- select ppt.total_progress AS progress,DATE_FORMAT(r.create_date,'%Y%m%d') AS createDate,pp.name AS procedureName,(CASE WHEN pp.check_type=0 THEN '自检' WHEN pp.check_type=1 THEN '互检' ELSE '专检' END) AS checkType,
|
|
|
+ select ppt.total_progress AS progress,pp.name AS procedureName,(CASE WHEN pp.check_type=0 THEN '自检' WHEN pp.check_type=1 THEN '互检' ELSE '专检' END) AS checkType,
|
|
|
p.name AS productName,DATE_FORMAT(plan.start_date,'%Y%m%d') AS planStartDate,DATE_FORMAT(plan.end_date,'%Y%m%d') AS planEndDate ,
|
|
|
plan.task_change_notice_num AS taskName,plan.plan_type AS planType,plan.product_scheduling_num
|
|
|
FROM prod_procedure_team ppt2
|
|
|
LEFT JOIN plan_procedure_total ppt ON ppt.id=ppt2.plan_procedure_id
|
|
|
LEFT JOIN plan ON plan.id=ppt.plan_id
|
|
|
- LEFT JOIN report r ON r.user_procedure_team_id=ppt2.id
|
|
|
+ LEFT JOIN (SELECT SUM(working_time) AS sumReport,user_procedure_team_id,create_date FROM report GROUP BY user_procedure_team_id,create_date) AS r ON r.user_procedure_team_id=ppt2.id AND r.create_date=ppt2.distribute_date
|
|
|
LEFT JOIN prod_procedure pp ON ppt.prod_procedure_id=pp.id
|
|
|
LEFT JOIN product p ON p.id=plan.product_id
|
|
|
- WHERE ppt2.company_id=#{companyId} and r.id is null
|
|
|
+ WHERE ppt2.company_id=#{companyId}
|
|
|
+ AND r.sumReport < ppt2.work_time
|
|
|
<if test="date!=null and date!=''">
|
|
|
and ppt2.distribute_date=#{date}
|
|
|
</if>
|
|
@@ -270,6 +271,7 @@
|
|
|
<if test="startDate!=null and endDate!=null">
|
|
|
and ppt2.distribute_date between #{startDate} and #{endDate}
|
|
|
</if>
|
|
|
+ GROUP BY ppt2.id
|
|
|
</select>
|
|
|
|
|
|
<select id="getPersonWorkHoursWagesWithHasReport" resultType="java.util.Map">
|