|
@@ -155,50 +155,19 @@
|
|
|
group by b.id, a.create_date
|
|
|
</select>
|
|
|
<!--修改前 人员工时工价表详情数据-->
|
|
|
- <select id="getPersonWorkHoursWagesDetail" resultType="java.util.Map">
|
|
|
- select r.cost,r.working_time,r.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 report r
|
|
|
- left join prod_procedure_team ppt2 on r.user_procedure_team_id=ppt2.id
|
|
|
- left join prod_procedure pp on r.prod_procedure_id=pp.id
|
|
|
- left join plan_procedure_total ppt on ppt.id=ppt2.plan_procedure_id
|
|
|
- left join product p on p.id=r.product_id
|
|
|
- left join plan on plan.id=r.plan_id
|
|
|
- left join user u on r.checker_id=u.id
|
|
|
- left join user u2 on r.creator_id=u2.id
|
|
|
- where r.company_id=#{companyId} and r.finish_num > 0
|
|
|
- <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 r.creator_id=#{userId}
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- </if>
|
|
|
- <if test="startDate!=null and endDate!=null">
|
|
|
- and r.create_date between #{startDate} and #{endDate}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
-
|
|
|
<!-- <select id="getPersonWorkHoursWagesDetail" 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,-->
|
|
|
+<!-- select r.cost,r.working_time,r.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-->
|
|
|
-<!-- 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}-->
|
|
|
+<!-- from report r-->
|
|
|
+<!-- left join prod_procedure_team ppt2 on r.user_procedure_team_id=ppt2.id-->
|
|
|
+<!-- left join prod_procedure pp on r.prod_procedure_id=pp.id-->
|
|
|
+<!-- left join plan_procedure_total ppt on ppt.id=ppt2.plan_procedure_id-->
|
|
|
+<!-- left join product p on p.id=r.product_id-->
|
|
|
+<!-- left join plan on plan.id=r.plan_id-->
|
|
|
+<!-- left join user u on r.checker_id=u.id-->
|
|
|
+<!-- left join user u2 on r.creator_id=u2.id-->
|
|
|
+<!-- where r.company_id=#{companyId} and r.finish_num > 0-->
|
|
|
<!-- <if test="date!=null and date!=''">-->
|
|
|
<!-- and r.create_date=#{date}-->
|
|
|
<!-- </if>-->
|
|
@@ -208,15 +177,46 @@
|
|
|
<!-- and plan.foreman_id=#{userId}-->
|
|
|
<!-- </when>-->
|
|
|
<!-- <otherwise>-->
|
|
|
-<!-- and ppt2.user_id=#{userId}-->
|
|
|
+<!-- and r.creator_id=#{userId}-->
|
|
|
<!-- </otherwise>-->
|
|
|
<!-- </choose>-->
|
|
|
<!-- </if>-->
|
|
|
<!-- <if test="startDate!=null and endDate!=null">-->
|
|
|
-<!-- and ppt2.distribute_date between #{startDate} and #{endDate}-->
|
|
|
+<!-- and r.create_date between #{startDate} and #{endDate}-->
|
|
|
<!-- </if>-->
|
|
|
<!-- </select>-->
|
|
|
|
|
|
+ <select id="getPersonWorkHoursWagesDetail" 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
|
|
|
+ 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 ppt2.distribute_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
|