kangwei: 修改bug

1 个父辈 be66f3ab
......@@ -53,9 +53,9 @@
<select id="yhCensus" resultType="java.util.Map">
SELECT
sd.depart_name,
ifnull( SUM( CASE WHEN LEFT ( sr.rec_ord_whenlong, 7 ) = #{nowMonth} THEN 1 ELSE 0 END ),0) as now,
ifnull( SUM( CASE WHEN LEFT ( sr.rec_ord_whenlong, 4 ) =#{nowYear} THEN 1 ELSE 0 END),0) as nowYear,
ifnull( SUM( CASE WHEN LEFT ( sr.rec_ord_whenlong, 4 ) =#{lastYear} THEN 1 ELSE 0 END ),0) as last_year
ifnull( SUM( CASE WHEN LEFT ( sr.rec_ord_report_date, 7 ) = #{nowMonth} THEN 1 ELSE 0 END ),0) as now,
ifnull( SUM( CASE WHEN LEFT ( sr.rec_ord_report_date, 4 ) =#{nowYear} THEN 1 ELSE 0 END),0) as nowYear,
ifnull( SUM( CASE WHEN LEFT ( sr.rec_ord_report_date, 4 ) =#{lastYear} THEN 1 ELSE 0 END ),0) as last_year
FROM
sys_factory_info sf
LEFT JOIN sys_depart sd ON sf.depart_id = sd.id
......
......@@ -267,7 +267,7 @@ public class EmergencyRiskEventServiceImpl extends ServiceImpl<EmergencyRiskEven
// 风险排查
sql += " left join ( select depart_id ,count(id) 'count' from danger_inspection_record where report_date >= '"+startDate+" 00:00:00' and report_date <='"+endDate+" 23:59:59' group by depart_id ) bb on bb.depart_id = d.id ";
//实际完成数量
sql += " left join ( select depart_id ,count(id) 'count' from danger_inspection_record where status = '2' and end_date >= '"+startDate+" 00:00:00' and end_date <='"+endDate+" 23:59:59' group by depart_id ) eee on eee.depart_id = d.id ";
sql += " left join ( select depart_id ,count(id) 'count' from danger_inspection_record where status = '2' and end_date >= '"+startDate+" 00:00:00' and end_date <='"+endDate+" 23:59:59' group by depart_id ) ee on ee.depart_id = d.id ";
// 异常
sql += " left join ( select t.depart_id , count(1) 'count' from problem_report_plan t where t.report_time >='"+startDate+"' and t.report_time <='"+endDate+"' group by t.depart_id) cc on cc.depart_id = d.id";
......
......@@ -16,7 +16,7 @@ public class DangerEventOverviewVO {
@ApiModelProperty(value = "厂站名称")
private String departName;
/**隐患处理数*/
@ApiModelProperty(value = "隐患处理")
@ApiModelProperty(value = "隐患处理")
private Integer yhNoHandleNum ;
/**隐患已处理数*/
@ApiModelProperty(value = "隐患已处理数")
......
......@@ -179,7 +179,7 @@ public class EquipmentInfoMonthReportController {
private List<Map<String,Object>> equipmentARunList(String departIds,String startDate,String endDate){
String sql =" select d.id 'depart_id', d.depart_name , aaa.equipment_name, aaa.fault_library_id from sys_depart d";
sql += " left join (select er.id 'info_id', er.depart_id , ei.equipment_name , GROUP_CONCAT(er.fault_content) fault_content , GROUP_CONCAT( er.fault_library_id) fault_library_id from equipment_repair er , equipment_info ei ";
sql += " where er.info_id = ei.id and repair_date >= '"+startDate+" 00:00:00' and repair_date <='"+endDate+" 23:59:59' ";
sql += " where er.info_id = ei.id and and ei.equipment_level = '6bf727eb7e7cca6a95c694dab0036b2c' and repair_date >= '"+startDate+" 00:00:00' and repair_date <='"+endDate+" 23:59:59' ";
sql += " group by er.depart_id ,er.info_id )aaa on aaa.depart_id = d.id ";
sql += " where d.depart_type = 1 ";
if(StringUtils.isNotEmpty(departIds)){
......
......@@ -48,6 +48,15 @@ public interface ProductionEquipmentMapper {
//获取保养费用
Double getMaintainCost(@Param("startTime") String startTime, @Param("endTime") String endTime);
/***
* 根据维修类型获取维修费用(单位万元)
* @param startTime
* @param endTime
* @return
*/
Double getMaintainCostByMaintenanceType(@Param("maintenanceType") String maintenanceType,@Param("startTime") String startTime, @Param("endTime") String endTime);
//获取生产设备等级
List<ProportionStatisticsVO> getLevelByTime(ReportStatisticsDTO reportStatisticsDTO);
......
......@@ -103,6 +103,21 @@
and #{endTime}
</if>
</select>
<select id="getMaintainCostByMaintenanceType" parameterType="java.lang.String" resultType="java.lang.Double">
select round(ifnull(sum(maintenance_cost)/10000,0),2) maintenance_cost
from equipment_maintain_task emt , equipment_maintain_plan emp
WHERE emt.plan_id = emp.id and emt.del_flag = 0
<if test="maintenanceType !=null and maintenanceType !=''">
and emp.maintenance_type = #{maintenanceType}
</if>
<if test="startTime !=null and startTime !=''">
AND emt.maintain_time &gt;= #{startTime}
</if>
<if test="endTime !=null and endTime !=''">
AND emt.maintain_time &lt;= #{endTime}
</if>
</select>
<select id="getEquipmentStatisticsDetailsNew" resultType="com.skua.modules.equipment.vo.EquipmentStatisticsCountVO">
select d.depart_name , d.id 'depart_id',
......
......@@ -65,6 +65,7 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi
Double maintainCost = 0.00;
Double totalCost = 0.00;
Double costRing = 0.00;
Double dxjgCost = 0d;
//ab总数
Integer ABEquipmentNum = 0;
......@@ -216,6 +217,8 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi
repairCompleteRing = (repairCompleteRate - lastRepairCompleteRate) / lastRepairCompleteRate * 100;
}
//维护维修费用
//大修费用
dxjgCost = productionEquipmentMapper.getMaintainCostByMaintenanceType("dxjg",reportStatisticsDTO.getTime() + YEAR_START, reportStatisticsDTO.getTime() + YEAR_END);
//维修费
repairCost = productionEquipmentMapper.getRepairCost(reportStatisticsDTO.getTime() + YEAR_START, reportStatisticsDTO.getTime() + YEAR_END);
//保养费
......@@ -228,6 +231,7 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi
costRing = (totalCost - (repairCost1 + maintainCost1)) / (repairCost1 + maintainCost1) * 100;
}
}
productionEquipmentVO.setEquipmentNum(equipmentNum);
productionEquipmentVO.setAbEquipmentNum(ABEquipmentNum);
//本月新增
......@@ -253,6 +257,8 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi
//维修计划完成月环比
BigDecimal bigDecimal3 = new BigDecimal(repairCompleteRing).setScale(2, BigDecimal.ROUND_HALF_UP);
productionEquipmentVO.setRepairCompleteRingRate(bigDecimal3.toString() + "%");
//大修技改费用
productionEquipmentVO.setDxCost(dxjgCost+"");
//维护维修费用
productionEquipmentVO.setRepairMaintainCost(JSUtils.divide(totalCost,10000));
//维修费用
......
......@@ -45,4 +45,8 @@ public class ProductionEquipmentVO {
private String repairCost;
//维修费用
private String maintainCost;
//大修费用
private String dxCost;
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!