|
@@ -189,7 +189,7 @@
|
|
from plan_procedure_total a
|
|
from plan_procedure_total a
|
|
left join plan b on a.plan_id=b.id
|
|
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 c on a.prod_procedure_id=c.id
|
|
- where b.company_id=#{companyId}
|
|
|
|
|
|
+ where b.company_id=#{companyId} and b.status!=2
|
|
<if test="userId!=null and userId!=''">
|
|
<if test="userId!=null and userId!=''">
|
|
and d.user_id=#{userId}
|
|
and d.user_id=#{userId}
|
|
</if>
|
|
</if>
|
|
@@ -200,7 +200,7 @@
|
|
and b.foreman_id=#{foremanId}
|
|
and b.foreman_id=#{foremanId}
|
|
</if>
|
|
</if>
|
|
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
|
|
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
|
|
- and (b.start_date >= #{startDate} and b.end_date <= #{endDate})
|
|
|
|
|
|
+ and b.start_date between #{startDate} and #{endDate}
|
|
</if>
|
|
</if>
|
|
order by b.create_time desc ,a.id
|
|
order by b.create_time desc ,a.id
|
|
<if test="pageStart!=null and pageSize!=null">
|
|
<if test="pageStart!=null and pageSize!=null">
|
|
@@ -215,7 +215,7 @@
|
|
from plan_procedure_total a
|
|
from plan_procedure_total a
|
|
left join plan b on a.plan_id=b.id
|
|
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 c on a.prod_procedure_id=c.id
|
|
- where b.company_id=#{companyId}
|
|
|
|
|
|
+ where b.company_id=#{companyId} and b.status!=2
|
|
<if test="userId!=null and userId!=''">
|
|
<if test="userId!=null and userId!=''">
|
|
and d.user_id=#{userId}
|
|
and d.user_id=#{userId}
|
|
</if>
|
|
</if>
|
|
@@ -226,7 +226,7 @@
|
|
and b.foreman_id=#{foremanId}
|
|
and b.foreman_id=#{foremanId}
|
|
</if>
|
|
</if>
|
|
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
|
|
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
|
|
- and (b.start_date >= #{startDate} and b.end_date <= #{endDate})
|
|
|
|
|
|
+ and b.start_date between #{startDate} and #{endDate}
|
|
</if>
|
|
</if>
|
|
) as total
|
|
) as total
|
|
</select>
|
|
</select>
|
|
@@ -373,31 +373,27 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="getDpetStatisticsProgressList" resultType="java.util.Map">
|
|
<select id="getDpetStatisticsProgressList" resultType="java.util.Map">
|
|
- select de.department_id as departmentId, de.department_name as departmentName,
|
|
|
|
- SUM(d.work_time) as planWorkTime,
|
|
|
|
- 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
|
|
|
|
- left join department de on b.station_id=de.department_id
|
|
|
|
- where b.company_id=#{companyId}
|
|
|
|
|
|
+ select d.department_id as departmentId,d.department_name as departmentName,IFNULL(SUM((select SUM(working_time) from report where plan_id = p.id)),0) as nowWorkTime,
|
|
|
|
+ IFNULL(SUM((select SUM(cost) from report where plan_id = p.id)),0) as nowCost,
|
|
|
|
+ IFNULL(SUM((select SUM(total_working_hours) from plan_procedure_total where plan_id = p.id)),0) as planWorkTime
|
|
|
|
+ from
|
|
|
|
+ department d
|
|
|
|
+ left join plan p on p.station_id=d.department_id
|
|
|
|
+ where p.company_id=#{companyId} and p.status!=2
|
|
<if test="userId!=null and userId!=''">
|
|
<if test="userId!=null and userId!=''">
|
|
and d.user_id=#{userId}
|
|
and d.user_id=#{userId}
|
|
</if>
|
|
</if>
|
|
<if test="deptId!=null and deptId!=''">
|
|
<if test="deptId!=null and deptId!=''">
|
|
- and b.station_id=#{deptId}
|
|
|
|
|
|
+ and p.station_id=#{deptId}
|
|
</if>
|
|
</if>
|
|
<if test="foremanId!=null and foremanId!=''">
|
|
<if test="foremanId!=null and foremanId!=''">
|
|
- and b.foreman_id=#{foremanId}
|
|
|
|
|
|
+ and p.foreman_id=#{foremanId}
|
|
</if>
|
|
</if>
|
|
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
|
|
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
|
|
- and (b.start_date >= #{startDate} and b.end_date <= #{endDate})
|
|
|
|
|
|
+ and p.start_date between #{startDate} and #{endDate}
|
|
</if>
|
|
</if>
|
|
- group by b.station_id
|
|
|
|
- order by b.create_time desc ,a.id
|
|
|
|
|
|
+ group by d.department_id
|
|
|
|
+ order by p.create_time desc
|
|
<if test="pageStart!=null and pageSize!=null">
|
|
<if test="pageStart!=null and pageSize!=null">
|
|
limit #{pageStart},#{pageSize}
|
|
limit #{pageStart},#{pageSize}
|
|
</if>
|
|
</if>
|
|
@@ -405,30 +401,26 @@
|
|
|
|
|
|
<select id="getDpetStatisticsProgressCount" resultType="java.lang.Integer">
|
|
<select id="getDpetStatisticsProgressCount" resultType="java.lang.Integer">
|
|
select count(1) from (
|
|
select count(1) from (
|
|
- select de.department_name as departmentName,
|
|
|
|
- SUM(d.work_time) as planWorkTime,
|
|
|
|
- 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
|
|
|
|
- left join department de on b.station_id=de.department_id
|
|
|
|
- where b.company_id=#{companyId}
|
|
|
|
|
|
+ select d.department_id as departmentId,d.department_name as departmentName,IFNULL(SUM((select SUM(working_time) from report where plan_id = p.id)),0) as nowWorkTime,
|
|
|
|
+ IFNULL(SUM((select SUM(cost) from report where plan_id = p.id)),0) as nowCost,
|
|
|
|
+ IFNULL(SUM((select SUM(total_working_hours) from plan_procedure_total where plan_id = p.id)),0) as planWorkTime
|
|
|
|
+ from
|
|
|
|
+ department d
|
|
|
|
+ left join plan p on p.station_id=d.department_id
|
|
|
|
+ where p.company_id=#{companyId} and p.status!=2
|
|
<if test="userId!=null and userId!=''">
|
|
<if test="userId!=null and userId!=''">
|
|
and d.user_id=#{userId}
|
|
and d.user_id=#{userId}
|
|
</if>
|
|
</if>
|
|
<if test="deptId!=null and deptId!=''">
|
|
<if test="deptId!=null and deptId!=''">
|
|
- and b.station_id=#{deptId}
|
|
|
|
|
|
+ and p.station_id=#{deptId}
|
|
</if>
|
|
</if>
|
|
<if test="foremanId!=null and foremanId!=''">
|
|
<if test="foremanId!=null and foremanId!=''">
|
|
- and b.foreman_id=#{foremanId}
|
|
|
|
|
|
+ and p.foreman_id=#{foremanId}
|
|
</if>
|
|
</if>
|
|
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
|
|
<if test="startDate!=null and startDate!='' and endDate!=null and endDate!=''">
|
|
- and (b.start_date >= #{startDate} and b.end_date <= #{endDate})
|
|
|
|
|
|
+ and p.start_date between #{startDate} and #{endDate}
|
|
</if>
|
|
</if>
|
|
- group by b.station_id
|
|
|
|
|
|
+ group by d.department_id
|
|
) as total
|
|
) as total
|
|
</select>
|
|
</select>
|
|
<select id="getReportList" resultType="java.util.Map">
|
|
<select id="getReportList" resultType="java.util.Map">
|