2024-3-29 设备模块-1.看板公式改变 2.手持维修时间 3.管理系统维修加字段

master
A0010407 1 year ago
parent 0eecd31a19
commit 0fbef62ebb

@ -42,8 +42,7 @@ public class DeviceInterfaceController {
}
/**
* TOP10
* /
*
*
* @return
*/
@ -53,9 +52,7 @@ public class DeviceInterfaceController {
}
/**
* -MTBF top10
* /
* //
* -MTBF
*
* @param equOperation
* @return
@ -67,7 +64,6 @@ public class DeviceInterfaceController {
/**
*
* /
*
* @param equOperation
* @return

@ -1,5 +1,6 @@
package com.op.device.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
@ -179,6 +180,16 @@ public class EquOperation extends BaseEntity {
//百分比
private String intactRate;
//设备看板时间范围——开始时间、结束时间
@JsonFormat(pattern = "yyyy-MM-dd")
private String startTime;
@JsonFormat(pattern = "yyyy-MM-dd")
private String endTime;
//设备看板维修质量 mttr
private String mttr;
public String getCreateTimeStart() {
return createTimeStart;
}
@ -462,6 +473,30 @@ public class EquOperation extends BaseEntity {
return timeDimension;
}
//开始时间、结束时间
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
//mttr
public void setMttr(String mttr) {
this.mttr = mttr;
}
public String getMttr() {
return mttr;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -14,323 +14,166 @@ import com.op.common.core.web.domain.BaseEntity;
/**
* equ_repair_work_order
*
* @author Open Platform
* @author
* @date 2023-10-19
*/
public class EquRepairWorkOrder extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private String workId;
@Excel(name = "维修主键")
private String workId;//主键
/**
*
*/
@Excel(name = "报修主键")
private String orderId;
private String orderId;//报修主键
/**
*
*/
@Excel(name = "维修单号")
private String workCode;
private String workCode;//维修单号
/**
*
*/
@Excel(name = "报修单号")
private String orderCode;
private String orderCode;//报修单号
/**
*
*/
@Excel(name = "是否立即处理")
private String workHandle;
private String workHandle;//是否立即处理
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "计划维修时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date workPlanTime;
private Date workPlanTime;//计划维修时间
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "计划停机时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date workPlanDownTime;
private Date workPlanDownTime;//计划停机时间
/**
*
*/
@Excel(name = "关联计划")
private String orderRelevance;
private String orderRelevance;//关联计划
/**
*
*/
@Excel(name = "维修人员")
private String workPerson;
private String workPerson;//维修人员
/**
*
*/
@Excel(name = "维修组")
private String workTeam;
private String workTeam;//维修组
/**
*
*/
@Excel(name = "是否委外")
private String workOutsource;
private String workOutsource;//是否委外
/**
*
*/
@Excel(name = "是否停机维修")
private String workDownMachine;
private String workDownMachine;//是否停机维修
/**
*
*/
@Excel(name = "设备编码")
private String equipmentCode;
private String equipmentCode;//设备编码
/**
*
*/
@Excel(name = "原因分析")
private String workReason;
private String workReason;//原因分析
/**
*
*/
@Excel(name = "故障描述")
private String workFaultDesc;
private String workFaultDesc;//故障描述
/**
*
*/
@Excel(name = "维修用时")
private String workCostTime;
private String workCostTime;//维修用时
/**
*
*/
@Excel(name = "维修费用")
private String workCost;
private String workCost;//维修费用
/**
* id
*/
@Excel(name = "委外工单id")
private String outWorkId;
private String outWorkId;//委外工单id
/**
*
*/
@Excel(name = "委外工单编码")
private String outWorkCode;
private String outWorkCode;//委外工单编码
/**
* 1
*/
@Excel(name = "备用字段1")
private String attr1;
private String attr1;//备用字段1
/**
* 2
*/
@Excel(name = "备用字段2")
private String attr2;
private String attr2;//备用字段2
/**
* 3
*/
@Excel(name = "备用字段3")
private String attr3;
private String attr3;//备用字段3
/**
*
*/
private String delFlag;
@Excel(name = "删除标志")
private String delFlag;//删除标志
/**
*
*/
@Excel(name = "工厂编码")
private String factoryCode;
private String factoryCode;//工厂编码
/**
*
*/
@Excel(name = "维修状态")
private String workStatus;
private String workStatus;//维修状态
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "维修开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date workStartTime;
private Date workStartTime;//维修开始时间
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "维修结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date workEndTime;
private Date workEndTime;//维修结束时间
//维修停机真正开始时间
private Date actualDownStartTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "维修实际开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date actualDownStartTime;//维修停机真正开始时间
//维修停机真正结束时间
private Date actualDownEndTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "维修实际结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date actualDownEndTime;//维修停机真正开始时间
/**
*
*/
private String workConnection;
@Excel(name = "联系方式")
private String workConnection;//联系方式
/**
*
*/
private String equipmentStatusDescription;
@Excel(name = "故障类型")
private String faultType;//故障类型
/**
*
*/
private String repairMeasures;
@Excel(name = "设备状态描述")
private String equipmentStatusDescription;//设备状态描述
// 设备
/**
*
*/
@Excel(name = "设备名称")
private String equipmentName;
/**
*
*/
@Excel(name = "规格型号")
private String equipmentSpec;
/**
*
*/
@Excel(name = "设备类型名称")
private String equipmentTypeName;
/**
*
*/
@Excel(name = "设备位置")
private String equipmentLocation;
/**
*
*/
@Excel(name = "部门")
private String department;
/**
*
*/
@Excel(name = "所属工作中心编码")
private String workshopCode;
/**
*
*/
@Excel(name = "所属工作中心名称")
private String workshopName;
@Excel(name = "维修措施")
private String repairMeasures;//设备维修措施
//报修
/**
*
*/
@Excel(name = "故障描述")
private String orderDesc;
@Excel(name = "故障停机时间")
private String faultDownTime;//故障停机时间
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "故障时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date orderBreakdownTime;
/**
*
*/
@Excel(name = "报修来源")
private String orderSource;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "报修时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date orderTime;
/**
*
*/
private String orderRepairmanCode;
/**
*
*/
private String orderConnection;
@Excel(name = "故障开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date faultStartTime;//故障开始时间
//班组
/**
*
*/
private String teamName;
/////////////////////////////////////////////////////////设备表字段
@Excel(name = "设备名称")
private String equipmentName;//设备名称
private String equipmentSpec;//规格型号
private String equipmentTypeName;//设备类型名称
private String equipmentLocation;//设备位置
private String department;//部门
private String workshopCode;//所属工作中心编码
private String workshopName;//所属工作中心名称
/////////////////////////////////////////////////////////////报修表
private String orderDesc;//故障描述
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date orderBreakdownTime;//故障时间
private String orderSource;//报修来源
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date orderTime;//报修时间
private String orderRepairmanCode;//报修人
private String orderConnection;//报修人联系方式
/**
*
*/
private String teamPerson;
//////////////////////////////////////////////////////////////班组表
@Excel(name = "班组名称")
private String teamName;//班组名称
@Excel(name = "班组人员")
private String teamPerson;//班组人员
//时间列表 虚拟字段
/////////////////////////////////////////////////////////////时间列表 虚拟字段
private List<Date> workPlanTimeArray;
private List<Date> workPlanDownTimeArray;
//计划开始时间、结束时间
private String workPlanTimeStart;
private String workPlanTimeStart;//计划开始时间、结束时间
private String workPlanTimeEnd;
//计划停机开始时间、结束时间
private String workPlanDownTimeStart;
private String workPlanDownTimeStart; //计划停机开始时间、结束时间
private String workPlanDownTimeEnd;
//委外虚拟字段
/**
*
*/
private String outSourcePerson;
/**
*
*/
private String outSourceReason;
/**
*
*/
private String workOutsourcingUnit;
/**
*
*/
private String outSourceConnection;
/**
*
*/
private String faultType;
///////////////////////////////////////////////////////////委外
private String outSourcePerson;//委外人员
private String outSourceReason;//委外维修原因
private String workOutsourcingUnit;//委外单位
private String outSourceConnection;//联系方式
//手持
//用户id
private String userId;
private String userId;//用户id
//检查项列表
private List<EquOrder> detailList;
@ -349,11 +192,14 @@ public class EquRepairWorkOrder extends BaseEntity {
//检查项列表
private List<EquOrderStandard> standardList;
//图片文件
private String fileList;
private List<BaseFileData> files;
//维修前 维修后
public String getAfterRepairFile() {
return afterRepairFile;
}
public void setAfterRepairFile(String afterRepairFile) {
this.afterRepairFile = afterRepairFile;
}
@ -361,7 +207,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public List<BaseFileData> getAfterRepairFiles() {
return afterRepairFiles;
}
public void setAfterRepairFiles(List<BaseFileData> afterRepairFiles) {
this.afterRepairFiles = afterRepairFiles;
}
@ -369,7 +214,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public String getBeforeRepairFile() {
return beforeRepairFile;
}
public void setBeforeRepairFile(String beforeRepairFile) {
this.beforeRepairFile = beforeRepairFile;
}
@ -377,16 +221,12 @@ public class EquRepairWorkOrder extends BaseEntity {
public List<BaseFileData> getBeforeRepairFiles() {
return beforeRepairFiles;
}
public void setBeforeRepairFiles(List<BaseFileData> beforeRepairFiles) {
this.beforeRepairFiles = beforeRepairFiles;
}
public void setBeforeRepairFiles(List<BaseFileData> beforeRepairFiles) { this.beforeRepairFiles = beforeRepairFiles; }
//detailList 检查项详情
public List<EquOrder> getDetailList() {
return detailList;
}
public void setDetailList(List<EquOrder> detailList) {
this.detailList = detailList;
}
@ -395,7 +235,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOrderDesc(String orderDesc) {
this.orderDesc = orderDesc;
}
public String getOrderDesc() {
return orderDesc;
}
@ -403,7 +242,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOrderBreakdownTime(Date orderBreakdownTime) {
this.orderBreakdownTime = orderBreakdownTime;
}
public Date getOrderBreakdownTime() {
return orderBreakdownTime;
}
@ -411,7 +249,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOrderSource(String orderSource) {
this.orderSource = orderSource;
}
public String getOrderSource() {
return orderSource;
}
@ -419,7 +256,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOrderTime(Date orderTime) {
this.orderTime = orderTime;
}
public Date getOrderTime() {
return orderTime;
}
@ -427,7 +263,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOrderRepairmanCode(String orderRepairmanCode) {
this.orderRepairmanCode = orderRepairmanCode;
}
public String getOrderRepairmanCode() {
return orderRepairmanCode;
}
@ -435,7 +270,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOrderConnection(String orderConnection) {
this.orderConnection = orderConnection;
}
public String getOrderConnection() {
return orderConnection;
}
@ -444,7 +278,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setEquipmentName(String equipmentName) {
this.equipmentName = equipmentName;
}
public String getEquipmentName() {
return equipmentName;
}
@ -452,7 +285,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setEquipmentSpec(String equipmentSpec) {
this.equipmentSpec = equipmentSpec;
}
public String getEquipmentSpec() {
return equipmentSpec;
}
@ -460,7 +292,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setEquipmentTypeName(String equipmentTypeName) {
this.equipmentTypeName = equipmentTypeName;
}
public String getEquipmentTypeName() {
return equipmentTypeName;
}
@ -468,7 +299,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setEquipmentLocation(String equipmentLocation) {
this.equipmentLocation = equipmentLocation;
}
public String getEquipmentLocation() {
return equipmentLocation;
}
@ -476,7 +306,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setDepartment(String department) {
this.department = department;
}
public String getDepartment() {
return department;
}
@ -484,7 +313,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkshopCode(String workshopCode) {
this.workshopCode = workshopCode;
}
public String getWorkshopCode() {
return workshopCode;
}
@ -492,24 +320,22 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkshopName(String workshopName) {
this.workshopName = workshopName;
}
public String getWorkshopName() {
return workshopName;
}
//维修工单
public void setWorkId(String workId) {
this.workId = workId;
}
public String getWorkId() {
return workId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getOrderId() {
return orderId;
}
@ -517,7 +343,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkCode(String workCode) {
this.workCode = workCode;
}
public String getWorkCode() {
return workCode;
}
@ -525,7 +350,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getOrderCode() {
return orderCode;
}
@ -533,7 +357,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkHandle(String workHandle) {
this.workHandle = workHandle;
}
public String getWorkHandle() {
return workHandle;
}
@ -541,7 +364,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkPlanTime(Date workPlanTime) {
this.workPlanTime = workPlanTime;
}
public Date getWorkPlanTime() {
return workPlanTime;
}
@ -549,7 +371,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkPlanDownTime(Date workPlanDownTime) {
this.workPlanDownTime = workPlanDownTime;
}
public Date getWorkPlanDownTime() {
return workPlanDownTime;
}
@ -557,7 +378,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOrderRelevance(String orderRelevance) {
this.orderRelevance = orderRelevance;
}
public String getOrderRelevance() {
return orderRelevance;
}
@ -565,7 +385,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkPerson(String workPerson) {
this.workPerson = workPerson;
}
public String getWorkPerson() {
return workPerson;
}
@ -573,7 +392,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkTeam(String workTeam) {
this.workTeam = workTeam;
}
public String getWorkTeam() {
return workTeam;
}
@ -581,7 +399,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkOutsource(String workOutsource) {
this.workOutsource = workOutsource;
}
public String getWorkOutsource() {
return workOutsource;
}
@ -589,7 +406,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkDownMachine(String workDownMachine) {
this.workDownMachine = workDownMachine;
}
public String getWorkDownMachine() {
return workDownMachine;
}
@ -597,7 +413,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setEquipmentCode(String equipmentCode) {
this.equipmentCode = equipmentCode;
}
public String getEquipmentCode() {
return equipmentCode;
}
@ -605,7 +420,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkReason(String workReason) {
this.workReason = workReason;
}
public String getWorkReason() {
return workReason;
}
@ -613,7 +427,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkFaultDesc(String workFaultDesc) {
this.workFaultDesc = workFaultDesc;
}
public String getWorkFaultDesc() {
return workFaultDesc;
}
@ -621,7 +434,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkCostTime(String workCostTime) {
this.workCostTime = workCostTime;
}
public String getWorkCostTime() {
return workCostTime;
}
@ -629,7 +441,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkCost(String workCost) {
this.workCost = workCost;
}
public String getWorkCost() {
return workCost;
}
@ -637,7 +448,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOutWorkId(String outWorkId) {
this.outWorkId = outWorkId;
}
public String getOutWorkId() {
return outWorkId;
}
@ -645,7 +455,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOutWorkCode(String outWorkCode) {
this.outWorkCode = outWorkCode;
}
public String getOutWorkCode() {
return outWorkCode;
}
@ -653,7 +462,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
@ -661,7 +469,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
@ -669,7 +476,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr3() {
return attr3;
}
@ -677,7 +483,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
@ -685,25 +490,20 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
//维修工单 新增字段 维修状态
public void setWorkStatus(String workStatus) {
this.workStatus = workStatus;
}
public String getWorkStatus() {
return workStatus;
}
//维修工单 新增字段 维修开始结束时间
public void setWorkStartTime(Date workStartTime) {
this.workStartTime = workStartTime;
}
public Date getWorkStartTime() {
return workStartTime;
}
@ -711,7 +511,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkEndTime(Date workEndTime) {
this.workEndTime = workEndTime;
}
public Date getWorkEndTime() {
return workEndTime;
}
@ -719,7 +518,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkConnection(String workConnection) {
this.workConnection = workConnection;
}
public String getWorkConnection() {
return workConnection;
}
@ -728,7 +526,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setTeamName(String teamName) {
this.teamName = teamName;
}
public String getTeamName() {
return teamName;
}
@ -736,7 +533,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setTeamPerson(String teamPerson) {
this.teamPerson = teamPerson;
}
public String getTeamPerson() {
return teamPerson;
}
@ -745,7 +541,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public List<Date> getWorkPlanTimeArray() {
return workPlanTimeArray;
}
public void setWorkPlanTimeArray(List<Date> workPlanTimeArray) {
this.workPlanTimeArray = workPlanTimeArray;
}
@ -753,33 +548,25 @@ public class EquRepairWorkOrder extends BaseEntity {
public List<Date> getWorkPlanDownTimeArray() {
return workPlanDownTimeArray;
}
public void setWorkPlanDownTimeArray(List<Date> workPlanDownTimeArray) {
this.workPlanDownTimeArray = workPlanDownTimeArray;
}
public void setWorkPlanDownTimeArray(List<Date> workPlanDownTimeArray) { this.workPlanDownTimeArray = workPlanDownTimeArray; }
//计划开始时间、结束时间
public String getWorkPlanDownTimeStart() {
return workPlanDownTimeStart;
}
public void setWorkPlanDownTimeStart(String workPlanDownTimeStart) {
this.workPlanDownTimeStart = workPlanDownTimeStart;
}
public void setWorkPlanDownTimeStart(String workPlanDownTimeStart) { this.workPlanDownTimeStart = workPlanDownTimeStart; }
public String getWorkPlanDownTimeEnd() {
return workPlanDownTimeEnd;
}
public void setWorkPlanDownTimeEnd(String workPlanDownTimeEnd) {
this.workPlanDownTimeEnd = workPlanDownTimeEnd;
}
//计划停机开始时间、结束时间
//实际停机开始时间、结束时间
public Date getActualDownStartTime() {
return actualDownStartTime;
}
public void setActualDownStartTime(Date actualDownStartTime) {
this.actualDownStartTime = actualDownStartTime;
}
@ -787,16 +574,36 @@ public class EquRepairWorkOrder extends BaseEntity {
public Date getActualDownEndTime() {
return actualDownEndTime;
}
public void setActualDownEndTime(Date actualDownEndTime) {
this.actualDownEndTime = actualDownEndTime;
}
//委外维修人员/委外维修原因 虚拟字段
//停机开始时间、结束时间
public String getWorkPlanTimeStart() { return workPlanTimeStart; }
public void setWorkPlanTimeStart(String workPlanTimeStart) { this.workPlanTimeStart = workPlanTimeStart; }
public String getWorkPlanTimeEnd() { return workPlanTimeEnd; }
public void setWorkPlanTimeEnd(String workPlanTimeEnd) { this.workPlanTimeEnd = workPlanTimeEnd; }
public String getFaultType() { return faultType; }
public void setFaultType(String faultType) { this.faultType = faultType; }
public String getEquipmentStatusDescription() { return equipmentStatusDescription; }
public void setEquipmentStatusDescription(String equipmentStatusDescription) { this.equipmentStatusDescription = equipmentStatusDescription; }
public String getRepairMeasures() { return repairMeasures; }
public void setRepairMeasures(String repairMeasures) { this.repairMeasures = repairMeasures; }
public String getFaultDownTime() { return faultDownTime; }
public void setFaultDownTime(String faultDownTime) { this.faultDownTime = faultDownTime; }
public Date getFaultStartTime() { return faultStartTime; }
public void setFaultStartTime(Date faultStartTime) { this.faultStartTime = faultStartTime; }
//委外
public void setOutSourceReason(String outSourceReason) {
this.outSourceReason = outSourceReason;
}
public String getOutSourceReason() {
return outSourceReason;
}
@ -804,7 +611,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOutSourcePerson(String outSourcePerson) {
this.outSourcePerson = outSourcePerson;
}
public String getOutSourcePerson() {
return outSourcePerson;
}
@ -812,7 +618,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setWorkOutsourcingUnit(String workOutsourcingUnit) {
this.workOutsourcingUnit = workOutsourcingUnit;
}
public String getWorkOutsourcingUnit() {
return workOutsourcingUnit;
}
@ -820,7 +625,6 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setOutSourceConnection(String outSourceConnection) {
this.outSourceConnection = outSourceConnection;
}
public String getOutSourceConnection() {
return outSourceConnection;
}
@ -829,92 +633,26 @@ public class EquRepairWorkOrder extends BaseEntity {
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserId() {
return userId;
}
//申领单
public List<EquSpareApply> getApplyList() {
return applyList;
}
public void setApplyList(List<EquSpareApply> applyList) {
this.applyList = applyList;
}
//实际停机开始时间、结束时间
public String getWorkPlanTimeStart() {
return workPlanTimeStart;
}
public void setWorkPlanTimeStart(String workPlanTimeStart) {
this.workPlanTimeStart = workPlanTimeStart;
}
public String getWorkPlanTimeEnd() {
return workPlanTimeEnd;
}
public void setWorkPlanTimeEnd(String workPlanTimeEnd) {
this.workPlanTimeEnd = workPlanTimeEnd;
}
//图片文件
private String fileList;
private List<BaseFileData> files;
public void setApplyList(List<EquSpareApply> applyList) { this.applyList = applyList; }
//图片文件
public String getFileList() {
return fileList;
}
public void setFileList(String fileList) {
this.fileList = fileList;
}
public List<BaseFileData> getFiles() {
return files;
}
public String getFileList() { return fileList; }
public void setFileList(String fileList) { this.fileList = fileList; }
public void setFiles(List<BaseFileData> files) {
this.files = files;
}
public List<BaseFileData> getFiles() { return files; }
public void setFiles(List<BaseFileData> files) { this.files = files; }
//标准列表
public List<EquOrderStandard> getStandardList() {
return standardList;
}
public void setStandardList(List<EquOrderStandard> standardList) {
this.standardList = standardList;
}
//故障类型
public String getFaultType() {
return faultType;
}
public void setFaultType(String faultType) {
this.faultType = faultType;
}
//设备状态描述
public String getEquipmentStatusDescription() {
return equipmentStatusDescription;
}
public void setEquipmentStatusDescription(String equipmentStatusDescription) {
this.equipmentStatusDescription = equipmentStatusDescription;
}
//维修措施
public String getRepairMeasures() {
return repairMeasures;
}
public void setRepairMeasures(String repairMeasures) {
this.repairMeasures = repairMeasures;
}
public List<EquOrderStandard> getStandardList() { return standardList; }
public void setStandardList(List<EquOrderStandard> standardList) { this.standardList = standardList; }
@Override
public String toString() {

@ -54,9 +54,11 @@ public interface DeviceInterfaceMapper {
//设备稳定性 MTBF设备平均故障间隔
List<EquOperation> getMTBFList(EquOperation equOperation);
//设备维修质量 MTTR
List<EquOperation> getMTTRList(EquOperation equOperation);
//设备完好率
EquOperation getEquipmentIntactRate(EquOperation equOperation);
List<EquOperation> getEquipmentIntactRate(EquOperation equOperation);
String getDeviceRefreshTime(EquOperationRecord equOperationRecord);
@ -77,4 +79,7 @@ public interface DeviceInterfaceMapper {
// 通过设备编码获取设备运行记录
Map<String, Double> selectSumEquipmentOperation(String equipmentCode);
//设备总数
String getTotalEquipment();
}

@ -28,7 +28,8 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService {
private DeviceInterfaceMapper deviceInterfaceMapper;
/**
*
*
*
*
* @return
*/
@ -51,80 +52,62 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService {
}
/**
*
* :/
* //*24
*
*
* :/
* /*24
* 11
*
* /
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult getEquipmentInfo(EquOperation equOperation) {
if (equOperation.getTimeDimension() == null) {
equOperation.setTimeDimension("yyyy");
if((equOperation.getStartTime() == null) && (equOperation.getEndTime() == null)){
//默认时间
if (equOperation.getTimeDimension() == null) {
equOperation.setTimeDimension("yyyy");
}
}
// 获取所有设备信息
List<IEquipmentVO> equipmentVOList = deviceInterfaceMapper.selectEquipmentVOList(equOperation);
return success(equipmentVOList);
}
/**
* TOP10
* /
*
*
* MTTR:/
*
*
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult getRepairQuantity(EquOperation equOperation) {
equOperation.setTimeDimension("yyyy");
// 获取维修工单中的设备列表
List<IEquipmentVO> equipmentVOList = deviceInterfaceMapper.selectEquipmentList(equOperation);
for (IEquipmentVO equipmentVO : equipmentVOList) {
// 通过该设备code获取设备维修记录(只获取开始时间、结束时间)
List<EquRepairWorkOrder> workOrderList = deviceInterfaceMapper.selectRepairRecordByEquipmentCode(equipmentVO.getEquipmentCode());
if (workOrderList.size() != 0) {
double runTime = 0;
for (EquRepairWorkOrder workOrder : workOrderList) {
// 维修时间差值
long diffTime = workOrder.getWorkEndTime().getTime() - workOrder.getWorkStartTime().getTime();
// 累加时间
runTime += diffTime;
}
// 计算维修质量(故障时间(小时)/故障次数)
Double rapairQuantity = runTime / 3600000 / workOrderList.size();
String douStr = String.format("%.2f", rapairQuantity);
equipmentVO.setRapairQuantity(douStr);
} else {
// 没有该记录则默认为0
equipmentVO.setRapairQuantity("0.00");
equOperation.setCreateTime(DateUtils.getNowDate());
if((equOperation.getStartTime() == null) && (equOperation.getEndTime() == null)){
if (equOperation.getTimeDimension() == null) {
equOperation.setTimeDimension("dd");
}
}
// 按照raparQuantity字段进行排序并使用subList获取前10个结果
List<IEquipmentVO> top10 = equipmentVOList.stream()
.sorted(Comparator.comparing(IEquipmentVO::getRapairQuantity).reversed())// 由正序改为 反转排序 倒序
.limit(10) // 限制结果数量为10 改为不限制结果数量
.collect(Collectors.toList()); //将结果收集到List中
return success(top10);
List<EquOperation> equipmentList = deviceInterfaceMapper.getMTTRList(equOperation);
return success(equipmentList);
}
/**
* -MTBF
* /
*
* MTBF/
*
*
*/
@Override
@DS("#header.poolName")
public AjaxResult getEquipmentStabilityList(EquOperation equOperation) {
//查询所有设备(设备停用的除外)
//判断查询年/月/日
equOperation.setCreateTime(DateUtils.getNowDate());
if (equOperation.getTimeDimension() == null) {
equOperation.setTimeDimension("dd");
if((equOperation.getStartTime() == null) && (equOperation.getEndTime() == null)){
if (equOperation.getTimeDimension() == null) {
equOperation.setTimeDimension("dd");
}
}
List<EquOperation> equipmentList = deviceInterfaceMapper.getMTBFList(equOperation);
return success(equipmentList);
@ -133,17 +116,32 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService {
/**
*
* -/
*
*/
@Override
@DS("#header.poolName")
public AjaxResult getEquipmentIntactRate(EquOperation equOperation) {
//查询所有设备(设备停用的除外)
EquOperation equipmentIntactRate = deviceInterfaceMapper.getEquipmentIntactRate(equOperation);
equOperation.setCreateTime(DateUtils.getNowDate());
if((equOperation.getStartTime() == null) && (equOperation.getEndTime() == null)){
if (equOperation.getTimeDimension() == null) {
equOperation.setTimeDimension("dd");
}
}
List<EquOperation> example = deviceInterfaceMapper.getEquipmentIntactRate(equOperation);
Integer fault = 0;
for(EquOperation equOperation1 :example){
fault = fault + Integer.valueOf(equOperation1.getFaultEquipment());
}
EquOperation equipmentIntactRate = new EquOperation();
equipmentIntactRate.setTotalEquipment(deviceInterfaceMapper.getTotalEquipment());
Double totalEquipment = new Double(equipmentIntactRate.getTotalEquipment());
Double operationEquipment = new Double(equipmentIntactRate.getOperationEquipment());
Double operationEquipment = new Double(Integer.valueOf(equipmentIntactRate.getTotalEquipment()) - fault);
Double intactRate = operationEquipment*100/totalEquipment;
String douStr = String.format("%.2f", intactRate);
equipmentIntactRate.setIntactRate(douStr);
equipmentIntactRate.setOperationEquipment(String.valueOf(operationEquipment));
equipmentIntactRate.setFaultEquipment(String.valueOf(fault));
return success(equipmentIntactRate);
}

@ -751,7 +751,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
@DS("#header.poolName")
public AjaxResult updateMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder) {
try {
//1.判断是否停机
////1.判断是否停机
EquRepairWorkOrder list = equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkId(equRepairWorkOrder.getWorkId());
if (list.getWorkDownMachine().equals("1")) {
//维修真正停机时间
@ -760,48 +760,58 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
//维修工单结束时间
equRepairWorkOrder.setWorkEndTime(DateUtils.getNowDate());
//2.计算维修工单用时
////2.计算维修工单用时 + 故障停机时间
if (list.getWorkStartTime() != null && equRepairWorkOrder.getWorkEndTime() != null) {
//2.1计算日期差值
////2.1计算维修日期差值
ZoneId zoneId = ZoneId.systemDefault();
LocalDateTime start = LocalDateTime.ofInstant(list.getWorkStartTime().toInstant(), zoneId);
LocalDateTime end = LocalDateTime.ofInstant(equRepairWorkOrder.getWorkEndTime().toInstant(), zoneId);
LocalDateTime tempDateTime = LocalDateTime.from(start);
// long years = tempDateTime.until(end, ChronoUnit.YEARS);
// tempDateTime = tempDateTime.plusYears(years);
// long months = tempDateTime.until(end, ChronoUnit.MONTHS);
// tempDateTime = tempDateTime.plusMonths(months);
// long days = tempDateTime.until(end, ChronoUnit.DAYS);
// tempDateTime = tempDateTime.plusDays(days);
double hours = tempDateTime.until(end, ChronoUnit.HOURS);
// tempDateTime = tempDateTime.plusHours(hours);
double minutes = ((tempDateTime.until(end, ChronoUnit.MINUTES) * 1.0) % 60) / 60;
// tempDateTime = tempDateTime.plusMinutes(minutes);
double seconds = ((tempDateTime.until(end, ChronoUnit.SECONDS) * 1.0) % 3600) / 3600;
double hour = BigDecimal.valueOf(hours + minutes + seconds).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
//2.2查询完好率报表
LocalDateTime workStart = LocalDateTime.ofInstant(list.getWorkStartTime().toInstant(), zoneId);
LocalDateTime workEnd = LocalDateTime.ofInstant(equRepairWorkOrder.getWorkEndTime().toInstant(), zoneId);
LocalDateTime workDateTime = LocalDateTime.from(workStart);
double workHours = workDateTime.until(workEnd, ChronoUnit.HOURS);
double workMinutes = ((workDateTime.until(workEnd, ChronoUnit.MINUTES) * 1.0) % 60) / 60;
double workSeconds = ((workDateTime.until(workEnd, ChronoUnit.SECONDS) * 1.0) % 3600) / 3600;
double workHour = BigDecimal.valueOf(workHours + workMinutes + workSeconds).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
//塞入维修用时
equRepairWorkOrder.setWorkCostTime(String.valueOf(workHour)+"小时");
////2.2 计算故障停机时间差值
//报修的故障时间 和 快速工单的故障开始时间
Date downStartTime = new Date();
if(list.getOrderBreakdownTime() != null){
downStartTime = list.getOrderBreakdownTime();
}else if(list.getFaultStartTime() != null){
downStartTime = list.getFaultStartTime();
}
LocalDateTime downStart = LocalDateTime.ofInstant(downStartTime.toInstant(), zoneId);
LocalDateTime downEnd = LocalDateTime.ofInstant(equRepairWorkOrder.getWorkEndTime().toInstant(), zoneId);
LocalDateTime downDateTime = LocalDateTime.from(downStart);
double downHours = downDateTime.until(downEnd, ChronoUnit.HOURS);
double downMinutes = ((downDateTime.until(downEnd, ChronoUnit.MINUTES) * 1.0) % 60) / 60;
double downSeconds = ((downDateTime.until(downEnd, ChronoUnit.SECONDS) * 1.0) % 3600) / 3600;
double downHour = BigDecimal.valueOf(downHours + downMinutes + downSeconds).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
equRepairWorkOrder.setFaultDownTime(String.valueOf(downHour)+"小时");
////2.2查询当日完好率报表
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String time = sdf.format(equRepairWorkOrder.getWorkEndTime());
EquOperation equOperation = equOperationMapper.selectEquipmentIntegrityRate(time, equRepairWorkOrder.getEquipmentCode());
//2.3修改完好率报表
////2.3修改完好率报表
if (equOperation != null) {
if (list.getWorkDownMachine().equals("1")) {
DecimalFormat df = new DecimalFormat("#.##");
//实际运行时间 = 实际运行时间 - 故障时间
double result = Double.parseDouble(equOperation.getActualOperationTime()) - hour;
//故障时间 = 原来的故障时间 + 这次的故障时间
double faultTime = Double.parseDouble(equOperation.getFaultTime()) + hour;
BigDecimal faultTimeBD = new BigDecimal(faultTime);// 故障时间
//实际运行时间 = 实际运行时间 - 故障停机时间
double result = Double.parseDouble(equOperation.getActualOperationTime()) - downHour;
//故障时间 = 原来的故障停机时间 + 这次的故障停机时间
double faultTime = Double.parseDouble(equOperation.getFaultTime()) + downHour;
BigDecimal faultTimeBD = new BigDecimal(faultTime);// 故障停机时间
BigDecimal operationTimeBD = new BigDecimal(equOperation.getOperationTime());//运行时间
equOperation.setActualOperationTime(String.valueOf(df.format(result)));//实际运行时间
equOperation.setFaultTime(String.valueOf(faultTime));//故障时间
equOperation.setFaultTime(String.valueOf(faultTime));//故障停机时间
equOperation.setFailureRate(faultTimeBD.multiply(new BigDecimal(100)).divide(operationTimeBD, 2, RoundingMode.HALF_UP).toString() + "%");
equOperation.setShutdownTimes(equOperation.getShutdownTimes() + 1);//停机次数加1
equOperation.setShutdownTimes(equOperation.getShutdownTimes() + 1);//故障停机次数加1
}
equOperation.setFailureTimes(equOperation.getFailureTimes() + 1);//故障次数加1
equOperation.setUpdateBy(SecurityUtils.getUsername());
@ -811,7 +821,6 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
}
////3.更新每一项点检/巡检检查项信息
//判空
if (StringUtils.isNotEmpty(equRepairWorkOrder.getDetailList())) {
List<EquOrder> checkLists = equRepairWorkOrder.getDetailList();
for (EquOrder checkList : checkLists) {
@ -852,7 +861,6 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
}
////4.新建申领单
//判空
if (StringUtils.isNotEmpty(equRepairWorkOrder.getApplyList())) {
List<EquSpareApply> equSpareApplies = equRepairWorkOrder.getApplyList();
for (EquSpareApply equSpareApply : equSpareApplies) {
@ -936,12 +944,11 @@ public class DevicePDAServiceImpl implements IDevicePDAService {
// BigDecimal orderCost = BigDecimal.valueOf(Double.valueOf(equRepairWorkOrder.getWorkCost()));
// equRepairWorkOrder.setWorkCost(String.valueOf(sparePartsCost.add(orderCost)));
//7.修改设备状态 由维修中改为正常运行
////7.修改设备状态 由维修中改为正常运行
EquEquipment equEquipment = new EquEquipment();
equEquipment.setEquipmentCode(example.getEquipmentCode());
equEquipment.setEquipmentStatus("1");
equRepairWorkOrderMapper.updateEquipmentStatus(equEquipment);
return success("提交成功,维修完成!");
} catch (Exception e) {
return error("提交失败!");

@ -169,12 +169,15 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
@Override
@DS("#header.poolName")
public int updateEquRepairWorkOrder(EquRepairWorkOrder equRepairWorkOrder) {
Date date = DateUtils.getNowDate();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String formattedDate = dateFormat.format(date);
//1.是否停机
if (equRepairWorkOrder.getWorkDownMachine().equals("0")) {
equRepairWorkOrder.setWorkPlanDownTime(null);
}
equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername());
equRepairWorkOrder.setUpdateTime(DateUtils.getNowDate());
equRepairWorkOrder.setUpdateTime(date);
//2.先删除每个维修工单对应图片,再新增照片
equRepairWorkOrderMapper.deleteBaseFileBySourceId(equRepairWorkOrder.getWorkId());
@ -236,7 +239,7 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
equRepairWorkOrderMapper.updateEquipmentStatus(equEquipment);
//5.2维修完成后 相应的设备完好率重新计算 小时计算 保留一位小数 实际故障时间 换算成小时
String hours = equRepairWorkOrder.getWorkCostTime().substring(0, equRepairWorkOrder.getWorkCostTime().length() - 2); //截掉后两位
String hours = equRepairWorkOrder.getFaultDownTime().substring(0, equRepairWorkOrder.getFaultDownTime().length() - 2); //截掉后两位
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String time = sdf.format(equRepairWorkOrder.getWorkEndTime());
EquOperation equOperation = equOperationMapper.selectEquipmentIntegrityRate(time, equRepairWorkOrder.getEquipmentCode());
@ -249,17 +252,40 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
//故障时间 = 原来的故障时间 + 这次的故障时间
double faultTime = Double.parseDouble(equOperation.getFaultTime()) + Double.parseDouble(hours);
BigDecimal faultTimeBD = new BigDecimal(faultTime);// 故障时间
BigDecimal operationTimeBD = new BigDecimal(equOperation.getOperationTime());// 运行时间
BigDecimal operationTimeBD = new BigDecimal(equOperation.getOperationTime());//运行时间
equOperation.setFaultTime(String.valueOf(faultTime));//故障时间
equOperation.setActualOperationTime(String.valueOf(df.format(result)));//实际运行时间
// 故障率计算(故障时间/运行时间)
//故障率计算(故障时间/运行时间)
equOperation.setFailureRate(faultTimeBD.multiply(new BigDecimal(100)).divide(operationTimeBD, 2, RoundingMode.HALF_UP).toString() + "%");
equOperation.setShutdownTimes(equOperation.getShutdownTimes() + 1);//停机次数加1
}
equOperation.setUpdateBy(SecurityUtils.getUsername());
equOperation.setUpdateTime(DateUtils.getNowDate());
//5.3更新
equOperation.setUpdateBy(SecurityUtils.getUsername());//更新人
equOperation.setUpdateTime(DateUtils.getNowDate());//更新时间
//故障次数增加,但是停机次数可能不增加
equOperation.setFailureTimes(equOperation.getFailureTimes() + 1);//故障次数加1
//取当天的
String GZMS = equOperation.getFailureDescription();
String GZYY = equOperation.getReasonAnalyze();
String GZCS = equOperation.getHandlingMethod();
if(GZMS != null){
equOperation.setFailureDescription(GZMS + formattedDate + ":"+ equRepairWorkOrder.getWorkFaultDesc() + ";");//故障描述
}else{
equOperation.setFailureDescription(formattedDate + ":"+ equRepairWorkOrder.getWorkFaultDesc() + ";");//故障描述
}
if(GZYY != null){
equOperation.setReasonAnalyze(GZYY + formattedDate + ":"+ equRepairWorkOrder.getWorkReason() + ";");//故障原因
}else{
equOperation.setReasonAnalyze(formattedDate + ":"+ equRepairWorkOrder.getWorkReason() + ";");//故障原因
}
if(GZCS != null){
equOperation.setHandlingMethod(GZCS + formattedDate + ":"+ equRepairWorkOrder.getRepairMeasures() + ";");//维修措施
}else{
equOperation.setHandlingMethod(formattedDate + ":"+ equRepairWorkOrder.getRepairMeasures() + ";");//维修措施
}
equOperationMapper.updateEquOperation(equOperation);
}
}

@ -56,6 +56,7 @@
<if test="timeDimension == 'dd' ">and convert(char(10),eo.create_time,120) = convert(char(10),getdate(),120)</if>
<if test="timeDimension == 'mm' ">and month(eo.create_time) = month(getdate())</if>
<if test="timeDimension == 'yyyy' ">and year(eo.create_time) = year(getdate())</if>
<if test="startTime != null and endTime != null ">and eo.create_time between #{startTime} and #{endTime} </if>
AND eo.del_flag = '0'
AND be.del_flag = '0'
AND be.equipment_category = '0'
@ -101,38 +102,74 @@
<!--设备稳定性 MTBF 年月日-->
<select id="getMTBFList" parameterType="EquOperation" resultType="com.op.device.domain.EquOperation">
select
row_number() over (order by sum(
row_number() over (order by cast(
case
when eo.shutdown_times > 0 THEN cast(cast(eo.actual_operation_time as decimal(18,2))/eo.shutdown_times as
decimal(18,2))
when sum(eo.shutdown_times) > 0 THEN sum(cast(eo.actual_operation_time as decimal(18,2)))/sum(eo.shutdown_times)
else 0
end
) desc) as serialNumber,
as decimal(18,2)) desc) as serialNumber,
eo.equipment_code as equipmentCode,
eo.equipment_name as equipmentName,
cast(sum(
cast(
case
when eo.shutdown_times > 0 THEN cast(eo.actual_operation_time as decimal(18,2))/eo.shutdown_times
when sum(eo.shutdown_times) > 0 THEN sum(cast(eo.actual_operation_time as decimal(18,2)))/sum(eo.shutdown_times)
else 0
end
)/COUNT(equipment_code) as decimal(18,2))as mtbf
as decimal(18,2))as mtbf
from equ_operation eo
<where>
<if test="timeDimension == 'dd' ">and convert(char(10),eo.create_time,120) = convert(char(10),getdate(),120)</if>
<if test="timeDimension == 'mm' ">and month(eo.create_time) = month(getdate())</if>
<if test="timeDimension == 'yyyy' ">and year(eo.create_time) = year(getdate())</if>
<if test="startTime != null and endTime != null ">and eo.create_time between #{startTime} and #{endTime} </if>
</where>
GROUP BY equipment_code,equipment_name
</select>
<!--设备维修质量 MTTR 年月日-->
<select id="getMTTRList" parameterType="EquOperation" resultType="com.op.device.domain.EquOperation">
select
row_number() over (order by cast(
case
when sum(eo.shutdown_times) > 0 THEN sum(cast(eo.fault_time as decimal(18,2)))/sum(eo.shutdown_times)
else 0
end
as decimal(18,2)) desc) as serialNumber,
eo.equipment_code as equipmentCode,
eo.equipment_name as equipmentName,
cast(
case
when sum(eo.shutdown_times) > 0 THEN sum(cast(eo.fault_time as decimal(18,2)))/sum(eo.shutdown_times)
else 0
end
as decimal(18,2))as mttr
from equ_operation eo
<where>
<if test="timeDimension == 'dd' ">and convert(char(10),eo.create_time,120) = convert(char(10),getdate(),120)</if>
<if test="timeDimension == 'mm' ">and month(eo.create_time) = month(getdate())</if>
<if test="timeDimension == 'yyyy' ">and year(eo.create_time) = year(getdate())</if>
<if test="startTime != null and endTime != null ">and eo.create_time between #{startTime} and #{endTime} </if>
</where>
group by equipment_code,equipment_name
</select>
<!--完好设备占比-->
<select id="getEquipmentIntactRate" parameterType="EquOperation" resultType="com.op.device.domain.EquOperation">
SELECT
SUM(CASE WHEN equipment_status = '1' or equipment_status = '3' THEN 1 Else 0 END) AS operationEquipment,
SUM(CASE WHEN equipment_status = '0' or equipment_status = '2' THEN 1 Else 0 END) AS faultEquipment,
COUNT(*) AS totalEquipment
FROM base_equipment
WHERE del_flag = '0' AND status = '1'
select
case when (sum(cast(eo.fault_time as decimal(18,2)))/sum(cast(eo.operation_time as decimal(18,2)))) > 0.04 then 1 else 0 end as faultEquipment
from equ_operation eo
<where>
<if test="timeDimension == 'dd' ">and convert(char(10),eo.create_time,120) = convert(char(10),getdate(),120)</if>
<if test="timeDimension == 'mm' ">and month(eo.create_time) = month(getdate())</if>
<if test="timeDimension == 'yyyy' ">and year(eo.create_time) = year(getdate())</if>
<if test="startTime != null and endTime != null ">and eo.create_time between #{startTime} and #{endTime} </if>
</where>
group by eo.equipment_code,eo.equipment_name
</select>
<!--设备总数-->
<select id="getTotalEquipment" resultType="java.lang.String">
select count(*) from base_equipment be where be.del_flag = '0' and be.status = '1'
</select>
<select id="selectGroups" resultType="com.op.device.domain.vo.IEquFaultVO">

@ -43,6 +43,8 @@
<result property="faultType" column="fault_type"/>
<result property="equipmentStatusDescription" column="equipment_status_description"/>
<result property="repairMeasures" column="repair_measures"/>
<result property="faultDownTime" column="fault_down_time"/>
<result property="faultStartTime" column="fault_start_time"/>
<!--设备-->
<result property="equipmentName" column="equipment_name"/>
@ -88,7 +90,7 @@
</sql>
<sql id="selectEquRepairWorkOrderVo">
select work_id, order_id, order_code, work_code,work_handle, work_plan_time, work_plan_down_time, order_relevance, work_person, work_team, work_outsource, work_down_machine, equipment_code, work_reason, work_fault_desc, work_start_time,work_end_time,work_cost_time, work_cost, work_status,out_work_id, out_work_code, attr1, attr2, attr3, create_by, create_time, update_time, update_by, del_flag, factory_code ,fault_type,equipment_status_description,repair_measures from equ_repair_work_order
select work_id, order_id, order_code, work_code,work_handle, work_plan_time, work_plan_down_time, order_relevance, work_person, work_team, work_outsource, work_down_machine, equipment_code, work_reason, work_fault_desc, work_start_time,work_end_time,work_cost_time, work_cost, work_status,out_work_id, out_work_code, attr1, attr2, attr3, create_by, create_time, update_time, update_by, del_flag, factory_code , fault_type , equipment_status_description , repair_measures , fault_down_time , fault_start_time from equ_repair_work_order
</sql>
<select id="selectEquRepairWorkOrderList" parameterType="EquRepairWorkOrder" resultMap="EquRepairWorkOrderResult">
@ -130,6 +132,8 @@
erwo.fault_type,
erwo.equipment_status_description,
erwo.repair_measures,
erwo.fault_down_time,
erwo.fault_start_time,
be.equipment_name,
et.team_name,
et.team_person
@ -185,7 +189,7 @@
ORDER BY erwo.create_time DESC
</select>
<!-- 除了待维修-->
<!--除了待维修-->
<select id="selectRepairWorkOrderList" parameterType="EquRepairWorkOrder" resultMap="EquRepairWorkOrderResult">
select
erwo.work_id,
@ -225,6 +229,8 @@
erwo.fault_type,
erwo.equipment_status_description,
erwo.repair_measures,
erwo.fault_down_time,
erwo.fault_start_time,
be.equipment_name,
et.team_name,
et.team_person
@ -275,6 +281,8 @@
erwo.fault_type,
erwo.equipment_status_description,
erwo.repair_measures,
erwo.fault_down_time,
erwo.fault_start_time,
be.equipment_name,
be.equipment_spec,
be.equipment_type_name,
@ -341,6 +349,8 @@
<if test="faultType != null">fault_type,</if>
<if test="equipmentStatusDescription != null">equipment_status_description,</if>
<if test="repairMeasures != null">repair_measures,</if>
<if test="faultDownTime != null">fault_down_time,</if>
<if test="faultStartTime != null">fault_start_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="workId != null">#{workId},</if>
@ -378,8 +388,10 @@
<if test="delFlag != null">#{delFlag},</if>
<if test="factoryCode != null">#{factoryCode},</if>
<if test="faultType != null">#{fault_type},</if>
<if test="equipmentStatusDescription != null">equipment_status_description,</if>
<if test="repairMeasures != null">repair_measures,</if>
<if test="equipmentStatusDescription != null">#{equipmentStatusDescription},</if>
<if test="repairMeasures != null">#{repairMeasures},</if>
<if test="faultDownTime != null">#{faultDownTime},</if>
<if test="faultStartTime != null">#{faultStartTime},</if>
</trim>
</insert>
@ -420,10 +432,10 @@
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="faultType != null">fault_type = #{faultType},</if>
<if test="equipmentStatusDescription != null">equipment_status_description =
#{equipmentStatusDescription},
</if>
<if test="equipmentStatusDescription != null">equipment_status_description = #{equipmentStatusDescription},</if>
<if test="repairMeasures != null">repair_measures = #{repairMeasures},</if>
<if test="faultDownTime != null">fault_down_time = #{faultDownTime},</if>
<if test="faultStartTime != null">fault_start_time = #{faultStartTime},</if>
</trim>
where work_id = #{workId}
and del_flag = '0'
@ -485,10 +497,10 @@
where source_id = #{sourceId}
</select>
<select id="selectEquRepairWorkOrderByWorkCode" parameterType="EquRepairWorkOrder"
resultMap="EquRepairWorkOrderResult">
<select id="selectEquRepairWorkOrderByWorkCode" parameterType="EquRepairWorkOrder" resultMap="EquRepairWorkOrderResult">
<include refid="selectEquRepairWorkOrderVo"/>
where work_code = #{workCode} and del_flag = '0'
where work_code = #{workCode}
and del_flag = '0'
</select>
<insert id="insertBaseFileBatch">

Loading…
Cancel
Save