设备看板:维修工单、设备信息、维修质量

highway
wws 1 year ago
parent 25f6ff4211
commit d875905204

@ -0,0 +1,647 @@
package com.op.device.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;
/**
* mes_report_work
*
* @author Open Platform
* @date 2023-08-24
*/
public class MesReportWork extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 记录id */
private String id;
/** 报工单编号 */
@Excel(name = "报工单编号")
private String reportCode;
/** 报工类型报工类型SELF自行报工、UNI统一报工 */
@Excel(name = "报工类型报工类型SELF上位机报工、UNI系统报工")
private String reportType;
/** 生产工单编码 */
@Excel(name = "生产工单编码")
private String workorderCode;
/** 产品编码 */
@Excel(name = "产品编码")
private String productCode;
/** 产品名称 */
@Excel(name = "产品名称")
private String productName;
/** 规格型号 */
@Excel(name = "规格型号")
private String spec;
/** 单位 */
@Excel(name = "单位")
private String unit;
/** 排产数量 */
@Excel(name = "排产数量")
private BigDecimal quantity;
private BigDecimal quantitySplit;
/** 本次报工数量 */
@Excel(name = "本次报工数量")
private BigDecimal quantityFeedback;
/** 合格数量 */
//@Excel(name = "合格数量")
private BigDecimal quantityQualified;
/** 不合格数量 */
//@Excel(name = "不合格数量")
private BigDecimal quantityUnqualified;
/** 报工人员 */
@Excel(name = "报工人员")
private String userName;
/** 人员名称 */
@Excel(name = "人员名称")
private String nickName;
/** 报工途径PAD、MOBILE、PC */
//@Excel(name = "报工途径PAD、MOBILE、PC")
private String feedbackChannel;
/** 报工时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "报工时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date feedbackTime;
/** 录入人员 */
@Excel(name = "录入人员")
private String recordUser;
/** 状态 */
@Excel(name = "状态")
private String status;
/** 工时 */
@Excel(name = "工时")
private Long workTime;
@Excel(name = "用人")
private Long useMan;
/** 线体编码 */
@Excel(name = "线体编码")
private String machineCode;
/** 线体名称 */
@Excel(name = "线体名称")
private String machineName;
/** 班组编码 */
@Excel(name = "班组编码")
private String teamCode;
/** 班次编码 */
@Excel(name = "班次编码")
private String shiftCode;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "SAP报工时间")
private Date uploadTime;
@Excel(name = "SAP报工状态0待报工1成功2失败")
private String uploadStatus;
@Excel(name = "SAP报工信息")
private String uploadMsg;
/** 预留字段1 */
//@Excel(name = "预留字段1")
private String attr1;
/** 预留字段2 */
//@Excel(name = "预留字段2")
private String attr2;
/** 预留字段3 */
//@Excel(name = "预留字段3")
private String attr3;
/** 预留字段4 */
//@Excel(name = "预留字段4")
private String attr4;
@Excel(name = "计划生产日期")
private String productDate;
private String productDateStart;
private String productDateEnd;
@Excel(name = "订单编号")
private String orderCode;
@Excel(name = "规格型号")
private String productSpc;
@Excel(name = "工序名称")
private String processName;
@Excel(name = "工序编码")
private String processCode;
private String factoryCode;
private String factoryName;
private String carCode;
private String carName;
private String workorderCodeSap;
private String routeCode;
private String sac1;
private String sac2;
private String sac3;
private String sac4;
private String sac5;
private String sac6;
private String prodType;
private String createTimeStart;
private String createTimeEnd;
private String feedbackTimeStart;
private String feedbackTimeEnd;
private String batch;
private String endReport;
public String getEndReport() {
return endReport;
}
public void setEndReport(String endReport) {
this.endReport = endReport;
}
public String getBatch() {
return batch;
}
public void setBatch(String batch) {
this.batch = batch;
}
public Long getUseMan() {
return useMan;
}
public void setUseMan(Long useMan) {
this.useMan = useMan;
}
public BigDecimal getQuantitySplit() {
return quantitySplit;
}
public void setQuantitySplit(BigDecimal quantitySplit) {
this.quantitySplit = quantitySplit;
}
public String getFeedbackTimeStart() {
return feedbackTimeStart;
}
public void setFeedbackTimeStart(String feedbackTimeStart) {
this.feedbackTimeStart = feedbackTimeStart;
}
public String getFeedbackTimeEnd() {
return feedbackTimeEnd;
}
public void setFeedbackTimeEnd(String feedbackTimeEnd) {
this.feedbackTimeEnd = feedbackTimeEnd;
}
public String getCreateTimeStart() {
return createTimeStart;
}
public void setCreateTimeStart(String createTimeStart) {
this.createTimeStart = createTimeStart;
}
public String getCreateTimeEnd() {
return createTimeEnd;
}
public void setCreateTimeEnd(String createTimeEnd) {
this.createTimeEnd = createTimeEnd;
}
public String getProdType() {
return prodType;
}
public void setProdType(String prodType) {
this.prodType = prodType;
}
public String getWorkorderCodeSap() {
return workorderCodeSap;
}
public void setWorkorderCodeSap(String workorderCodeSap) {
this.workorderCodeSap = workorderCodeSap;
}
public String getRouteCode() {
return routeCode;
}
public void setRouteCode(String routeCode) {
this.routeCode = routeCode;
}
public String getSac1() {
return sac1;
}
public void setSac1(String sac1) {
this.sac1 = sac1;
}
public String getSac2() {
return sac2;
}
public void setSac2(String sac2) {
this.sac2 = sac2;
}
public String getSac3() {
return sac3;
}
public void setSac3(String sac3) {
this.sac3 = sac3;
}
public String getSac4() {
return sac4;
}
public void setSac4(String sac4) {
this.sac4 = sac4;
}
public String getSac5() {
return sac5;
}
public void setSac5(String sac5) {
this.sac5 = sac5;
}
public String getSac6() {
return sac6;
}
public void setSac6(String sac6) {
this.sac6 = sac6;
}
public Date getUploadTime() {
return uploadTime;
}
public void setUploadTime(Date uploadTime) {
this.uploadTime = uploadTime;
}
public String getUploadStatus() {
return uploadStatus;
}
public void setUploadStatus(String uploadStatus) {
this.uploadStatus = uploadStatus;
}
public String getUploadMsg() {
return uploadMsg;
}
public void setUploadMsg(String uploadMsg) {
this.uploadMsg = uploadMsg;
}
public String getFactoryCode() {
return factoryCode;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryName() {
return factoryName;
}
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
}
public String getCarCode() {
return carCode;
}
public void setCarCode(String carCode) {
this.carCode = carCode;
}
public String getCarName() {
return carName;
}
public void setCarName(String carName) {
this.carName = carName;
}
public String getProcessCode() {
return processCode;
}
public void setProcessCode(String processCode) {
this.processCode = processCode;
}
public String getProductDateStart() {
return productDateStart;
}
public void setProductDateStart(String productDateStart) {
this.productDateStart = productDateStart;
}
public String getProductDateEnd() {
return productDateEnd;
}
public void setProductDateEnd(String productDateEnd) {
this.productDateEnd = productDateEnd;
}
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setReportType(String reportType) {
this.reportType = reportType;
}
public String getReportType() {
return reportType;
}
public void setReportCode(String reportCode) {
this.reportCode = reportCode;
}
public String getReportCode() {
return reportCode;
}
public void setWorkorderCode(String workorderCode) {
this.workorderCode = workorderCode;
}
public String getWorkorderCode() {
return workorderCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductCode() {
return productCode;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductName() {
return productName;
}
public void setSpec(String spec) {
this.spec = spec;
}
public String getSpec() {
return spec;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getUnit() {
return unit;
}
public void setQuantity(BigDecimal quantity) {
this.quantity = quantity;
}
public BigDecimal getQuantity() {
return quantity;
}
public void setQuantityFeedback(BigDecimal quantityFeedback) {
this.quantityFeedback = quantityFeedback;
}
public BigDecimal getQuantityFeedback() {
return quantityFeedback;
}
public void setQuantityQualified(BigDecimal quantityQualified) {
this.quantityQualified = quantityQualified;
}
public BigDecimal getQuantityQualified() {
return quantityQualified;
}
public void setQuantityUnqualified(BigDecimal quantityUnqualified) {
this.quantityUnqualified = quantityUnqualified;
}
public BigDecimal getQuantityUnqualified() {
return quantityUnqualified;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserName() {
return userName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getNickName() {
return nickName;
}
public void setFeedbackChannel(String feedbackChannel) {
this.feedbackChannel = feedbackChannel;
}
public String getFeedbackChannel() {
return feedbackChannel;
}
public void setFeedbackTime(Date feedbackTime) {
this.feedbackTime = feedbackTime;
}
public Date getFeedbackTime() {
return feedbackTime;
}
public void setRecordUser(String recordUser) {
this.recordUser = recordUser;
}
public String getRecordUser() {
return recordUser;
}
public void setStatus(String status) {
this.status = status;
}
public String getStatus() {
return status;
}
public void setWorkTime(Long workTime) {
this.workTime = workTime;
}
public Long getWorkTime() {
return workTime;
}
public void setMachineCode(String machineCode) {
this.machineCode = machineCode;
}
public String getMachineCode() {
return machineCode;
}
public void setMachineName(String machineName) {
this.machineName = machineName;
}
public String getMachineName() {
return machineName;
}
public void setTeamCode(String teamCode) {
this.teamCode = teamCode;
}
public String getTeamCode() {
return teamCode;
}
public void setShiftCode(String shiftCode) {
this.shiftCode = shiftCode;
}
public String getShiftCode() {
return shiftCode;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr3() {
return attr3;
}
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
public String getAttr4() {
return attr4;
}
public String getProductDate() {
return productDate;
}
public void setProductDate(String productDate) {
this.productDate = productDate;
}
public String getOrderCode() {
return orderCode;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getProductSpc() {
return productSpc;
}
public void setProductSpc(String productSpc) {
this.productSpc = productSpc;
}
public String getProcessName() {
return processName;
}
public void setProcessName(String processName) {
this.processName = processName;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("reportType", getReportType())
.append("reportCode", getReportCode())
.append("workorderCode", getWorkorderCode())
.append("productCode", getProductCode())
.append("productName", getProductName())
.append("spec", getSpec())
.append("unit", getUnit())
.append("quantity", getQuantity())
.append("quantityFeedback", getQuantityFeedback())
.append("quantityQualified", getQuantityQualified())
.append("quantityUnqualified", getQuantityUnqualified())
.append("userName", getUserName())
.append("nickName", getNickName())
.append("feedbackChannel", getFeedbackChannel())
.append("feedbackTime", getFeedbackTime())
.append("recordUser", getRecordUser())
.append("status", getStatus())
.append("remark", getRemark())
.append("workTime", getWorkTime())
.append("machineCode", getMachineCode())
.append("machineName", getMachineName())
.append("teamCode", getTeamCode())
.append("shiftCode", getShiftCode())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("attr4", getAttr4())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.toString();
}
}

@ -1,6 +1,8 @@
package com.op.device.mapper;
import com.op.device.domain.EquOperationRecord;
import com.op.device.domain.EquRepairWorkOrder;
import com.op.device.domain.MesReportWork;
import com.op.device.domain.vo.IEquipmentVO;
import com.op.device.domain.vo.IRepairWorkOrderVO;
@ -25,4 +27,14 @@ public interface DeviceInterfaceMapper {
* @return
*/
List<IEquipmentVO> selectRepairEquipmentList();
/**
* code
* quantity quantityFeedback
* @param equipmentCode
* @return
*/
MesReportWork selectReportWorkByEquipmentCode(String equipmentCode);
List<EquRepairWorkOrder> selectRepairRecordByEquipmentCode(String equipmentCode);
}

@ -58,4 +58,11 @@ public interface EquOperationRecordMapper {
* @return
*/
public int deleteEquOperationRecordByIds(String[] ids);
/**
*
* @param equipmentCode
* @return
*/
List<EquOperationRecord> selectEquOperationRecordByEquipmentCode(String equipmentCode);
}

@ -2,16 +2,24 @@ package com.op.device.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.EquOperationRecord;
import com.op.device.domain.EquRepairWorkOrder;
import com.op.device.domain.MesReportWork;
import com.op.device.domain.vo.IEquipmentVO;
import com.op.device.domain.vo.IRepairWorkOrderVO;
import com.op.device.mapper.DeviceInterfaceMapper;
import com.op.device.mapper.EquOperationRecordMapper;
import com.op.device.mapper.EquRepairWorkOrderMapper;
import com.op.device.service.IDeviceInterfaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;
import static com.op.common.core.web.domain.AjaxResult.success;
@ -25,6 +33,8 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService {
private EquRepairWorkOrderMapper equRepairWorkOrderMapper;
@Autowired
private DeviceInterfaceMapper deviceInterfaceMapper;
@Autowired
private EquOperationRecordMapper equOperationRecordMapper;
/**
*
@ -48,7 +58,7 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService {
/**
*
* :/
* /
* /
*
* @return
*/
@ -64,11 +74,55 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService {
} else {
equipmentVO.setEquipmentStatus("停用");
}
// TODO 设备故障停机率
equipmentVO.setFailureRate(0.10);
// TODO 设备有效利用率
equipmentVO.setUtilizationRatio(0.80);
/* 停机故障率逻辑 */
long totalTime = 0L;// 运行总时间
long downTime = 0L;// 停机时间
// 通过设备编码获取运行记录中的运行记录List
List<EquOperationRecord> operationRecordList = equOperationRecordMapper.selectEquOperationRecordByEquipmentCode(equipmentVO.getEquipmentCode());
if (operationRecordList.size() != 0) {
for (EquOperationRecord operationRecord : operationRecordList) {
// 运行时间差值
long diffTime = operationRecord.getEndTime().getTime() - operationRecord.getStartTime().getTime();
// 开机运行时间运行总时间累加
if (operationRecord.getType().equals("on")) {
totalTime+=diffTime;
}
// 维修停机时间累加(故障)
if (operationRecord.getMaintenanceType().equals("repair")) {
downTime+=diffTime;
}
}
// 设置停机故障率
if (downTime == 0L) {
// 如果未查到该设备停机故障时间
equipmentVO.setFailureRate(0D);
}else {
// 计算故障停机率(设备停机时间总和/一定时间内运行总时间(年))
double failureRate = downTime / totalTime;
equipmentVO.setFailureRate(failureRate);
}
}
/* 设备有效利用率逻辑(每月) */
// 查询该设备下报工单信息(年月日可在该sql中修改)
MesReportWork reportWork = deviceInterfaceMapper.selectReportWorkByEquipmentCode(equipmentVO.getEquipmentCode());
if (reportWork != null) {
BigDecimal theoryQuantity = reportWork.getQuantity();// 理论产量
BigDecimal actualQuantity = reportWork.getQuantityFeedback();// 实际产量
// 计算该设备有效利用率(实际产量/理论产量)
BigDecimal utilizationRatio = actualQuantity.divide(theoryQuantity, 2, BigDecimal.ROUND_HALF_UP);
equipmentVO.setUtilizationRatio(utilizationRatio.doubleValue());
}else {
// 如果未查到该信息则默认设置为0
equipmentVO.setUtilizationRatio(0D);
}
}
return success(equipmentVOList);
}
@ -81,12 +135,48 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService {
@Override
@DS("#header.poolName")
public AjaxResult getRepairQuantity() {
List<IEquipmentVO> equipmentVOList = deviceInterfaceMapper.selectRepairEquipmentList();
// 获取维修工单中的设备列表
List<IEquipmentVO> equipmentVOList = deviceInterfaceMapper.selectEquipmentList();
for (IEquipmentVO equipmentVO : equipmentVOList) {
// TODO 设备维修质量
// TODO 排序TOP10
equipmentVO.setRapairQuantity(0.70);
// 通过该设备code获取设备维修记录(只获取开始时间、结束时间)
List<EquRepairWorkOrder> workOrderList = deviceInterfaceMapper.selectRepairRecordByEquipmentCode(equipmentVO.getEquipmentCode());
if (workOrderList.size() != 0) {
Long runTime = 0l;
for (EquRepairWorkOrder workOrder : workOrderList) {
// 维修时间差值
long diffTime = workOrder.getWorkEndTime().getTime() - workOrder.getWorkStartTime().getTime();
// 累加时间
runTime += diffTime;
}
// 计算维修质量(故障时间(小时)/故障次数)
long rapairQuantity = runTime / 3600000 / workOrderList.size();
equipmentVO.setRapairQuantity(Double.valueOf(rapairQuantity));
}else {
// 没有该记录则默认为0
equipmentVO.setRapairQuantity(0D);
}
}
return success(equipmentVOList);
// 排序TOP10
// 假数据
// Random random = new Random();
// List<IEquipmentVO> test = new ArrayList<>();
// for (int i = 0 ; i < 30 ; i++) {
// IEquipmentVO vo = new IEquipmentVO();
// vo.setRapairQuantity(random.nextDouble());
// test.add(vo);
// }
// 按照raparQuantity字段进行排序并使用subList获取前10个结果
List<IEquipmentVO> top10 = equipmentVOList.stream()
.sorted(Comparator.comparingDouble(IEquipmentVO::getRapairQuantity)) // 排序
.limit(10) // 限制结果数量为10
.collect(Collectors.toList()); // 将结果收集到List中
return success(top10);
}
}

@ -21,23 +21,41 @@
</select>
<select id="selectEquipmentList" resultType="com.op.device.domain.vo.IEquipmentVO">
select be.equipment_code AS "equipmentCode",
be.equipment_name AS "equipmentName",
be.department AS "department",
be.equipment_status AS "equipmentStatus"
select be.equipment_code AS 'equipmentCode', be.equipment_name AS 'equipmentName'
from base_equipment be
where del_flag = '0'
where be.equipment_code in (select wo.equipment_code
from equ_repair_work_order wo
where wo.del_flag = '0'
and wo.work_status = '1'
GROUP BY wo.equipment_code)
</select>
<select id="selectRepairEquipmentList" resultType="com.op.device.domain.vo.IEquipmentVO">
select be.equipment_code AS "equipmentCode",
be.equipment_name AS "equipmentName"
select be.equipment_code AS 'equipmentCode', be.equipment_name AS 'equipmentName'
from base_equipment be
where be.del_flag = '0'
and be.equipment_code in (select wo.equipment_code
where be.equipment_code in (select wo.equipment_code
from equ_repair_work_order wo
where wo.del_flag = '0'
and wo.work_status = '1'
GROUP BY wo.equipment_code)
</select>
<select id="selectReportWorkByEquipmentCode" resultType="com.op.device.domain.MesReportWork">
select SUM(mrw.quantity) AS "quantity",
SUM(mrw.quantity_feedback) AS "quantityFeedback"
from mes_report_work mrw
where mrw.del_flag = '0'
and mrw.status = 'PREPARE'
and mrw.machine_code = #{equipmentCode}
and mrw.feedback_time >= DATEADD(MONTH, -1, GETDATE())
</select>
<select id="selectRepairRecordByEquipmentCode" resultType="com.op.device.domain.EquRepairWorkOrder">
select wo.work_start_time AS "workStartTime", wo.work_end_time AS "workEndTime"
from equ_repair_work_order wo
where wo.del_flag = '0'
and wo.equipment_code = #{equipmentCode}
and wo.work_status = '1'
</select>
</mapper>

@ -5,41 +5,57 @@
<mapper namespace="com.op.device.mapper.EquOperationRecordMapper">
<resultMap type="EquOperationRecord" id="EquOperationRecordResult">
<result property="id" column="id" />
<result property="equipmentCode" column="equipment_code" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="type" column="type" />
<result property="maintenanceType" column="maintenance_type" />
<result property="parentId" column="parent_id" />
<result property="factoryCode" column="factory_code" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="id" column="id"/>
<result property="equipmentCode" column="equipment_code"/>
<result property="startTime" column="start_time"/>
<result property="endTime" column="end_time"/>
<result property="type" column="type"/>
<result property="maintenanceType" column="maintenance_type"/>
<result property="parentId" column="parent_id"/>
<result property="factoryCode" column="factory_code"/>
<result property="attr1" column="attr1"/>
<result property="attr2" column="attr2"/>
<result property="attr3" column="attr3"/>
<result property="delFlag" column="del_flag"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectEquOperationRecordVo">
select id, equipment_code, start_time, end_time, type, maintenance_type, parent_id, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time from equ_operation_record
select id,
equipment_code,
start_time,
end_time,
type,
maintenance_type,
parent_id,
factory_code,
attr1,
attr2,
attr3,
del_flag,
create_by,
create_time,
update_by,
update_time
from equ_operation_record
</sql>
<select id="selectEquOperationRecordList" parameterType="EquOperationRecord" resultMap="EquOperationRecordResult">
<include refid="selectEquOperationRecordVo"/>
<where>
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code = #{equipmentCode}</if>
<if test="startTime != null "> and start_time = #{startTime}</if>
<if test="endTime != null "> and end_time = #{endTime}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="maintenanceType != null and maintenanceType != ''"> and maintenance_type = #{maintenanceType}</if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
<if test="equipmentCode != null and equipmentCode != ''">and equipment_code = #{equipmentCode}</if>
<if test="startTime != null ">and start_time = #{startTime}</if>
<if test="endTime != null ">and end_time = #{endTime}</if>
<if test="type != null and type != ''">and type = #{type}</if>
<if test="maintenanceType != null and maintenanceType != ''">and maintenance_type = #{maintenanceType}</if>
<if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if>
<if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if>
<if test="attr1 != null and attr1 != ''">and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''">and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''">and attr3 = #{attr3}</if>
</where>
</select>
@ -48,6 +64,17 @@
where id = #{id}
</select>
<select id="selectEquOperationRecordByEquipmentCode" resultType="com.op.device.domain.EquOperationRecord">
select eor.start_time AS "startTime",
eor.end_time AS "endTime",
eor.maintenance_type AS "maintenanceType",
eor.type AS "type"
from equ_operation_record eor
where eor.del_flag = '0'
and eor.end_time is not null
and eor.equipment_code = #{equipmentCode}
</select>
<insert id="insertEquOperationRecord" parameterType="EquOperationRecord">
insert into equ_operation_record
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -111,7 +138,9 @@
</update>
<delete id="deleteEquOperationRecordById" parameterType="String">
delete from equ_operation_record where id = #{id}
delete
from equ_operation_record
where id = #{id}
</delete>
<delete id="deleteEquOperationRecordByIds" parameterType="String">

Loading…
Cancel
Save