|
@@ -312,14 +312,12 @@
|
|
|
|
|
|
<select id="getPlanRealTimeProgressList" resultType="java.util.Map">
|
|
|
select b.id as planId,(Case when b.plan_type=0 then b.product_scheduling_num else b.task_change_notice_num end) as taskName,
|
|
|
- b.foreman_name as userName,IFNULL(ROUND(SUM(d.work_time),2),0) as planWorkTime,SUM(d.job_of_money) as planCost,
|
|
|
- IFNULL(SUM((select SUM(working_time) from report where user_procedure_team_id = d.id)),0) as nowWorkTime,
|
|
|
- SUM((select SUM(cost) from report where user_procedure_team_id = d.id)) as nowCost
|
|
|
- from plan_procedure_total a
|
|
|
- left join plan b on a.plan_id=b.id
|
|
|
- left join prod_procedure c on a.prod_procedure_id=c.id
|
|
|
- left join prod_procedure_team d on a.id=d.plan_procedure_id
|
|
|
- left join user u on u.id=d.user_id
|
|
|
+ b.foreman_name as userName,IFNULL(ROUND(SUM(a.total_working_hours),2),0) as planWorkTime,IFNULL(ROUND(SUM(a.total_wages),2),0) as planCost,
|
|
|
+ IFNULL(ROUND(SUM(a.`total_fill_time`),2),0) AS nowWorkTime,
|
|
|
+ IFNULL(ROUND(SUM(a.`total_wages`*a.`total_progress`/100),2),0) AS nowCost
|
|
|
+ from plan b
|
|
|
+ left join plan_procedure_total a on a.plan_id=b.id
|
|
|
+ left join user u on u.id=b.station_id
|
|
|
where b.company_id=#{companyId}
|
|
|
<if test="userId!=null and userId!=''">
|
|
|
and d.user_id=#{userId}
|
|
@@ -348,15 +346,13 @@
|
|
|
|
|
|
<select id="getPlanRealTimeProgressCount" resultType="java.lang.Integer">
|
|
|
select count(1) from (
|
|
|
- select (Case when b.plan_type=0 then b.product_scheduling_num else b.task_change_notice_num end) as taskName,
|
|
|
- b.foreman_name as userName,SUM(d.work_time) as planWorkTime,SUM(d.job_of_money) as planCost,
|
|
|
- SUM((select SUM(working_time) from report where user_procedure_team_id = d.id)) as nowWorkTime,
|
|
|
- SUM((select SUM(cost) from report where user_procedure_team_id = d.id)) as nowCost
|
|
|
- from plan_procedure_total a
|
|
|
- left join plan b on a.plan_id=b.id
|
|
|
- left join prod_procedure c on a.prod_procedure_id=c.id
|
|
|
- left join prod_procedure_team d on a.id=d.plan_procedure_id
|
|
|
- left join user u on u.id=d.user_id
|
|
|
+ select b.id as planId,(Case when b.plan_type=0 then b.product_scheduling_num else b.task_change_notice_num end) as taskName,
|
|
|
+ b.foreman_name as userName,IFNULL(ROUND(SUM(a.total_working_hours),2),0) as planWorkTime,IFNULL(ROUND(SUM(a.total_wages),2),0) as planCost,
|
|
|
+ IFNULL(ROUND(SUM(a.`total_fill_time`),2),0) AS nowWorkTime,
|
|
|
+ IFNULL(ROUND(SUM(a.`total_wages`*a.`total_progress`/100),2),0) AS nowCost
|
|
|
+ from plan b
|
|
|
+ left join plan_procedure_total a on a.plan_id=b.id
|
|
|
+ left join user u on u.id=b.station_id
|
|
|
where b.company_id=#{companyId}
|
|
|
<if test="userId!=null and userId!=''">
|
|
|
and d.user_id=#{userId}
|