|
@@ -243,6 +243,66 @@
|
|
|
</if>
|
|
|
</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,
|
|
|
+ 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 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
|
|
|
+ <if test="date!=null and date!=''">
|
|
|
+ and ppt2.distribute_date=#{date}
|
|
|
+ </if>
|
|
|
+ <if test="userId!=null and userId!=''">
|
|
|
+ <choose>
|
|
|
+ <when test="checkStatus!=null and checkStatus==1 and detailStatus==null">
|
|
|
+ and plan.foreman_id=#{userId}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and ppt2.user_id=#{userId}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+ <if test="startDate!=null and endDate!=null">
|
|
|
+ and ppt2.distribute_date between #{startDate} and #{endDate}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getPersonWorkHoursWagesWithHasReport" resultType="java.util.Map">
|
|
|
+ select r.cost,r.working_time,r.finish_num AS finish_num, r.creator_id,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,
|
|
|
+ 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,u.name AS checkerName,u2.name AS creatorName,plan.product_scheduling_num,r.finish_num AS finishNum
|
|
|
+ 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 AND r.finish_num>0
|
|
|
+ LEFT JOIN prod_procedure pp ON ppt.prod_procedure_id=pp.id
|
|
|
+ LEFT JOIN product p ON p.id=plan.product_id
|
|
|
+ LEFT JOIN `user` u ON r.checker_id=u.id
|
|
|
+ LEFT JOIN `user` u2 ON r.creator_id=u2.id
|
|
|
+ WHERE ppt2.company_id=#{companyId}
|
|
|
+ <if test="date!=null and date!=''">
|
|
|
+ and r.create_date=#{date}
|
|
|
+ </if>
|
|
|
+ <if test="userId!=null and userId!=''">
|
|
|
+ <choose>
|
|
|
+ <when test="checkStatus!=null and checkStatus==1 and detailStatus==null">
|
|
|
+ and plan.foreman_id=#{userId}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ and ppt2.user_id=#{userId}
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
+ <if test="startDate!=null and endDate!=null">
|
|
|
+ and r.create_date between #{startDate} and #{endDate}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="getProcedureRealTimeProgressList" resultType="java.util.Map">
|
|
|
select a.id as pptId,b.id as planId,b.plan_type as planType,(Case when b.plan_type=0 then b.product_scheduling_num else b.task_change_notice_num end) as taskName,
|
|
|
c.name as procedureName,a.total_working_hours as planWorkTime,a.total_fill_time as nowWorkTime,a.total_progress as progress
|