巡检工单填写记录V1

highway
wws 1 year ago
parent aedd7d6052
commit dcbde38d27

@ -2,6 +2,7 @@ package com.op.device.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -23,75 +24,75 @@ import com.op.common.core.web.page.TableDataInfo;
/**
* Controller
*
*
* @author wws
* @date 2023-10-23
*/
@RestController
@RequestMapping("/deviceOrder")
public class EquOrderController extends BaseController {
@Autowired
private IEquOrderService equOrderService;
@Autowired
private IEquOrderService equOrderService;
/**
*
*/
@RequiresPermissions("device:deviceOrder:list")
@GetMapping("/list")
public TableDataInfo list(EquOrder equOrder) {
startPage();
List<EquOrder> list = equOrderService.selectEquOrderList(equOrder);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("device:deviceOrder:list")
@GetMapping("/list")
public TableDataInfo list(EquOrder equOrder) {
startPage();
List<EquOrder> list = equOrderService.selectEquOrderList(equOrder);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("device:deviceOrder:export")
@Log(title = "计划工单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EquOrder equOrder) {
List<EquOrder> list = equOrderService.selectEquOrderList(equOrder);
ExcelUtil<EquOrder> util = new ExcelUtil<EquOrder>(EquOrder.class);
util.exportExcel(response, list, "计划工单数据");
}
/**
*
*/
@RequiresPermissions("device:deviceOrder:export")
@Log(title = "计划工单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EquOrder equOrder) {
List<EquOrder> list = equOrderService.selectEquOrderList(equOrder);
ExcelUtil<EquOrder> util = new ExcelUtil<EquOrder>(EquOrder.class);
util.exportExcel(response, list, "计划工单数据");
}
/**
*
*/
@RequiresPermissions("device:deviceOrder:query")
@GetMapping(value = "/{orderId}")
public AjaxResult getInfo(@PathVariable("orderId") String orderId) {
return success(equOrderService.selectEquOrderByOrderId(orderId));
}
/**
*
*/
@RequiresPermissions("device:deviceOrder:query")
@GetMapping(value = "/{orderCode}")
public AjaxResult getInfo(@PathVariable("orderCode") String orderCode) {
return success(equOrderService.selectEquOrderByOrderCode(orderCode));
}
/**
*
*/
@RequiresPermissions("device:deviceOrder:add")
@Log(title = "计划工单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EquOrder equOrder) {
return toAjax(equOrderService.insertEquOrder(equOrder));
}
/**
*
*/
@RequiresPermissions("device:deviceOrder:add")
@Log(title = "计划工单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EquOrder equOrder) {
return equOrderService.insertEquOrder(equOrder);
}
/**
*
*/
@RequiresPermissions("device:deviceOrder:edit")
@Log(title = "计划工单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EquOrder equOrder) {
return toAjax(equOrderService.updateEquOrder(equOrder));
}
/**
*
*/
@RequiresPermissions("device:deviceOrder:edit")
@Log(title = "计划工单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EquOrder equOrder) {
return toAjax(equOrderService.updateEquOrder(equOrder));
}
/**
*
*/
@RequiresPermissions("device:deviceOrder:remove")
@Log(title = "计划工单", businessType = BusinessType.DELETE)
@DeleteMapping("/{orderIds}")
public AjaxResult remove(@PathVariable String[] orderIds) {
return toAjax(equOrderService.deleteEquOrderByOrderIds(orderIds));
}
/**
*
*/
@RequiresPermissions("device:deviceOrder:remove")
@Log(title = "计划工单", businessType = BusinessType.DELETE)
@DeleteMapping("/{orderIds}")
public AjaxResult remove(@PathVariable String[] orderIds) {
return toAjax(equOrderService.deleteEquOrderByOrderIds(orderIds));
}
}

@ -2,6 +2,8 @@ package com.op.device.domain;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -116,6 +118,46 @@ public class EquOrder extends BaseEntity {
@Excel(name = "删除标志")
private String delFlag;
private List<EquOrderEqu> equList;
private String planName;
private String workCenterName;
private List<Date> timeArray;
public List<Date> getTimeArray() {
return timeArray;
}
public void setTimeArray(List<Date> timeArray) {
this.timeArray = timeArray;
}
public String getWorkCenterName() {
return workCenterName;
}
public void setWorkCenterName(String workCenterName) {
this.workCenterName = workCenterName;
}
public String getPlanName() {
return planName;
}
public void setPlanName(String planName) {
this.planName = planName;
}
public List<EquOrderEqu> getEquList() {
return equList;
}
public void setEquList(List<EquOrderEqu> equList) {
this.equList = equList;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}

@ -0,0 +1,205 @@
package com.op.device.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import java.util.List;
/**
* - equ_order_detail
*
* @author Open Platform
* @date 2023-10-23
*/
public class EquOrderDetail extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键 */
private String id;
/** 检查项编码 */
@Excel(name = "检查项编码")
private String code;
/** 工单编码 */
@Excel(name = "工单编码")
private String orderCode;
/** 关联上级表单 */
@Excel(name = "关联上级表单")
private String parentCode;
/** 检查项编码 */
@Excel(name = "检查项编码")
private String itemCode;
/** 检查项名称 */
@Excel(name = "检查项名称")
private String itemName;
/** 检查项方法/工具 */
@Excel(name = "检查项方法/工具")
private String itemMethod;
/** 维护类型 */
@Excel(name = "维护类型")
private String itemType;
/** 维护类型名称 */
@Excel(name = "维护类型名称")
private String itemTypeName;
/** 工厂 */
@Excel(name = "工厂")
private String factroyCode;
/** 备用字段1 */
@Excel(name = "备用字段1")
private String attr1;
/** 备用字段2 */
@Excel(name = "备用字段2")
private String attr2;
/** 备用字段3 */
@Excel(name = "备用字段3")
private String attr3;
/** 删除标志 */
private String delFlag;
private List<EquOrderStandard> standardList;
public List<EquOrderStandard> getStandardList() {
return standardList;
}
public void setStandardList(List<EquOrderStandard> standardList) {
this.standardList = standardList;
}
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setCode(String code) {
this.code = code;
}
public String getCode() {
return code;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getOrderCode() {
return orderCode;
}
public void setParentCode(String parentCode) {
this.parentCode = parentCode;
}
public String getParentCode() {
return parentCode;
}
public void setItemCode(String itemCode) {
this.itemCode = itemCode;
}
public String getItemCode() {
return itemCode;
}
public void setItemName(String itemName) {
this.itemName = itemName;
}
public String getItemName() {
return itemName;
}
public void setItemMethod(String itemMethod) {
this.itemMethod = itemMethod;
}
public String getItemMethod() {
return itemMethod;
}
public void setItemType(String itemType) {
this.itemType = itemType;
}
public String getItemType() {
return itemType;
}
public void setItemTypeName(String itemTypeName) {
this.itemTypeName = itemTypeName;
}
public String getItemTypeName() {
return itemTypeName;
}
public void setFactroyCode(String factroyCode) {
this.factroyCode = factroyCode;
}
public String getFactroyCode() {
return factroyCode;
}
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 setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("code", getCode())
.append("orderCode", getOrderCode())
.append("parentCode", getParentCode())
.append("itemCode", getItemCode())
.append("itemName", getItemName())
.append("itemMethod", getItemMethod())
.append("itemType", getItemType())
.append("itemTypeName", getItemTypeName())
.append("factroyCode", getFactroyCode())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -0,0 +1,169 @@
package com.op.device.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
import java.util.List;
/**
* - equ_order_equ
*
* @author Open Platform
* @date 2023-10-23
*/
public class EquOrderEqu extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键 */
private String id;
/** 计划详情-设备编码 */
@Excel(name = "计划详情-设备编码")
private String code;
/** 关联上级表单 */
@Excel(name = "关联上级表单")
private String parentCode;
/** 工单code */
@Excel(name = "工单code")
private String orderCode;
/** 设备编码 */
@Excel(name = "设备编码")
private String equipmentCode;
/** 设备名称 */
@Excel(name = "设备名称")
private String equipmentName;
/** 工厂 */
@Excel(name = "工厂")
private String factoryCode;
/** 备用字段1 */
@Excel(name = "备用字段1")
private String attr1;
/** 备用字段2 */
@Excel(name = "备用字段2")
private String attr2;
/** 备用字段3 */
@Excel(name = "备用字段3")
private String attr3;
/** 删除标识 */
private String delFlag;
private List<EquOrderDetail> detailList;
public List<EquOrderDetail> getDetailList() {
return detailList;
}
public void setDetailList(List<EquOrderDetail> detailList) {
this.detailList = detailList;
}
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setCode(String code) {
this.code = code;
}
public String getCode() {
return code;
}
public void setParentCode(String parentCode) {
this.parentCode = parentCode;
}
public String getParentCode() {
return parentCode;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getOrderCode() {
return orderCode;
}
public void setEquipmentCode(String equipmentCode) {
this.equipmentCode = equipmentCode;
}
public String getEquipmentCode() {
return equipmentCode;
}
public void setEquipmentName(String equipmentName) {
this.equipmentName = equipmentName;
}
public String getEquipmentName() {
return equipmentName;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
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 setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("code", getCode())
.append("parentCode", getParentCode())
.append("orderCode", getOrderCode())
.append("equipmentCode", getEquipmentCode())
.append("equipmentName", getEquipmentName())
.append("factoryCode", getFactoryCode())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -0,0 +1,133 @@
package com.op.device.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
/**
* - equ_order_person
*
* @author Open Platform
* @date 2023-10-23
*/
public class EquOrderPerson extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键 */
private String id;
/** 工单编码 */
@Excel(name = "工单编码")
private String orderCode;
/** 用户id */
@Excel(name = "用户id")
private Long userId;
/** 账号 */
@Excel(name = "账号")
private String userName;
/** 工厂 */
@Excel(name = "工厂")
private String factoryCode;
/** 备用字段1 */
@Excel(name = "备用字段1")
private String attr1;
/** 备用字段2 */
@Excel(name = "备用字段2")
private String attr2;
/** 备用字段3 */
@Excel(name = "备用字段3")
private String attr3;
/** 删除标识 */
private String delFlag;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getOrderCode() {
return orderCode;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getUserId() {
return userId;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserName() {
return userName;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
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 setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("orderCode", getOrderCode())
.append("userId", getUserId())
.append("userName", getUserName())
.append("factoryCode", getFactoryCode())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -0,0 +1,230 @@
package com.op.device.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
/**
* - equ_order_standard
*
* @author Open Platform
* @date 2023-10-23
*/
public class EquOrderStandard extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键 */
private String id;
/** 编码 */
@Excel(name = "编码")
private String code;
/** 关联上级表单 */
@Excel(name = "关联上级表单")
private String parentCode;
/** 工单编码 */
@Excel(name = "工单编码")
private String orderCode;
/** 标准类型 */
@Excel(name = "标准类型")
private String standardType;
/** 标准名称 */
@Excel(name = "标准名称")
private String standardName;
/** 上限 */
@Excel(name = "上限")
private BigDecimal detailUpLimit;
/** 下限 */
@Excel(name = "下限")
private BigDecimal detailDownLimit;
/** 单位 */
@Excel(name = "单位")
private String detailUnit;
/** 达标 */
@Excel(name = "达标")
private String detailReach;
/** 实际值 */
@Excel(name = "实际值")
private BigDecimal actualValue;
/** 是否异常 */
@Excel(name = "是否异常")
private String detailError;
/** 工厂 */
@Excel(name = "工厂")
private String factoryCode;
/** 备用字段1 */
@Excel(name = "备用字段1")
private String attr1;
/** 备用字段2 */
@Excel(name = "备用字段2")
private String attr2;
/** 备用字段3 */
@Excel(name = "备用字段3")
private String attr3;
/** 删除标识 */
private String delFlag;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setCode(String code) {
this.code = code;
}
public String getCode() {
return code;
}
public void setParentCode(String parentCode) {
this.parentCode = parentCode;
}
public String getParentCode() {
return parentCode;
}
public void setOrderCode(String orderCode) {
this.orderCode = orderCode;
}
public String getOrderCode() {
return orderCode;
}
public void setStandardType(String standardType) {
this.standardType = standardType;
}
public String getStandardType() {
return standardType;
}
public void setStandardName(String standardName) {
this.standardName = standardName;
}
public String getStandardName() {
return standardName;
}
public void setDetailUpLimit(BigDecimal detailUpLimit) {
this.detailUpLimit = detailUpLimit;
}
public BigDecimal getDetailUpLimit() {
return detailUpLimit;
}
public void setDetailDownLimit(BigDecimal detailDownLimit) {
this.detailDownLimit = detailDownLimit;
}
public BigDecimal getDetailDownLimit() {
return detailDownLimit;
}
public void setDetailUnit(String detailUnit) {
this.detailUnit = detailUnit;
}
public String getDetailUnit() {
return detailUnit;
}
public void setDetailReach(String detailReach) {
this.detailReach = detailReach;
}
public String getDetailReach() {
return detailReach;
}
public void setActualValue(BigDecimal actualValue) {
this.actualValue = actualValue;
}
public BigDecimal getActualValue() {
return actualValue;
}
public void setDetailError(String detailError) {
this.detailError = detailError;
}
public String getDetailError() {
return detailError;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
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 setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("code", getCode())
.append("parentCode", getParentCode())
.append("orderCode", getOrderCode())
.append("standardType", getStandardType())
.append("standardName", getStandardName())
.append("detailUpLimit", getDetailUpLimit())
.append("detailDownLimit", getDetailDownLimit())
.append("detailUnit", getDetailUnit())
.append("detailReach", getDetailReach())
.append("actualValue", getActualValue())
.append("detailError", getDetailError())
.append("factoryCode", getFactoryCode())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

@ -0,0 +1,68 @@
package com.op.device.mapper;
import java.util.List;
import com.op.device.domain.EquOrderDetail;
/**
* -Mapper
*
* @author Open Platform
* @date 2023-10-23
*/
public interface EquOrderDetailMapper {
/**
* -
*
* @param id -
* @return -
*/
public EquOrderDetail selectEquOrderDetailById(String id);
/**
* -
*
* @param equOrderDetail -
* @return -
*/
public List<EquOrderDetail> selectEquOrderDetailList(EquOrderDetail equOrderDetail);
/**
* -
*
* @param equOrderDetail -
* @return
*/
public int insertEquOrderDetail(EquOrderDetail equOrderDetail);
/**
* -
*
* @param equOrderDetail -
* @return
*/
public int updateEquOrderDetail(EquOrderDetail equOrderDetail);
/**
* -
*
* @param id -
* @return
*/
public int deleteEquOrderDetailById(String id);
/**
* -
*
* @param ids
* @return
*/
public int deleteEquOrderDetailByIds(String[] ids);
/**
* parentCode
* @param code
* @return
*/
List<EquOrderDetail> selectEquOrderDetailByParentCode(String code);
}

@ -0,0 +1,68 @@
package com.op.device.mapper;
import java.util.List;
import com.op.device.domain.EquOrderEqu;
/**
* -Mapper
*
* @author Open Platform
* @date 2023-10-23
*/
public interface EquOrderEquMapper {
/**
* -
*
* @param id -
* @return -
*/
public EquOrderEqu selectEquOrderEquById(String id);
/**
* -
*
* @param equOrderEqu -
* @return -
*/
public List<EquOrderEqu> selectEquOrderEquList(EquOrderEqu equOrderEqu);
/**
* -
*
* @param equOrderEqu -
* @return
*/
public int insertEquOrderEqu(EquOrderEqu equOrderEqu);
/**
* -
*
* @param equOrderEqu -
* @return
*/
public int updateEquOrderEqu(EquOrderEqu equOrderEqu);
/**
* -
*
* @param id -
* @return
*/
public int deleteEquOrderEquById(String id);
/**
* -
*
* @param ids
* @return
*/
public int deleteEquOrderEquByIds(String[] ids);
/**
* parentCodelist
* @param orderCode
* @return
*/
List<EquOrderEqu> selectEquOrderEquListByParentCode(String orderCode);
}

@ -14,10 +14,10 @@ public interface EquOrderMapper {
/**
*
*
* @param orderId
* @param orderCode
* @return
*/
public EquOrder selectEquOrderByOrderId(String orderId);
public EquOrder selectEquOrderByOrderCode(String orderCode);
/**
*
@ -58,4 +58,18 @@ public interface EquOrderMapper {
* @return
*/
public int deleteEquOrderByOrderIds(String[] orderIds);
/**
* code
* @param orderCode
* @return
*/
String selectPlanNameByPlanCode(String orderCode);
/**
* code
* @param planWorkshop
* @return
*/
String selectCenterNameByCenterCode(String planWorkshop);
}

@ -0,0 +1,61 @@
package com.op.device.mapper;
import java.util.List;
import com.op.device.domain.EquOrderPerson;
/**
* -Mapper
*
* @author Open Platform
* @date 2023-10-23
*/
public interface EquOrderPersonMapper {
/**
* -
*
* @param id -
* @return -
*/
public EquOrderPerson selectEquOrderPersonById(String id);
/**
* -
*
* @param equOrderPerson -
* @return -
*/
public List<EquOrderPerson> selectEquOrderPersonList(EquOrderPerson equOrderPerson);
/**
* -
*
* @param equOrderPerson -
* @return
*/
public int insertEquOrderPerson(EquOrderPerson equOrderPerson);
/**
* -
*
* @param equOrderPerson -
* @return
*/
public int updateEquOrderPerson(EquOrderPerson equOrderPerson);
/**
* -
*
* @param id -
* @return
*/
public int deleteEquOrderPersonById(String id);
/**
* -
*
* @param ids
* @return
*/
public int deleteEquOrderPersonByIds(String[] ids);
}

@ -0,0 +1,68 @@
package com.op.device.mapper;
import java.util.List;
import com.op.device.domain.EquOrderStandard;
/**
* -Mapper
*
* @author Open Platform
* @date 2023-10-23
*/
public interface EquOrderStandardMapper {
/**
* -
*
* @param id -
* @return -
*/
public EquOrderStandard selectEquOrderStandardById(String id);
/**
* -
*
* @param equOrderStandard -
* @return -
*/
public List<EquOrderStandard> selectEquOrderStandardList(EquOrderStandard equOrderStandard);
/**
* -
*
* @param equOrderStandard -
* @return
*/
public int insertEquOrderStandard(EquOrderStandard equOrderStandard);
/**
* -
*
* @param equOrderStandard -
* @return
*/
public int updateEquOrderStandard(EquOrderStandard equOrderStandard);
/**
* -
*
* @param id -
* @return
*/
public int deleteEquOrderStandardById(String id);
/**
* -
*
* @param ids
* @return
*/
public int deleteEquOrderStandardByIds(String[] ids);
/**
* parentCode
* @param code
* @return
*/
List<EquOrderStandard> selectEquOrderStandardByParentCode(String code);
}

@ -1,6 +1,8 @@
package com.op.device.service;
import java.util.List;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.EquOrder;
/**
@ -13,10 +15,10 @@ public interface IEquOrderService {
/**
*
*
* @param orderId
* @param orderCode
* @return
*/
public EquOrder selectEquOrderByOrderId(String orderId);
public EquOrder selectEquOrderByOrderCode(String orderCode);
/**
*
@ -32,7 +34,7 @@ public interface IEquOrderService {
* @param equOrder
* @return
*/
public int insertEquOrder(EquOrder equOrder);
public AjaxResult insertEquOrder(EquOrder equOrder);
/**
*

@ -1,15 +1,23 @@
package com.op.device.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.device.domain.EquOrderDetail;
import com.op.device.domain.EquOrderEqu;
import com.op.device.domain.EquOrderStandard;
import com.op.device.mapper.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.device.mapper.EquOrderMapper;
import com.op.device.domain.EquOrder;
import com.op.device.service.IEquOrderService;
import static com.op.common.core.web.domain.AjaxResult.success;
/**
* Service
*
@ -20,17 +28,52 @@ import com.op.device.service.IEquOrderService;
public class EquOrderServiceImpl implements IEquOrderService {
@Autowired
private EquOrderMapper equOrderMapper;
@Autowired
private EquOrderEquMapper equOrderEquMapper;
@Autowired
private EquOrderPersonMapper equOrderPersonMapper;
@Autowired
private EquOrderDetailMapper equOrderDetailMapper;
@Autowired
private EquOrderStandardMapper equOrderStandardMapper;
/**
*
*
* @param orderId
* @param orderCode
* @return
*/
@Override
@DS("#header.poolName")
public EquOrder selectEquOrderByOrderId(String orderId) {
return equOrderMapper.selectEquOrderByOrderId(orderId);
public EquOrder selectEquOrderByOrderCode(String orderCode) {
// 查询工单信息
EquOrder order = equOrderMapper.selectEquOrderByOrderCode(orderCode);
List<Date> timeArray = new ArrayList<>();
timeArray.add(order.getOrderStart());
timeArray.add(order.getOrderEnd());
order.setTimeArray(timeArray);
order.setPlanName(equOrderMapper.selectPlanNameByPlanCode(orderCode));
order.setWorkCenterName(equOrderMapper.selectCenterNameByCenterCode(order.getPlanWorkshop()));
List<EquOrderEqu> equList = equOrderEquMapper.selectEquOrderEquListByParentCode(order.getOrderCode());
for (EquOrderEqu equ : equList) {
List<EquOrderDetail> detailList = equOrderDetailMapper.selectEquOrderDetailByParentCode(equ.getCode());
for (EquOrderDetail detail : detailList) {
List<EquOrderStandard> standardList = equOrderStandardMapper.selectEquOrderStandardByParentCode(detail.getCode());
detail.setStandardList(standardList);
}
equ.setDetailList(detailList);
}
// TODO 人员信息
order.setEquList(equList);
return order;
}
/**
@ -53,9 +96,11 @@ public class EquOrderServiceImpl implements IEquOrderService {
*/
@Override
@DS("#header.poolName")
public int insertEquOrder(EquOrder equOrder) {
public AjaxResult insertEquOrder(EquOrder equOrder) {
equOrder.setCreateTime(DateUtils.getNowDate());
return equOrderMapper.insertEquOrder(equOrder);
// TODO 更新标准信息
// TODO 更新工单信息
return success();
}
/**
@ -68,6 +113,10 @@ public class EquOrderServiceImpl implements IEquOrderService {
@DS("#header.poolName")
public int updateEquOrder(EquOrder equOrder) {
equOrder.setUpdateTime(DateUtils.getNowDate());
// TODO 更新标准信息
// TODO 更新工单信息
equOrder.setOrderStart(equOrder.getTimeArray().get(0));
equOrder.setOrderEnd(equOrder.getTimeArray().get(1));
return equOrderMapper.updateEquOrder(equOrder);
}

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.device.mapper.EquOrderDetailMapper">
<resultMap type="EquOrderDetail" id="EquOrderDetailResult">
<result property="id" column="id" />
<result property="code" column="code" />
<result property="orderCode" column="order_code" />
<result property="parentCode" column="parent_code" />
<result property="itemCode" column="item_code" />
<result property="itemName" column="item_name" />
<result property="itemMethod" column="item_method" />
<result property="itemType" column="item_type" />
<result property="itemTypeName" column="item_type_name" />
<result property="factroyCode" column="factroy_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="selectEquOrderDetailVo">
select id, code, order_code, parent_code, item_code, item_name, item_method, item_type, item_type_name, factroy_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time from equ_order_detail
</sql>
<select id="selectEquOrderDetailList" parameterType="EquOrderDetail" resultMap="EquOrderDetailResult">
<include refid="selectEquOrderDetailVo"/>
<where>
<if test="code != null and code != ''"> and code = #{code}</if>
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
<if test="parentCode != null and parentCode != ''"> and parent_code = #{parentCode}</if>
<if test="itemCode != null and itemCode != ''"> and item_code = #{itemCode}</if>
<if test="itemName != null and itemName != ''"> and item_name like concat('%', #{itemName}, '%')</if>
<if test="itemMethod != null and itemMethod != ''"> and item_method = #{itemMethod}</if>
<if test="itemType != null and itemType != ''"> and item_type = #{itemType}</if>
<if test="itemTypeName != null and itemTypeName != ''"> and item_type_name like concat('%', #{itemTypeName}, '%')</if>
<if test="factroyCode != null and factroyCode != ''"> and factroy_code = #{factroyCode}</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>
<select id="selectEquOrderDetailById" parameterType="String" resultMap="EquOrderDetailResult">
<include refid="selectEquOrderDetailVo"/>
where id = #{id}
</select>
<select id="selectEquOrderDetailByParentCode" parameterType="String" resultMap="EquOrderDetailResult">
<include refid="selectEquOrderDetailVo"/>
where parent_code = #{parentCode}
</select>
<insert id="insertEquOrderDetail" parameterType="EquOrderDetail">
insert into equ_order_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="code != null">code,</if>
<if test="orderCode != null">order_code,</if>
<if test="parentCode != null">parent_code,</if>
<if test="itemCode != null">item_code,</if>
<if test="itemName != null">item_name,</if>
<if test="itemMethod != null">item_method,</if>
<if test="itemType != null">item_type,</if>
<if test="itemTypeName != null">item_type_name,</if>
<if test="factroyCode != null and factroyCode != ''">factroy_code,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="code != null">#{code},</if>
<if test="orderCode != null">#{orderCode},</if>
<if test="parentCode != null">#{parentCode},</if>
<if test="itemCode != null">#{itemCode},</if>
<if test="itemName != null">#{itemName},</if>
<if test="itemMethod != null">#{itemMethod},</if>
<if test="itemType != null">#{itemType},</if>
<if test="itemTypeName != null">#{itemTypeName},</if>
<if test="factroyCode != null and factroyCode != ''">#{factroyCode},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateEquOrderDetail" parameterType="EquOrderDetail">
update equ_order_detail
<trim prefix="SET" suffixOverrides=",">
<if test="code != null">code = #{code},</if>
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="parentCode != null">parent_code = #{parentCode},</if>
<if test="itemCode != null">item_code = #{itemCode},</if>
<if test="itemName != null">item_name = #{itemName},</if>
<if test="itemMethod != null">item_method = #{itemMethod},</if>
<if test="itemType != null">item_type = #{itemType},</if>
<if test="itemTypeName != null">item_type_name = #{itemTypeName},</if>
<if test="factroyCode != null and factroyCode != ''">factroy_code = #{factroyCode},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEquOrderDetailById" parameterType="String">
delete from equ_order_detail where id = #{id}
</delete>
<delete id="deleteEquOrderDetailByIds" parameterType="String">
delete from equ_order_detail where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.device.mapper.EquOrderEquMapper">
<resultMap type="EquOrderEqu" id="EquOrderEquResult">
<result property="id" column="id" />
<result property="code" column="code" />
<result property="parentCode" column="parent_code" />
<result property="orderCode" column="order_code" />
<result property="equipmentCode" column="equipment_code" />
<result property="equipmentName" column="equipment_name" />
<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="selectEquOrderEquVo">
select id, code, parent_code, order_code, equipment_code, equipment_name, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time from equ_order_equ
</sql>
<select id="selectEquOrderEquList" parameterType="EquOrderEqu" resultMap="EquOrderEquResult">
<include refid="selectEquOrderEquVo"/>
<where>
<if test="code != null and code != ''"> and code = #{code}</if>
<if test="parentCode != null and parentCode != ''"> and parent_code = #{parentCode}</if>
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
<if test="equipmentCode != null and equipmentCode != ''"> and equipment_code = #{equipmentCode}</if>
<if test="equipmentName != null and equipmentName != ''"> and equipment_name like concat('%', #{equipmentName}, '%')</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>
<select id="selectEquOrderEquById" parameterType="String" resultMap="EquOrderEquResult">
<include refid="selectEquOrderEquVo"/>
where id = #{id}
</select>
<select id="selectEquOrderEquListByParentCode" parameterType="String" resultMap="EquOrderEquResult">
<include refid="selectEquOrderEquVo"/>
where parent_code = #{parentCode}
</select>
<insert id="insertEquOrderEqu" parameterType="EquOrderEqu">
insert into equ_order_equ
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="code != null and code != ''">code,</if>
<if test="parentCode != null and parentCode != ''">parent_code,</if>
<if test="orderCode != null and orderCode != ''">order_code,</if>
<if test="equipmentCode != null and equipmentCode != ''">equipment_code,</if>
<if test="equipmentName != null and equipmentName != ''">equipment_name,</if>
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="code != null and code != ''">#{code},</if>
<if test="parentCode != null and parentCode != ''">#{parentCode},</if>
<if test="orderCode != null and orderCode != ''">#{orderCode},</if>
<if test="equipmentCode != null and equipmentCode != ''">#{equipmentCode},</if>
<if test="equipmentName != null and equipmentName != ''">#{equipmentName},</if>
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateEquOrderEqu" parameterType="EquOrderEqu">
update equ_order_equ
<trim prefix="SET" suffixOverrides=",">
<if test="code != null and code != ''">code = #{code},</if>
<if test="parentCode != null and parentCode != ''">parent_code = #{parentCode},</if>
<if test="orderCode != null and orderCode != ''">order_code = #{orderCode},</if>
<if test="equipmentCode != null and equipmentCode != ''">equipment_code = #{equipmentCode},</if>
<if test="equipmentName != null and equipmentName != ''">equipment_name = #{equipmentName},</if>
<if test="factoryCode != null and factoryCode != ''">factory_code = #{factoryCode},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEquOrderEquById" parameterType="String">
delete from equ_order_equ where id = #{id}
</delete>
<delete id="deleteEquOrderEquByIds" parameterType="String">
delete from equ_order_equ where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -72,9 +72,17 @@
</where>
</select>
<select id="selectEquOrderByOrderId" parameterType="String" resultMap="EquOrderResult">
<select id="selectEquOrderByOrderCode" parameterType="String" resultMap="EquOrderResult">
<include refid="selectEquOrderVo"/>
where order_id = #{orderId}
where order_code = #{orderCode}
</select>
<select id="selectPlanNameByPlanCode" resultType="java.lang.String">
select plan_name AS 'planName' from equ_plan where del_flag = '0' and plan_code = #{orderCode}
</select>
<select id="selectCenterNameByCenterCode" resultType="java.lang.String">
select workshop_name from base_equipment where del_flag = '0' and workshop_code = #{planWorkshop}
</select>
<insert id="insertEquOrder" parameterType="EquOrder">

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.device.mapper.EquOrderPersonMapper">
<resultMap type="EquOrderPerson" id="EquOrderPersonResult">
<result property="id" column="id" />
<result property="orderCode" column="order_code" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<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="selectEquOrderPersonVo">
select id, order_code, user_id, user_name, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time from equ_order_person
</sql>
<select id="selectEquOrderPersonList" parameterType="EquOrderPerson" resultMap="EquOrderPersonResult">
<include refid="selectEquOrderPersonVo"/>
<where>
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</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>
<select id="selectEquOrderPersonById" parameterType="String" resultMap="EquOrderPersonResult">
<include refid="selectEquOrderPersonVo"/>
where id = #{id}
</select>
<insert id="insertEquOrderPerson" parameterType="EquOrderPerson">
insert into equ_order_person
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="orderCode != null">order_code,</if>
<if test="userId != null">user_id,</if>
<if test="userName != null">user_name,</if>
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="orderCode != null">#{orderCode},</if>
<if test="userId != null">#{userId},</if>
<if test="userName != null">#{userName},</if>
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateEquOrderPerson" parameterType="EquOrderPerson">
update equ_order_person
<trim prefix="SET" suffixOverrides=",">
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="userName != null">user_name = #{userName},</if>
<if test="factoryCode != null and factoryCode != ''">factory_code = #{factoryCode},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEquOrderPersonById" parameterType="String">
delete from equ_order_person where id = #{id}
</delete>
<delete id="deleteEquOrderPersonByIds" parameterType="String">
delete from equ_order_person where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

@ -0,0 +1,153 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.device.mapper.EquOrderStandardMapper">
<resultMap type="EquOrderStandard" id="EquOrderStandardResult">
<result property="id" column="id" />
<result property="code" column="code" />
<result property="parentCode" column="parent_code" />
<result property="orderCode" column="order_code" />
<result property="standardType" column="standard_type" />
<result property="standardName" column="standard_name" />
<result property="detailUpLimit" column="detail_up_limit" />
<result property="detailDownLimit" column="detail_down_limit" />
<result property="detailUnit" column="detail_unit" />
<result property="detailReach" column="detail_reach" />
<result property="actualValue" column="actual_value" />
<result property="detailError" column="detail_error" />
<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="selectEquOrderStandardVo">
select id, code, parent_code, order_code, standard_type, standard_name, detail_up_limit, detail_down_limit, detail_unit, detail_reach, actual_value, detail_error, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time from equ_order_standard
</sql>
<select id="selectEquOrderStandardList" parameterType="EquOrderStandard" resultMap="EquOrderStandardResult">
<include refid="selectEquOrderStandardVo"/>
<where>
<if test="code != null and code != ''"> and code = #{code}</if>
<if test="parentCode != null and parentCode != ''"> and parent_code = #{parentCode}</if>
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
<if test="standardType != null and standardType != ''"> and standard_type = #{standardType}</if>
<if test="standardName != null and standardName != ''"> and standard_name like concat('%', #{standardName}, '%')</if>
<if test="detailUpLimit != null "> and detail_up_limit = #{detailUpLimit}</if>
<if test="detailDownLimit != null "> and detail_down_limit = #{detailDownLimit}</if>
<if test="detailUnit != null and detailUnit != ''"> and detail_unit = #{detailUnit}</if>
<if test="detailReach != null and detailReach != ''"> and detail_reach = #{detailReach}</if>
<if test="actualValue != null "> and actual_value = #{actualValue}</if>
<if test="detailError != null and detailError != ''"> and detail_error = #{detailError}</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>
<select id="selectEquOrderStandardById" parameterType="String" resultMap="EquOrderStandardResult">
<include refid="selectEquOrderStandardVo"/>
where id = #{id}
</select>
<select id="selectEquOrderStandardByParentCode" parameterType="String" resultMap="EquOrderStandardResult">
<include refid="selectEquOrderStandardVo"/>
where parent_code = #{parentCode}
</select>
<insert id="insertEquOrderStandard" parameterType="EquOrderStandard">
insert into equ_order_standard
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="code != null">code,</if>
<if test="parentCode != null">parent_code,</if>
<if test="orderCode != null">order_code,</if>
<if test="standardType != null">standard_type,</if>
<if test="standardName != null">standard_name,</if>
<if test="detailUpLimit != null">detail_up_limit,</if>
<if test="detailDownLimit != null">detail_down_limit,</if>
<if test="detailUnit != null">detail_unit,</if>
<if test="detailReach != null">detail_reach,</if>
<if test="actualValue != null">actual_value,</if>
<if test="detailError != null">detail_error,</if>
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="delFlag != null and delFlag != ''">del_flag,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="code != null">#{code},</if>
<if test="parentCode != null">#{parentCode},</if>
<if test="orderCode != null">#{orderCode},</if>
<if test="standardType != null">#{standardType},</if>
<if test="standardName != null">#{standardName},</if>
<if test="detailUpLimit != null">#{detailUpLimit},</if>
<if test="detailDownLimit != null">#{detailDownLimit},</if>
<if test="detailUnit != null">#{detailUnit},</if>
<if test="detailReach != null">#{detailReach},</if>
<if test="actualValue != null">#{actualValue},</if>
<if test="detailError != null">#{detailError},</if>
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="delFlag != null and delFlag != ''">#{delFlag},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateEquOrderStandard" parameterType="EquOrderStandard">
update equ_order_standard
<trim prefix="SET" suffixOverrides=",">
<if test="code != null">code = #{code},</if>
<if test="parentCode != null">parent_code = #{parentCode},</if>
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="standardType != null">standard_type = #{standardType},</if>
<if test="standardName != null">standard_name = #{standardName},</if>
<if test="detailUpLimit != null">detail_up_limit = #{detailUpLimit},</if>
<if test="detailDownLimit != null">detail_down_limit = #{detailDownLimit},</if>
<if test="detailUnit != null">detail_unit = #{detailUnit},</if>
<if test="detailReach != null">detail_reach = #{detailReach},</if>
<if test="actualValue != null">actual_value = #{actualValue},</if>
<if test="detailError != null">detail_error = #{detailError},</if>
<if test="factoryCode != null and factoryCode != ''">factory_code = #{factoryCode},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteEquOrderStandardById" parameterType="String">
delete from equ_order_standard where id = #{id}
</delete>
<delete id="deleteEquOrderStandardByIds" parameterType="String">
delete from equ_order_standard where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save