@@ -243,7 +248,7 @@ public class EquipmentInfoMonthReportController {
sql+=" left join (select t.depart_id , (sum(t.plan_cost)/10000) 'plan_cost' from equipment_maintain_plan t where t.release_status = '1' and t.start_time >= '"+startDate+" 00:00:00' and t.end_time <='"+endDate+" 23:59:59' group by t.depart_id )bbb on bbb.depart_id = d.id ";
sql+=" left join ( select depart_id, (ifnull(sum(total_cost),0)/10000) 'repair_cost' from equipment_repair where reality_maintenance_end_time >= '"+startDate+" 00:00:00' and reality_maintenance_end_time <='"+endDate+" 23:59:59' group by depart_id ) ccc on ccc.depart_id = d.id ";
sql+=" left join (select depart_id,count(1) 'repair_form_total_count' from equipment_repair where repair_date >= '"+startDate+" 00:00:00' and repair_date <='"+endDate+" 23:59:59' group by depart_id ) ddd on ddd.depart_id = d.id ";
sql+=" left join ( select depart_id,count(1) 'repair_form_complete_count' from equipment_repair where finish_flag in ('ywx','yys') and reality_maintenance_end_time >= '"+startDate+" 00:00:00' and reality_maintenance_end_time <='"+endDate+" 23:59:59' group by depart_id ) eee on eee.depart_id = d.id ";
sql+=" left join ( select depart_id,count(1) 'repair_form_complete_count' from equipment_repair where finish_flag in ('ywx','yys') and repair_date >= '"+startDate+" 00:00:00' and repair_date <='"+endDate+" 23:59:59' group by depart_id ) eee on eee.depart_id = d.id ";
sql+=" left join (select depart_id,count(1) 'complete_count' from inspection_task where task_state = '2' and task_start_time >= '"+startDate+" 00:00:00' and task_end_time <='"+endDate+" 23:59:59' group by depart_id ) fff on fff.depart_id = d.id ";
sql+=" left join (select depart_id,count(1) 'total_count' from inspection_task where task_start_time >= '"+startDate+" 00:00:00' and task_end_time <='"+endDate+" 23:59:59' group by depart_id ) ggg on ggg.depart_id = d.id ";
sql+=" where d.depart_type = 1 ";
...
...
@@ -251,8 +256,22 @@ public class EquipmentInfoMonthReportController {
sql+=" and d.id in ("+JSUtils.quoteEach(departIds,",")+") ";
}
sql+=" order by aaa.intact desc ";
sql+=" ) TTT where (TTT.intact+TTT.plan_cost+TTT.repair_cost+TTT.repair_form_complete_rate+TTT.repair_form_complete_count+TTT.inspection_complete_rate)>0";
returncommonSqlService.queryForList(sql);
sql+=" ) TTT where (TTT.intact+TTT.plan_cost+TTT.repair_cost+TTT.repair_form_complete_rate+TTT.repair_form_complete_count+TTT.inspection_complete_rate)>=0";