报修+维修+委外

highway
A0010407 1 year ago
parent c7e42f4045
commit 39b392d037

@ -2,6 +2,9 @@ package com.op.device.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.op.device.domain.EquOutsourceWork;
import com.op.device.service.IEquOutsourceWorkService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -33,6 +36,9 @@ public class EquRepairWorkOrderController extends BaseController {
@Autowired @Autowired
private IEquRepairWorkOrderService equRepairWorkOrderService; private IEquRepairWorkOrderService equRepairWorkOrderService;
@Autowired
private IEquOutsourceWorkService equOutsourceWorkService;
/** /**
* *
*/ */
@ -66,7 +72,7 @@ public class EquRepairWorkOrderController extends BaseController {
} }
/** /**
* *
*/ */
@RequiresPermissions("device:repairOrder:add") @RequiresPermissions("device:repairOrder:add")
@Log(title = "维修工单", businessType = BusinessType.INSERT) @Log(title = "维修工单", businessType = BusinessType.INSERT)
@ -94,4 +100,13 @@ public class EquRepairWorkOrderController extends BaseController {
public AjaxResult remove(@PathVariable String[] workIds) { public AjaxResult remove(@PathVariable String[] workIds) {
return toAjax(equRepairWorkOrderService.deleteEquRepairWorkOrderByWorkIds(workIds)); return toAjax(equRepairWorkOrderService.deleteEquRepairWorkOrderByWorkIds(workIds));
} }
/**
*
*/
@RequiresPermissions("device:repairOrder:apply")
@PostMapping("/apply")
public AjaxResult apply(@RequestBody EquOutsourceWork equOutsourceWork) {
return toAjax(equOutsourceWorkService.insertEquOutsourceWork(equOutsourceWork));
}
} }

@ -21,6 +21,10 @@ public class EquOutsourceWork extends BaseEntity {
@Excel(name = "委外工单编码") @Excel(name = "委外工单编码")
private String workCode; private String workCode;
/** 报修编码 */
@Excel(name = "报修编码")
private String orderCode;
/** 维修人员 */ /** 维修人员 */
@Excel(name = "维修人员") @Excel(name = "维修人员")
private String workPerson; private String workPerson;
@ -37,13 +41,17 @@ public class EquOutsourceWork extends BaseEntity {
@Excel(name = "原因") @Excel(name = "原因")
private String workReason; private String workReason;
/** 委外原因 */
@Excel(name = "委外原因")
private String outSourceReason;
/** 委外类型 */ /** 委外类型 */
@Excel(name = "委外类型") @Excel(name = "委外类型")
private String workType; private String workType;
/** 管理单号 */ /** 管理单号 */
@Excel(name = "管理单号") @Excel(name = "管理单号")
private String managementCode; private String equipmentCode;
/** 委外费用 */ /** 委外费用 */
@Excel(name = "委外费用") @Excel(name = "委外费用")
@ -79,6 +87,15 @@ public class EquOutsourceWork extends BaseEntity {
public String getWorkId() { public String getWorkId() {
return workId; return workId;
} }
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getOrderCode() {
return orderCode;
}
public void setWorkCode(String workCode) { public void setWorkCode(String workCode) {
this.workCode = workCode; this.workCode = workCode;
} }
@ -121,12 +138,12 @@ public class EquOutsourceWork extends BaseEntity {
public String getWorkType() { public String getWorkType() {
return workType; return workType;
} }
public void setManagementCode(String managementCode) { public void setEquipmentCode(String equipmentCode) {
this.managementCode = managementCode; this.equipmentCode = equipmentCode;
} }
public String getManagementCode() { public String getEquipmentCode() {
return managementCode; return equipmentCode;
} }
public void setWorkCost(String workCost) { public void setWorkCost(String workCost) {
this.workCost = workCost; this.workCost = workCost;
@ -178,17 +195,25 @@ public class EquOutsourceWork extends BaseEntity {
return factoryCode; return factoryCode;
} }
public void setOutSourceReason(String outSourceReason) {
this.outSourceReason = outSourceReason;
}
public String getOutSourceReason() {
return outSourceReason;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("workId", getWorkId()) .append("workId", getWorkId())
.append("orderCode", getWorkCode())
.append("workCode", getWorkCode()) .append("workCode", getWorkCode())
.append("workPerson", getWorkPerson()) .append("workPerson", getWorkPerson())
.append("workOutsourcingUnit", getWorkOutsourcingUnit()) .append("workOutsourcingUnit", getWorkOutsourcingUnit())
.append("workConnection", getWorkConnection()) .append("workConnection", getWorkConnection())
.append("workReason", getWorkReason()) .append("workReason", getWorkReason())
.append("workType", getWorkType()) .append("workType", getWorkType())
.append("managementCode", getManagementCode()) .append("equipmentCode", getEquipmentCode())
.append("workCost", getWorkCost()) .append("workCost", getWorkCost())
.append("workCostTime", getWorkCostTime()) .append("workCostTime", getWorkCostTime())
.append("attr1", getAttr1()) .append("attr1", getAttr1())

@ -122,6 +122,10 @@ public class EquRepairOrder extends BaseEntity {
@Excel(name = "计划停机时间", width = 30, dateFormat = "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 workDownMachine;
/** 维修人员 */ /** 维修人员 */
@Excel(name = "维修人员") @Excel(name = "维修人员")
private String workPerson; private String workPerson;
@ -398,6 +402,14 @@ public class EquRepairOrder extends BaseEntity {
return createBy; return createBy;
} }
public void setWorkDownMachine(String workDownMachine) {
this.workDownMachine = workDownMachine;
}
public String getWorkDownMachine() {
return workDownMachine;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -23,6 +23,10 @@ public class EquRepairWorkOrder extends BaseEntity {
@Excel(name = "报修主键") @Excel(name = "报修主键")
private String orderId; private String orderId;
/** 维修单号 */
@Excel(name = "维修单号")
private String workCode;
/** 报修单号 */ /** 报修单号 */
@Excel(name = "报修单号") @Excel(name = "报修单号")
private String orderCode; private String orderCode;
@ -32,13 +36,13 @@ public class EquRepairWorkOrder extends BaseEntity {
private String workHandle; private String workHandle;
/** 计划维修时间 */ /** 计划维修时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "计划维修时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "计划维修时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date workPlanTime; private Date workPlanTime;
/** 计划停机时间 */ /** 计划停机时间 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "计划停机时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "计划停机时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date workPlanDownTime; private Date workPlanDownTime;
/** 关联计划 */ /** 关联计划 */
@ -69,13 +73,17 @@ public class EquRepairWorkOrder extends BaseEntity {
@Excel(name = "原因分析") @Excel(name = "原因分析")
private String workReason; private String workReason;
/** 委外原因 */
@Excel(name = "委外原因")
private String outSourceReason;
/** 故障描述 */ /** 故障描述 */
@Excel(name = "故障描述") @Excel(name = "故障描述")
private String workFaultDesc; private String workFaultDesc;
/** 维修用时 */ /** 维修用时 */
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "维修用时", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "维修用时", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date workCostTime; private Date workCostTime;
/** 维修费用 */ /** 维修费用 */
@ -109,6 +117,63 @@ public class EquRepairWorkOrder extends BaseEntity {
@Excel(name = "工厂编码") @Excel(name = "工厂编码")
private String factoryCode; private String factoryCode;
// 设备
/** 设备名称 */
@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;
public void setEquipmentName(String equipmentName) {
this.equipmentName = equipmentName;
}
public String getEquipmentName() {
return equipmentName;
}
public void setEquipmentSpec(String equipmentSpec) {
this.equipmentSpec = equipmentSpec;
}
public String getEquipmentSpec() {
return equipmentSpec;
}
public void setEquipmentTypeName(String equipmentTypeName) {
this.equipmentTypeName = equipmentTypeName;
}
public String getEquipmentTypeName() {
return equipmentTypeName;
}
public void setEquipmentLocation(String equipmentLocation) {
this.equipmentLocation = equipmentLocation;
}
public String getEquipmentLocation() {
return equipmentLocation;
}
public void setDepartment(String department) {
this.department = department;
}
public String getDepartment() {
return department;
}
public void setWorkId(String workId) { public void setWorkId(String workId) {
this.workId = workId; this.workId = workId;
} }
@ -123,6 +188,15 @@ public class EquRepairWorkOrder extends BaseEntity {
public String getOrderId() { public String getOrderId() {
return orderId; return orderId;
} }
public void setWorkCode(String workCode) {
this.workCode = workCode;
}
public String getWorkCode() {
return workCode;
}
public void setOrderCode(String orderCode) { public void setOrderCode(String orderCode) {
this.orderCode = orderCode; this.orderCode = orderCode;
} }
@ -165,6 +239,14 @@ public class EquRepairWorkOrder extends BaseEntity {
public String getWorkPerson() { public String getWorkPerson() {
return workPerson; return workPerson;
} }
public void setOutSourceReason(String outSourceReason) {
this.outSourceReason = outSourceReason;
}
public String getOutSourceReason() {
return outSourceReason;
}
public void setWorkTeam(String workTeam) { public void setWorkTeam(String workTeam) {
this.workTeam = workTeam; this.workTeam = workTeam;
} }
@ -276,6 +358,7 @@ public class EquRepairWorkOrder extends BaseEntity {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("workId", getWorkId()) .append("workId", getWorkId())
.append("orderId", getOrderId()) .append("orderId", getOrderId())
.append("workCode", getWorkCode())
.append("orderCode", getOrderCode()) .append("orderCode", getOrderCode())
.append("workHandle", getWorkHandle()) .append("workHandle", getWorkHandle())
.append("workPlanTime", getWorkPlanTime()) .append("workPlanTime", getWorkPlanTime())

@ -1,5 +1,6 @@
package com.op.device.mapper; package com.op.device.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.device.domain.EquEquipment; import com.op.device.domain.EquEquipment;
import java.util.List; import java.util.List;
@ -61,4 +62,5 @@ public interface EquEquipmentMapper {
//查询设备类型 //查询设备类型
List<EquEquipment> getEquipmentTypeList(EquEquipment equEquipment); List<EquEquipment> getEquipmentTypeList(EquEquipment equEquipment);
} }

@ -3,6 +3,7 @@ package com.op.device.mapper;
import java.util.List; import java.util.List;
import com.op.device.domain.EquOutsourceWork; import com.op.device.domain.EquOutsourceWork;
import com.op.device.domain.EquRepairWorkOrder;
/** /**
* Mapper * Mapper
@ -58,4 +59,7 @@ public interface EquOutsourceWorkMapper {
* @return * @return
*/ */
public int deleteEquOutsourceWorkByWorkIds(String[] workIds); public int deleteEquOutsourceWorkByWorkIds(String[] workIds);
//流水号
public int selectWorkCodeSerialNumber();
} }

@ -65,7 +65,7 @@ public interface EquRepairOrderMapper {
* *
* @return * @return
*/ */
int selectSerialNumber(); int selectOrderCodeSerialNumber();
//查询报修人员列表 //查询报修人员列表
@DS("master") @DS("master")

@ -58,4 +58,10 @@ public interface EquRepairWorkOrderMapper {
* @return * @return
*/ */
public int deleteEquRepairWorkOrderByWorkIds(String[] workIds); public int deleteEquRepairWorkOrderByWorkIds(String[] workIds);
//获取流水号
public int selectWorkCodeSerialNumber();
//转委外
void updateWorkOutsource(EquRepairWorkOrder equRepairWorkOrder);
} }

@ -27,7 +27,7 @@ public interface IEquRepairWorkOrderService {
public List<EquRepairWorkOrder> selectEquRepairWorkOrderList(EquRepairWorkOrder equRepairWorkOrder); public List<EquRepairWorkOrder> selectEquRepairWorkOrderList(EquRepairWorkOrder equRepairWorkOrder);
/** /**
* *
* *
* @param equRepairWorkOrder * @param equRepairWorkOrder
* @return * @return

@ -4,6 +4,10 @@ import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.device.domain.EquRepairWorkOrder;
import com.op.device.mapper.EquRepairWorkOrderMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.op.device.mapper.EquOutsourceWorkMapper; import com.op.device.mapper.EquOutsourceWorkMapper;
@ -21,6 +25,9 @@ public class EquOutsourceWorkServiceImpl implements IEquOutsourceWorkService {
@Autowired @Autowired
private EquOutsourceWorkMapper equOutsourceWorkMapper; private EquOutsourceWorkMapper equOutsourceWorkMapper;
@Autowired
private EquRepairWorkOrderMapper equRepairWorkOrderMapper;
/** /**
* *
* *
@ -54,7 +61,22 @@ public class EquOutsourceWorkServiceImpl implements IEquOutsourceWorkService {
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public int insertEquOutsourceWork(EquOutsourceWork equOutsourceWork) { public int insertEquOutsourceWork(EquOutsourceWork equOutsourceWork) {
//转委外
String serialNum = String.format("%03d", equOutsourceWorkMapper.selectWorkCodeSerialNumber());
String equipmentCode = equOutsourceWork.getEquipmentCode();
equOutsourceWork.setWorkCode("WW"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
if(equOutsourceWork.getWorkId()!= null){
EquRepairWorkOrder equRepairWorkOrder = new EquRepairWorkOrder();
equRepairWorkOrder.setWorkId(equOutsourceWork.getWorkId());
equRepairWorkOrder.setWorkOutsource("1");
equRepairWorkOrder.setOutWorkCode(equOutsourceWork.getWorkCode());
equRepairWorkOrderMapper.updateWorkOutsource(equRepairWorkOrder);
equOutsourceWork.setWorkId("");
}
equOutsourceWork.setWorkId(IdUtils.fastSimpleUUID());
equOutsourceWork.setWorkReason(equOutsourceWork.getOutSourceReason());
equOutsourceWork.setCreateTime(DateUtils.getNowDate()); equOutsourceWork.setCreateTime(DateUtils.getNowDate());
equOutsourceWork.setCreateBy(SecurityUtils.getUsername());
return equOutsourceWorkMapper.insertEquOutsourceWork(equOutsourceWork); return equOutsourceWorkMapper.insertEquOutsourceWork(equOutsourceWork);
} }
@ -68,6 +90,7 @@ public class EquOutsourceWorkServiceImpl implements IEquOutsourceWorkService {
@DS("#header.poolName") @DS("#header.poolName")
public int updateEquOutsourceWork(EquOutsourceWork equOutsourceWork) { public int updateEquOutsourceWork(EquOutsourceWork equOutsourceWork) {
equOutsourceWork.setUpdateTime(DateUtils.getNowDate()); equOutsourceWork.setUpdateTime(DateUtils.getNowDate());
equOutsourceWork.setUpdateBy(SecurityUtils.getUsername());
return equOutsourceWorkMapper.updateEquOutsourceWork(equOutsourceWork); return equOutsourceWorkMapper.updateEquOutsourceWork(equOutsourceWork);
} }

@ -72,9 +72,10 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
public int insertEquRepairOrder(EquRepairOrder equRepairOrder) { public int insertEquRepairOrder(EquRepairOrder equRepairOrder) {
equRepairOrder.setOrderId(IdUtils.fastSimpleUUID()); equRepairOrder.setOrderId(IdUtils.fastSimpleUUID());
// 获取故障报修流水号 // 获取故障报修流水号
String serialNum = String.format("%03d", equRepairOrderMapper.selectSerialNumber()); String serialNum = String.format("%03d", equRepairOrderMapper.selectOrderCodeSerialNumber());
String equipmentCode = equRepairOrder.getEquipmentCode(); String equipmentCode = equRepairOrder.getEquipmentCode();
equRepairOrder.setOrderCode(DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum); //报修单号
equRepairOrder.setOrderCode("BX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
equRepairOrder.setCreateTime(DateUtils.getNowDate()); equRepairOrder.setCreateTime(DateUtils.getNowDate());
equRepairOrder.setCreateBy(SecurityUtils.getUsername()); equRepairOrder.setCreateBy(SecurityUtils.getUsername());
equRepairOrder.setOrderStatus("待审核"); equRepairOrder.setOrderStatus("待审核");
@ -82,7 +83,7 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
} }
/** /**
* *
* *
* @param equRepairOrder * @param equRepairOrder
* @return * @return
@ -94,14 +95,22 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
EquRepairWorkOrder equRepairWorkOrder = new EquRepairWorkOrder(); EquRepairWorkOrder equRepairWorkOrder = new EquRepairWorkOrder();
//报修单号 //报修单号
equRepairWorkOrder.setOrderCode(equRepairOrder.getOrderCode()); equRepairWorkOrder.setOrderCode(equRepairOrder.getOrderCode());
//维修单号
String serialNum = String.format("%03d", equRepairWorkOrderMapper.selectWorkCodeSerialNumber());
String equipmentCode = equRepairOrder.getEquipmentCode();
equRepairWorkOrder.setWorkCode("WX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
equRepairWorkOrder.setOrderId(equRepairOrder.getOrderId()); equRepairWorkOrder.setOrderId(equRepairOrder.getOrderId());
equRepairWorkOrder.setEquipmentCode(equRepairOrder.getEquipmentCode()); equRepairWorkOrder.setEquipmentCode(equRepairOrder.getEquipmentCode());
equRepairWorkOrder.setWorkTeam(equRepairOrder.getWorkTeam()); equRepairWorkOrder.setWorkTeam(equRepairOrder.getWorkTeam());
equRepairWorkOrder.setWorkPlanDownTime(equRepairOrder.getWorkPlanDownTime()); //不委外
//是否停机维修 equRepairWorkOrder.setWorkOutsource("0");
if(equRepairOrder.getWorkPlanTime() != null){ equRepairWorkOrder.setOutWorkCode("无");
//计划维修时间
equRepairWorkOrder.setWorkPlanTime(equRepairOrder.getWorkPlanTime());
//是否停机维修 停机维修时间
if(equRepairOrder.getWorkPlanDownTime() != null){
equRepairWorkOrder.setWorkDownMachine("1"); equRepairWorkOrder.setWorkDownMachine("1");
equRepairWorkOrder.setWorkPlanTime(equRepairOrder.getWorkPlanTime()); equRepairWorkOrder.setWorkPlanDownTime(equRepairOrder.getWorkPlanDownTime());
}else{ }else{
equRepairWorkOrder.setWorkDownMachine("0"); equRepairWorkOrder.setWorkDownMachine("0");
} }
@ -116,7 +125,10 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService {
EquOutsourceWork equOutsourceWork = new EquOutsourceWork(); EquOutsourceWork equOutsourceWork = new EquOutsourceWork();
//委外工单编码、id、联系方式、委外单位、委外人员、委外原因 //委外工单编码、id、联系方式、委外单位、委外人员、委外原因
equOutsourceWork.setWorkId(IdUtils.fastSimpleUUID()); equOutsourceWork.setWorkId(IdUtils.fastSimpleUUID());
equOutsourceWork.setWorkCode(equRepairOrder.getOrderCode()); equOutsourceWork.setOrderCode(equRepairOrder.getOrderCode());
String serialNum = String.format("%03d", equOutsourceWorkMapper.selectWorkCodeSerialNumber());
String equipmentCode = equRepairOrder.getEquipmentCode();
equOutsourceWork.setWorkCode("WW"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
equOutsourceWork.setWorkConnection(equRepairOrder.getWorkConnection()); equOutsourceWork.setWorkConnection(equRepairOrder.getWorkConnection());
equOutsourceWork.setWorkOutsourcingUnit(equRepairOrder.getWorkOutsourcingUnit()); equOutsourceWork.setWorkOutsourcingUnit(equRepairOrder.getWorkOutsourcingUnit());
equOutsourceWork.setWorkPerson(equRepairOrder.getOutSourcePerson()); equOutsourceWork.setWorkPerson(equRepairOrder.getOutSourcePerson());

@ -4,6 +4,8 @@ import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.op.device.mapper.EquRepairWorkOrderMapper; import com.op.device.mapper.EquRepairWorkOrderMapper;
@ -46,7 +48,7 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
} }
/** /**
* *
* *
* @param equRepairWorkOrder * @param equRepairWorkOrder
* @return * @return
@ -54,6 +56,13 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public int insertEquRepairWorkOrder(EquRepairWorkOrder equRepairWorkOrder) { public int insertEquRepairWorkOrder(EquRepairWorkOrder equRepairWorkOrder) {
equRepairWorkOrder.setWorkId(IdUtils.fastSimpleUUID());
// 获取流水号
String serialNum = String.format("%03d", equRepairWorkOrderMapper.selectWorkCodeSerialNumber());
String equipmentCode = equRepairWorkOrder.getEquipmentCode();
//维修单号
equRepairWorkOrder.setWorkCode("WX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum);
equRepairWorkOrder.setCreateBy(SecurityUtils.getUsername());
equRepairWorkOrder.setCreateTime(DateUtils.getNowDate()); equRepairWorkOrder.setCreateTime(DateUtils.getNowDate());
return equRepairWorkOrderMapper.insertEquRepairWorkOrder(equRepairWorkOrder); return equRepairWorkOrderMapper.insertEquRepairWorkOrder(equRepairWorkOrder);
} }

@ -53,6 +53,7 @@ public class SparePartsInOutStorageServiceImpl implements ISparePartsInOutStorag
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public int insertSparePartsInStorage(SparePartsInStorage sparePartsInStorage) { public int insertSparePartsInStorage(SparePartsInStorage sparePartsInStorage) {
return sparePartsInOutStorageMapper.insertSparePartsInStorage(sparePartsInStorage); return sparePartsInOutStorageMapper.insertSparePartsInStorage(sparePartsInStorage);
} }

@ -7,12 +7,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="EquOutsourceWork" id="EquOutsourceWorkResult"> <resultMap type="EquOutsourceWork" id="EquOutsourceWorkResult">
<result property="workId" column="work_id" /> <result property="workId" column="work_id" />
<result property="workCode" column="work_code" /> <result property="workCode" column="work_code" />
<result property="orderCode" column="order_code" />
<result property="workPerson" column="work_person" /> <result property="workPerson" column="work_person" />
<result property="workOutsourcingUnit" column="work_outsourcing_unit" /> <result property="workOutsourcingUnit" column="work_outsourcing_unit" />
<result property="workConnection" column="work_connection" /> <result property="workConnection" column="work_connection" />
<result property="workReason" column="work_reason" /> <result property="workReason" column="work_reason" />
<result property="workType" column="work_type" /> <result property="workType" column="work_type" />
<result property="managementCode" column="management_code" /> <result property="equipmentCode" column="equipment_code" />
<result property="workCost" column="work_cost" /> <result property="workCost" column="work_cost" />
<result property="workCostTime" column="work_cost_time" /> <result property="workCostTime" column="work_cost_time" />
<result property="attr1" column="attr1" /> <result property="attr1" column="attr1" />
@ -27,25 +28,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectEquOutsourceWorkVo"> <sql id="selectEquOutsourceWorkVo">
select work_id, work_code, work_person, work_outsourcing_unit, work_connection, work_reason, work_type, management_code, work_cost, work_cost_time, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time, factory_code from equ_outsource_work select work_id, work_code,order_code, work_person, work_outsourcing_unit, work_connection, work_reason, work_type, equipment_code, work_cost, work_cost_time, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time, factory_code from equ_outsource_work
</sql> </sql>
<select id="selectEquOutsourceWorkList" parameterType="EquOutsourceWork" resultMap="EquOutsourceWorkResult"> <select id="selectEquOutsourceWorkList" parameterType="EquOutsourceWork" resultMap="EquOutsourceWorkResult">
<include refid="selectEquOutsourceWorkVo"/> <include refid="selectEquOutsourceWorkVo"/>
<where> <where>
<if test="workCode != null and workCode != ''"> and work_code = #{workCode}</if> <if test="workCode != null and workCode != ''"> and work_code = #{workCode}</if>
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
<if test="workPerson != null and workPerson != ''"> and work_person = #{workPerson}</if> <if test="workPerson != null and workPerson != ''"> and work_person = #{workPerson}</if>
<if test="workOutsourcingUnit != null and workOutsourcingUnit != ''"> and work_outsourcing_unit = #{workOutsourcingUnit}</if> <if test="workOutsourcingUnit != null and workOutsourcingUnit != ''"> and work_outsourcing_unit = #{workOutsourcingUnit}</if>
<if test="workConnection != null and workConnection != ''"> and work_connection = #{workConnection}</if> <if test="workConnection != null and workConnection != ''"> and work_connection = #{workConnection}</if>
<if test="workReason != null and workReason != ''"> and work_reason = #{workReason}</if> <if test="workReason != null and workReason != ''"> and work_reason = #{workReason}</if>
<if test="workType != null and workType != ''"> and work_type = #{workType}</if> <if test="workType != null and workType != ''"> and work_type = #{workType}</if>
<if test="managementCode != null and managementCode != ''"> and management_code = #{managementCode}</if> <if test="equipmentCode != null and equipmentCode != ''"> and equipment_code = #{equipmentCode}</if>
<if test="workCost != null and workCost != ''"> and work_cost = #{workCost}</if> <if test="workCost != null and workCost != ''"> and work_cost = #{workCost}</if>
<if test="workCostTime != null and workCostTime != ''"> and work_cost_time = #{workCostTime}</if> <if test="workCostTime != null and workCostTime != ''"> and work_cost_time = #{workCostTime}</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if> <if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if> <if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if> <if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
<if test="createTime != null and createTime != ''"> and create_time = #{createTime}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if> <if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
and del_flag = '0'
ORDER BY create_time DESC
</where> </where>
</select> </select>
@ -59,12 +65,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="workId != null">work_id,</if> <if test="workId != null">work_id,</if>
<if test="workCode != null">work_code,</if> <if test="workCode != null">work_code,</if>
<if test="orderCode != null">order_code,</if>
<if test="workPerson != null">work_person,</if> <if test="workPerson != null">work_person,</if>
<if test="workOutsourcingUnit != null">work_outsourcing_unit,</if> <if test="workOutsourcingUnit != null">work_outsourcing_unit,</if>
<if test="workConnection != null">work_connection,</if> <if test="workConnection != null">work_connection,</if>
<if test="workReason != null">work_reason,</if> <if test="workReason != null">work_reason,</if>
<if test="workType != null">work_type,</if> <if test="workType != null">work_type,</if>
<if test="managementCode != null">management_code,</if> <if test="equipmentCode != null">equipment_code,</if>
<if test="workCost != null">work_cost,</if> <if test="workCost != null">work_cost,</if>
<if test="workCostTime != null">work_cost_time,</if> <if test="workCostTime != null">work_cost_time,</if>
<if test="attr1 != null">attr1,</if> <if test="attr1 != null">attr1,</if>
@ -80,12 +87,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="workId != null">#{workId},</if> <if test="workId != null">#{workId},</if>
<if test="workCode != null">#{workCode},</if> <if test="workCode != null">#{workCode},</if>
<if test="orderCode != null">#{orderCode},</if>
<if test="workPerson != null">#{workPerson},</if> <if test="workPerson != null">#{workPerson},</if>
<if test="workOutsourcingUnit != null">#{workOutsourcingUnit},</if> <if test="workOutsourcingUnit != null">#{workOutsourcingUnit},</if>
<if test="workConnection != null">#{workConnection},</if> <if test="workConnection != null">#{workConnection},</if>
<if test="workReason != null">#{workReason},</if> <if test="workReason != null">#{workReason},</if>
<if test="workType != null">#{workType},</if> <if test="workType != null">#{workType},</if>
<if test="managementCode != null">#{managementCode},</if> <if test="equipmentCode != null">#{equipmentCode},</if>
<if test="workCost != null">#{workCost},</if> <if test="workCost != null">#{workCost},</if>
<if test="workCostTime != null">#{workCostTime},</if> <if test="workCostTime != null">#{workCostTime},</if>
<if test="attr1 != null">#{attr1},</if> <if test="attr1 != null">#{attr1},</if>
@ -104,12 +112,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update equ_outsource_work update equ_outsource_work
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="workCode != null">work_code = #{workCode},</if> <if test="workCode != null">work_code = #{workCode},</if>
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="workPerson != null">work_person = #{workPerson},</if> <if test="workPerson != null">work_person = #{workPerson},</if>
<if test="workOutsourcingUnit != null">work_outsourcing_unit = #{workOutsourcingUnit},</if> <if test="workOutsourcingUnit != null">work_outsourcing_unit = #{workOutsourcingUnit},</if>
<if test="workConnection != null">work_connection = #{workConnection},</if> <if test="workConnection != null">work_connection = #{workConnection},</if>
<if test="workReason != null">work_reason = #{workReason},</if> <if test="workReason != null">work_reason = #{workReason},</if>
<if test="workType != null">work_type = #{workType},</if> <if test="workType != null">work_type = #{workType},</if>
<if test="managementCode != null">management_code = #{managementCode},</if> <if test="equipmentCode != null">equipment_code = #{equipmentCode},</if>
<if test="workCost != null">work_cost = #{workCost},</if> <if test="workCost != null">work_cost = #{workCost},</if>
<if test="workCostTime != null">work_cost_time = #{workCostTime},</if> <if test="workCostTime != null">work_cost_time = #{workCostTime},</if>
<if test="attr1 != null">attr1 = #{attr1},</if> <if test="attr1 != null">attr1 = #{attr1},</if>
@ -123,6 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="factoryCode != null">factory_code = #{factoryCode},</if> <if test="factoryCode != null">factory_code = #{factoryCode},</if>
</trim> </trim>
where work_id = #{workId} where work_id = #{workId}
and del_flag = '0'
</update> </update>
<delete id="deleteEquOutsourceWorkByWorkId" parameterType="String"> <delete id="deleteEquOutsourceWorkByWorkId" parameterType="String">
@ -135,4 +145,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{workId} #{workId}
</foreach> </foreach>
</delete> </delete>
<select id="selectWorkCodeSerialNumber" resultType="java.lang.Integer">
SELECT COUNT(work_id)+1 AS serialNum
FROM equ_outsource_work
where del_flag = '0'
</select>
</mapper> </mapper>

@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="equipmentSpec" column="equipment_spec" /> <result property="equipmentSpec" column="equipment_spec" />
<!-- 计划 --> <!-- 计划 -->
<result property="workPlanTime" column="work_plan_time" /> <result property="workPlanTime" column="work_plan_time" />
<result property="workDownMachine" column="work_down_machine" />
<result property="workPlanDownTime" column="work_plan_down_time" /> <result property="workPlanDownTime" column="work_plan_down_time" />
<result property="workTeam" column="work_team" /> <result property="workTeam" column="work_team" />
<!-- 委外 --> <!-- 委外 -->
@ -66,9 +67,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if> <if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if> <if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if> <if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
<if test="createTime != null and createTime != ''"> and create_time = #{createTime}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if> <if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="repairDestination != null and repairDestination != ''"> and repair_destination = #{repairDestination}</if> <if test="repairDestination != null and repairDestination != ''"> and repair_destination = #{repairDestination}</if>
and del_flag = '0' and del_flag = '0'
ORDER BY create_time DESC
</where> </where>
</select> </select>
@ -97,6 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
be.equipment_spec, be.equipment_spec,
be.department, be.department,
be.equipment_location, be.equipment_location,
rwo.work_down_machine,
rwo.work_plan_down_time, rwo.work_plan_down_time,
rwo.work_plan_time, rwo.work_plan_time,
rwo.work_team, rwo.work_team,
@ -110,6 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join equ_outsource_work eow on ero.order_code = eow.work_code left join equ_outsource_work eow on ero.order_code = eow.work_code
where ero.order_id = #{orderId} where ero.order_id = #{orderId}
and ero.del_flag = '0' and ero.del_flag = '0'
ORDER BY create_time DESC
</select> </select>
<insert id="insertEquRepairOrder" parameterType="EquRepairOrder"> <insert id="insertEquRepairOrder" parameterType="EquRepairOrder">
@ -203,7 +208,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<select id="selectSerialNumber" resultType="java.lang.Integer"> <select id="selectOrderCodeSerialNumber" resultType="java.lang.Integer">
SELECT COUNT(order_id)+1 AS serialNum SELECT COUNT(order_id)+1 AS serialNum
FROM equ_repair_order FROM equ_repair_order
WHERE CONVERT(date, GETDATE()) = CONVERT(date,create_time) WHERE CONVERT(date, GETDATE()) = CONVERT(date,create_time)

@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="EquRepairWorkOrder" id="EquRepairWorkOrderResult"> <resultMap type="EquRepairWorkOrder" id="EquRepairWorkOrderResult">
<result property="workId" column="work_id" /> <result property="workId" column="work_id" />
<result property="orderId" column="order_id" /> <result property="orderId" column="order_id" />
<result property="workCode" column="work_code" />
<result property="orderCode" column="order_code" /> <result property="orderCode" column="order_code" />
<result property="workHandle" column="work_handle" /> <result property="workHandle" column="work_handle" />
<result property="workPlanTime" column="work_plan_time" /> <result property="workPlanTime" column="work_plan_time" />
@ -32,42 +33,84 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="delFlag" column="del_flag" /> <result property="delFlag" column="del_flag" />
<result property="factoryCode" column="factory_code" /> <result property="factoryCode" column="factory_code" />
<!--设备-->
<result property="equipmentName" column="equipment_name" />
<result property="equipmentSpec" column="equipment_spec" />
<result property="equipmentTypeName" column="equipment_type_name" />
<result property="equipmentLocation" column="equipment_location" />
<result property="department" column="department" />
</resultMap> </resultMap>
<sql id="selectEquRepairWorkOrderVo"> <sql id="selectEquRepairWorkOrderVo">
select work_id, order_id, order_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_cost_time, work_cost, out_work_id, out_work_code, attr1, attr2, attr3, create_by, create_time, update_time, update_by, del_flag, factory_code 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_cost_time, work_cost, out_work_id, out_work_code, attr1, attr2, attr3, create_by, create_time, update_time, update_by, del_flag, factory_code from equ_repair_work_order
</sql> </sql>
<select id="selectEquRepairWorkOrderList" parameterType="EquRepairWorkOrder" resultMap="EquRepairWorkOrderResult"> <select id="selectEquRepairWorkOrderList" parameterType="EquRepairWorkOrder" resultMap="EquRepairWorkOrderResult">
<include refid="selectEquRepairWorkOrderVo"/> <include refid="selectEquRepairWorkOrderVo"/>
<where> <where>
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if> <if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if> <if test="workCode != null and workCode != ''"> and work_code like concat('%', #{workCode}, '%')</if>
<if test="workHandle != null and workHandle != ''"> and work_handle = #{workHandle}</if> <if test="orderCode != null and orderCode != ''"> and order_code like concat('%', #{orderCode}, '%')</if>
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code like concat('%', #{equipmentCode}, '%')</if>
<if test="workDownMachine != null and workDownMachine != ''"> and work_down_machine = #{workDownMachine}</if>
<if test="workPlanTime != null "> and work_plan_time = #{workPlanTime}</if> <if test="workPlanTime != null "> and work_plan_time = #{workPlanTime}</if>
<if test="workPlanDownTime != null "> and work_plan_down_time = #{workPlanDownTime}</if> <if test="workPlanDownTime != null "> and work_plan_down_time = #{workPlanDownTime}</if>
<if test="orderRelevance != null and orderRelevance != ''"> and order_relevance = #{orderRelevance}</if> <if test="workPerson != null and workPerson != ''"> and work_person like concat('%', #{workPerson}, '%')</if>
<if test="workPerson != null and workPerson != ''"> and work_person = #{workPerson}</if> <if test="workTeam != null and workTeam != ''"> and work_team like concat('%', #{workTeam}, '%')</if>
<if test="workTeam != null and workTeam != ''"> and work_team = #{workTeam}</if>
<if test="workOutsource != null and workOutsource != ''"> and work_outsource = #{workOutsource}</if> <if test="workOutsource != null and workOutsource != ''"> and work_outsource = #{workOutsource}</if>
<if test="workDownMachine != null and workDownMachine != ''"> and work_down_machine = #{workDownMachine}</if> <if test="outWorkCode != null and outWorkCode != ''"> and out_work_code = #{outWorkCode}</if>
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code = #{equipmentCode}</if> <!--没有用上-->
<if test="workHandle != null and workHandle != ''"> and work_handle = #{workHandle}</if>
<if test="orderRelevance != null and orderRelevance != ''"> and order_relevance = #{orderRelevance}</if>
<if test="workReason != null and workReason != ''"> and work_reason = #{workReason}</if> <if test="workReason != null and workReason != ''"> and work_reason = #{workReason}</if>
<if test="workFaultDesc != null and workFaultDesc != ''"> and work_fault_desc = #{workFaultDesc}</if> <if test="workFaultDesc != null and workFaultDesc != ''"> and work_fault_desc = #{workFaultDesc}</if>
<if test="workCostTime != null "> and work_cost_time = #{workCostTime}</if> <if test="workCostTime != null "> and work_cost_time = #{workCostTime}</if>
<if test="workCost != null and workCost != ''"> and work_cost = #{workCost}</if> <if test="workCost != null and workCost != ''"> and work_cost = #{workCost}</if>
<if test="outWorkId != null and outWorkId != ''"> and out_work_id = #{outWorkId}</if>
<if test="outWorkCode != null and outWorkCode != ''"> and out_work_code = #{outWorkCode}</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="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if> <if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
and del_flag = '0'
</where> </where>
ORDER BY create_time DESC
</select> </select>
<select id="selectEquRepairWorkOrderByWorkId" parameterType="String" resultMap="EquRepairWorkOrderResult"> <select id="selectEquRepairWorkOrderByWorkId" parameterType="String" resultMap="EquRepairWorkOrderResult">
<include refid="selectEquRepairWorkOrderVo"/> select
where work_id = #{workId} erwo.work_id,
erwo.order_id,
erwo.order_code,
erwo.work_code,
erwo.work_handle,
erwo.work_plan_time,
erwo.work_plan_down_time,
erwo.order_relevance,
erwo.work_person,
erwo.work_team,
erwo.work_outsource,
erwo.work_down_machine,
erwo.equipment_code,
erwo.work_reason,
erwo.work_fault_desc,
erwo.work_cost_time,
erwo.work_cost,
erwo.out_work_id,
erwo.out_work_code,
erwo.attr1,
erwo.attr2,
erwo.attr3,
erwo.create_by,
erwo.create_time,
erwo.update_time,
erwo.update_by,
erwo.factory_code,
be.equipment_name,
be.equipment_spec,
be.equipment_type_name,
be.equipment_location,
be.department
from equ_repair_work_order erwo
left join base_equipment be on erwo.equipment_code = be.equipment_code
where erwo.work_id = #{workId}
and erwo.del_flag = '0'
ORDER BY create_time DESC
</select> </select>
<insert id="insertEquRepairWorkOrder" parameterType="EquRepairWorkOrder"> <insert id="insertEquRepairWorkOrder" parameterType="EquRepairWorkOrder">
@ -75,6 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="workId != null">work_id,</if> <if test="workId != null">work_id,</if>
<if test="orderId != null">order_id,</if> <if test="orderId != null">order_id,</if>
<if test="workCode != null">work_code,</if>
<if test="orderCode != null">order_code,</if> <if test="orderCode != null">order_code,</if>
<if test="workHandle != null">work_handle,</if> <if test="workHandle != null">work_handle,</if>
<if test="workPlanTime != null">work_plan_time,</if> <if test="workPlanTime != null">work_plan_time,</if>
@ -104,6 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="workId != null">#{workId},</if> <if test="workId != null">#{workId},</if>
<if test="orderId != null">#{orderId},</if> <if test="orderId != null">#{orderId},</if>
<if test="workCode != null">#{workCode},</if>
<if test="orderCode != null">#{orderCode},</if> <if test="orderCode != null">#{orderCode},</if>
<if test="workHandle != null">#{workHandle},</if> <if test="workHandle != null">#{workHandle},</if>
<if test="workPlanTime != null">#{workPlanTime},</if> <if test="workPlanTime != null">#{workPlanTime},</if>
@ -136,6 +181,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update equ_repair_work_order update equ_repair_work_order
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="orderId != null">order_id = #{orderId},</if> <if test="orderId != null">order_id = #{orderId},</if>
<if test="workCode != null">work_code = #{workCode},</if>
<if test="orderCode != null">order_code = #{orderCode},</if> <if test="orderCode != null">order_code = #{orderCode},</if>
<if test="workHandle != null">work_handle = #{workHandle},</if> <if test="workHandle != null">work_handle = #{workHandle},</if>
<if test="workPlanTime != null">work_plan_time = #{workPlanTime},</if> <if test="workPlanTime != null">work_plan_time = #{workPlanTime},</if>
@ -163,6 +209,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="factoryCode != null">factory_code = #{factoryCode},</if> <if test="factoryCode != null">factory_code = #{factoryCode},</if>
</trim> </trim>
where work_id = #{workId} where work_id = #{workId}
and del_flag = '0'
</update>
<update id="updateWorkOutsource" parameterType="EquRepairWorkOrder">
update equ_repair_work_order
set
work_outsource = #{workOutsource},
out_work_code = #{outWorkCode}
where work_id = #{workId}
and del_flag = '0'
</update> </update>
<delete id="deleteEquRepairWorkOrderByWorkId" parameterType="String"> <delete id="deleteEquRepairWorkOrderByWorkId" parameterType="String">
@ -175,4 +231,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{workId} #{workId}
</foreach> </foreach>
</delete> </delete>
<select id="selectWorkCodeSerialNumber" resultType="java.lang.Integer">
SELECT COUNT(work_id)+1 AS serialNum
FROM equ_repair_work_order
where del_flag = '0'
</select>
</mapper> </mapper>
Loading…
Cancel
Save