设备维修单后台代码
This commit is contained in:
parent
5c5b2ccedf
commit
f4ee5f2f46
@ -0,0 +1,112 @@
|
||||
package com.ktg.mes.dv.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.mes.dv.domain.DvRepair;
|
||||
import com.ktg.mes.dv.service.IDvRepairService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 设备维修单Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/repair")
|
||||
public class DvRepairController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDvRepairService dvRepairService;
|
||||
|
||||
/**
|
||||
* 查询设备维修单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:repair:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvRepair dvRepair)
|
||||
{
|
||||
startPage();
|
||||
List<DvRepair> list = dvRepairService.selectDvRepairList(dvRepair);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备维修单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:repair:export')")
|
||||
@Log(title = "设备维修单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DvRepair dvRepair)
|
||||
{
|
||||
List<DvRepair> list = dvRepairService.selectDvRepairList(dvRepair);
|
||||
ExcelUtil<DvRepair> util = new ExcelUtil<DvRepair>(DvRepair.class);
|
||||
util.exportExcel(response, list, "设备维修单数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备维修单详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:repair:query')")
|
||||
@GetMapping(value = "/{repairId}")
|
||||
public AjaxResult getInfo(@PathVariable("repairId") Long repairId)
|
||||
{
|
||||
return AjaxResult.success(dvRepairService.selectDvRepairByRepairId(repairId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备维修单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('dv:repair:add')")
|
||||
@Log(title = "设备维修单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DvRepair dvRepair)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvRepairService.checkCodeUnique(dvRepair))){
|
||||
return AjaxResult.error("维修单编号已存!");
|
||||
}
|
||||
return toAjax(dvRepairService.insertDvRepair(dvRepair));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备维修单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:repair:edit')")
|
||||
@Log(title = "设备维修单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DvRepair dvRepair)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvRepairService.checkCodeUnique(dvRepair))){
|
||||
return AjaxResult.error("维修单编号已存!");
|
||||
}
|
||||
return toAjax(dvRepairService.updateDvRepair(dvRepair));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备维修单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:dv:repair:remove')")
|
||||
@Log(title = "设备维修单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{repairIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] repairIds)
|
||||
{
|
||||
return toAjax(dvRepairService.deleteDvRepairByRepairIds(repairIds));
|
||||
}
|
||||
}
|
309
ktg-mes/src/main/java/com/ktg/mes/dv/domain/DvRepair.java
Normal file
309
ktg-mes/src/main/java/com/ktg/mes/dv/domain/DvRepair.java
Normal file
@ -0,0 +1,309 @@
|
||||
package com.ktg.mes.dv.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ktg.common.annotation.Excel;
|
||||
import com.ktg.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 设备维修单对象 dv_repair
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-06
|
||||
*/
|
||||
public class DvRepair extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 维修单ID */
|
||||
private Long repairId;
|
||||
|
||||
/** 维修单编号 */
|
||||
@Excel(name = "维修单编号")
|
||||
private String repairCode;
|
||||
|
||||
/** 维修单名称 */
|
||||
@Excel(name = "维修单名称")
|
||||
private String repairName;
|
||||
|
||||
/** 设备ID */
|
||||
@Excel(name = "设备ID")
|
||||
private Long machineryId;
|
||||
|
||||
/** 设备编码 */
|
||||
@Excel(name = "设备编码")
|
||||
private String machineryCode;
|
||||
|
||||
/** 设备名称 */
|
||||
@Excel(name = "设备名称")
|
||||
private String machineryName;
|
||||
|
||||
/** 品牌 */
|
||||
@Excel(name = "品牌")
|
||||
private String machineryBrand;
|
||||
|
||||
/** 规格型号 */
|
||||
@Excel(name = "规格型号")
|
||||
private String machinerySpec;
|
||||
|
||||
/** 设备类型ID */
|
||||
@Excel(name = "设备类型ID")
|
||||
private Long machineryTypeId;
|
||||
|
||||
/** 报修日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "报修日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date requireDate;
|
||||
|
||||
/** 维修完成日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "维修完成日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date finishDate;
|
||||
|
||||
/** 验收日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "验收日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date confirmDate;
|
||||
|
||||
/** 维修结果 */
|
||||
@Excel(name = "维修结果")
|
||||
private String repairResult;
|
||||
|
||||
/** 维修人员 */
|
||||
@Excel(name = "维修人员")
|
||||
private String acceptedBy;
|
||||
|
||||
/** 验收人员 */
|
||||
@Excel(name = "验收人员")
|
||||
private String confirmBy;
|
||||
|
||||
/** 单据状态 */
|
||||
@Excel(name = "单据状态")
|
||||
private String status;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setRepairId(Long repairId)
|
||||
{
|
||||
this.repairId = repairId;
|
||||
}
|
||||
|
||||
public Long getRepairId()
|
||||
{
|
||||
return repairId;
|
||||
}
|
||||
public void setRepairCode(String repairCode)
|
||||
{
|
||||
this.repairCode = repairCode;
|
||||
}
|
||||
|
||||
public String getRepairCode()
|
||||
{
|
||||
return repairCode;
|
||||
}
|
||||
public void setRepairName(String repairName)
|
||||
{
|
||||
this.repairName = repairName;
|
||||
}
|
||||
|
||||
public String getRepairName()
|
||||
{
|
||||
return repairName;
|
||||
}
|
||||
public void setMachineryId(Long machineryId)
|
||||
{
|
||||
this.machineryId = machineryId;
|
||||
}
|
||||
|
||||
public Long getMachineryId()
|
||||
{
|
||||
return machineryId;
|
||||
}
|
||||
public void setMachineryCode(String machineryCode)
|
||||
{
|
||||
this.machineryCode = machineryCode;
|
||||
}
|
||||
|
||||
public String getMachineryCode()
|
||||
{
|
||||
return machineryCode;
|
||||
}
|
||||
public void setMachineryName(String machineryName)
|
||||
{
|
||||
this.machineryName = machineryName;
|
||||
}
|
||||
|
||||
public String getMachineryName()
|
||||
{
|
||||
return machineryName;
|
||||
}
|
||||
public void setMachineryBrand(String machineryBrand)
|
||||
{
|
||||
this.machineryBrand = machineryBrand;
|
||||
}
|
||||
|
||||
public String getMachineryBrand()
|
||||
{
|
||||
return machineryBrand;
|
||||
}
|
||||
public void setMachinerySpec(String machinerySpec)
|
||||
{
|
||||
this.machinerySpec = machinerySpec;
|
||||
}
|
||||
|
||||
public String getMachinerySpec()
|
||||
{
|
||||
return machinerySpec;
|
||||
}
|
||||
public void setMachineryTypeId(Long machineryTypeId)
|
||||
{
|
||||
this.machineryTypeId = machineryTypeId;
|
||||
}
|
||||
|
||||
public Long getMachineryTypeId()
|
||||
{
|
||||
return machineryTypeId;
|
||||
}
|
||||
public void setRequireDate(Date requireDate)
|
||||
{
|
||||
this.requireDate = requireDate;
|
||||
}
|
||||
|
||||
public Date getRequireDate()
|
||||
{
|
||||
return requireDate;
|
||||
}
|
||||
public void setFinishDate(Date finishDate)
|
||||
{
|
||||
this.finishDate = finishDate;
|
||||
}
|
||||
|
||||
public Date getFinishDate()
|
||||
{
|
||||
return finishDate;
|
||||
}
|
||||
public void setConfirmDate(Date confirmDate)
|
||||
{
|
||||
this.confirmDate = confirmDate;
|
||||
}
|
||||
|
||||
public Date getConfirmDate()
|
||||
{
|
||||
return confirmDate;
|
||||
}
|
||||
public void setRepairResult(String repairResult)
|
||||
{
|
||||
this.repairResult = repairResult;
|
||||
}
|
||||
|
||||
public String getRepairResult()
|
||||
{
|
||||
return repairResult;
|
||||
}
|
||||
public void setAcceptedBy(String acceptedBy)
|
||||
{
|
||||
this.acceptedBy = acceptedBy;
|
||||
}
|
||||
|
||||
public String getAcceptedBy()
|
||||
{
|
||||
return acceptedBy;
|
||||
}
|
||||
public void setConfirmBy(String confirmBy)
|
||||
{
|
||||
this.confirmBy = confirmBy;
|
||||
}
|
||||
|
||||
public String getConfirmBy()
|
||||
{
|
||||
return confirmBy;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
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(Long attr3)
|
||||
{
|
||||
this.attr3 = attr3;
|
||||
}
|
||||
|
||||
public Long getAttr3()
|
||||
{
|
||||
return attr3;
|
||||
}
|
||||
public void setAttr4(Long attr4)
|
||||
{
|
||||
this.attr4 = attr4;
|
||||
}
|
||||
|
||||
public Long getAttr4()
|
||||
{
|
||||
return attr4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("repairId", getRepairId())
|
||||
.append("repairCode", getRepairCode())
|
||||
.append("repairName", getRepairName())
|
||||
.append("machineryId", getMachineryId())
|
||||
.append("machineryCode", getMachineryCode())
|
||||
.append("machineryName", getMachineryName())
|
||||
.append("machineryBrand", getMachineryBrand())
|
||||
.append("machinerySpec", getMachinerySpec())
|
||||
.append("machineryTypeId", getMachineryTypeId())
|
||||
.append("requireDate", getRequireDate())
|
||||
.append("finishDate", getFinishDate())
|
||||
.append("confirmDate", getConfirmDate())
|
||||
.append("repairResult", getRepairResult())
|
||||
.append("acceptedBy", getAcceptedBy())
|
||||
.append("confirmBy", getConfirmBy())
|
||||
.append("status", getStatus())
|
||||
.append("remark", getRemark())
|
||||
.append("attr1", getAttr1())
|
||||
.append("attr2", getAttr2())
|
||||
.append("attr3", getAttr3())
|
||||
.append("attr4", getAttr4())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.ktg.mes.dv.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.dv.domain.DvRepair;
|
||||
|
||||
/**
|
||||
* 设备维修单Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-06
|
||||
*/
|
||||
public interface DvRepairMapper
|
||||
{
|
||||
/**
|
||||
* 查询设备维修单
|
||||
*
|
||||
* @param repairId 设备维修单主键
|
||||
* @return 设备维修单
|
||||
*/
|
||||
public DvRepair selectDvRepairByRepairId(Long repairId);
|
||||
|
||||
/**
|
||||
* 查询设备维修单列表
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 设备维修单集合
|
||||
*/
|
||||
public List<DvRepair> selectDvRepairList(DvRepair dvRepair);
|
||||
|
||||
public DvRepair checkCodeUnique(DvRepair dvRepair);
|
||||
|
||||
|
||||
/**
|
||||
* 新增设备维修单
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvRepair(DvRepair dvRepair);
|
||||
|
||||
/**
|
||||
* 修改设备维修单
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvRepair(DvRepair dvRepair);
|
||||
|
||||
/**
|
||||
* 删除设备维修单
|
||||
*
|
||||
* @param repairId 设备维修单主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvRepairByRepairId(Long repairId);
|
||||
|
||||
/**
|
||||
* 批量删除设备维修单
|
||||
*
|
||||
* @param repairIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvRepairByRepairIds(Long[] repairIds);
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.ktg.mes.dv.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.dv.domain.DvRepair;
|
||||
|
||||
/**
|
||||
* 设备维修单Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-06
|
||||
*/
|
||||
public interface IDvRepairService
|
||||
{
|
||||
/**
|
||||
* 查询设备维修单
|
||||
*
|
||||
* @param repairId 设备维修单主键
|
||||
* @return 设备维修单
|
||||
*/
|
||||
public DvRepair selectDvRepairByRepairId(Long repairId);
|
||||
|
||||
/**
|
||||
* 查询设备维修单列表
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 设备维修单集合
|
||||
*/
|
||||
public List<DvRepair> selectDvRepairList(DvRepair dvRepair);
|
||||
|
||||
/**
|
||||
* 检测维修单编号是否唯一
|
||||
* @param dvRepair
|
||||
* @return
|
||||
*/
|
||||
public String checkCodeUnique(DvRepair dvRepair);
|
||||
|
||||
/**
|
||||
* 新增设备维修单
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvRepair(DvRepair dvRepair);
|
||||
|
||||
/**
|
||||
* 修改设备维修单
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvRepair(DvRepair dvRepair);
|
||||
|
||||
/**
|
||||
* 批量删除设备维修单
|
||||
*
|
||||
* @param repairIds 需要删除的设备维修单主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvRepairByRepairIds(Long[] repairIds);
|
||||
|
||||
/**
|
||||
* 删除设备维修单信息
|
||||
*
|
||||
* @param repairId 设备维修单主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvRepairByRepairId(Long repairId);
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
package com.ktg.mes.dv.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.dv.mapper.DvRepairMapper;
|
||||
import com.ktg.mes.dv.domain.DvRepair;
|
||||
import com.ktg.mes.dv.service.IDvRepairService;
|
||||
|
||||
/**
|
||||
* 设备维修单Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-06
|
||||
*/
|
||||
@Service
|
||||
public class DvRepairServiceImpl implements IDvRepairService
|
||||
{
|
||||
@Autowired
|
||||
private DvRepairMapper dvRepairMapper;
|
||||
|
||||
/**
|
||||
* 查询设备维修单
|
||||
*
|
||||
* @param repairId 设备维修单主键
|
||||
* @return 设备维修单
|
||||
*/
|
||||
@Override
|
||||
public DvRepair selectDvRepairByRepairId(Long repairId)
|
||||
{
|
||||
return dvRepairMapper.selectDvRepairByRepairId(repairId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备维修单列表
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 设备维修单
|
||||
*/
|
||||
@Override
|
||||
public List<DvRepair> selectDvRepairList(DvRepair dvRepair)
|
||||
{
|
||||
return dvRepairMapper.selectDvRepairList(dvRepair);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkCodeUnique(DvRepair dvRepair) {
|
||||
DvRepair rp = dvRepairMapper.checkCodeUnique(dvRepair);
|
||||
Long repairId = dvRepair.getRepairId() ==null?-1L: dvRepair.getRepairId();
|
||||
if(StringUtils.isNotNull(rp) && repairId.longValue() != rp.getRepairId().longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备维修单
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDvRepair(DvRepair dvRepair)
|
||||
{
|
||||
dvRepair.setCreateTime(DateUtils.getNowDate());
|
||||
return dvRepairMapper.insertDvRepair(dvRepair);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备维修单
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDvRepair(DvRepair dvRepair)
|
||||
{
|
||||
dvRepair.setUpdateTime(DateUtils.getNowDate());
|
||||
return dvRepairMapper.updateDvRepair(dvRepair);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备维修单
|
||||
*
|
||||
* @param repairIds 需要删除的设备维修单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvRepairByRepairIds(Long[] repairIds)
|
||||
{
|
||||
return dvRepairMapper.deleteDvRepairByRepairIds(repairIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备维修单信息
|
||||
*
|
||||
* @param repairId 设备维修单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvRepairByRepairId(Long repairId)
|
||||
{
|
||||
return dvRepairMapper.deleteDvRepairByRepairId(repairId);
|
||||
}
|
||||
}
|
167
ktg-mes/src/main/resources/mapper/dv/DvRepairMapper.xml
Normal file
167
ktg-mes/src/main/resources/mapper/dv/DvRepairMapper.xml
Normal file
@ -0,0 +1,167 @@
|
||||
<?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.ktg.mes.dv.mapper.DvRepairMapper">
|
||||
|
||||
<resultMap type="DvRepair" id="DvRepairResult">
|
||||
<result property="repairId" column="repair_id" />
|
||||
<result property="repairCode" column="repair_code" />
|
||||
<result property="repairName" column="repair_name" />
|
||||
<result property="machineryId" column="machinery_id" />
|
||||
<result property="machineryCode" column="machinery_code" />
|
||||
<result property="machineryName" column="machinery_name" />
|
||||
<result property="machineryBrand" column="machinery_brand" />
|
||||
<result property="machinerySpec" column="machinery_spec" />
|
||||
<result property="machineryTypeId" column="machinery_type_id" />
|
||||
<result property="requireDate" column="require_date" />
|
||||
<result property="finishDate" column="finish_date" />
|
||||
<result property="confirmDate" column="confirm_date" />
|
||||
<result property="repairResult" column="repair_result" />
|
||||
<result property="acceptedBy" column="accepted_by" />
|
||||
<result property="confirmBy" column="confirm_by" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<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="selectDvRepairVo">
|
||||
select repair_id, repair_code, repair_name, machinery_id, machinery_code, machinery_name, machinery_brand, machinery_spec, machinery_type_id, require_date, finish_date, confirm_date, repair_result, accepted_by, confirm_by, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from dv_repair
|
||||
</sql>
|
||||
|
||||
<select id="selectDvRepairList" parameterType="DvRepair" resultMap="DvRepairResult">
|
||||
<include refid="selectDvRepairVo"/>
|
||||
<where>
|
||||
<if test="repairCode != null and repairCode != ''"> and repair_code = #{repairCode}</if>
|
||||
<if test="repairName != null and repairName != ''"> and repair_name like concat('%', #{repairName}, '%')</if>
|
||||
<if test="machineryId != null "> and machinery_id = #{machineryId}</if>
|
||||
<if test="machineryCode != null and machineryCode != ''"> and machinery_code = #{machineryCode}</if>
|
||||
<if test="machineryName != null and machineryName != ''"> and machinery_name like concat('%', #{machineryName}, '%')</if>
|
||||
<if test="machineryBrand != null and machineryBrand != ''"> and machinery_brand = #{machineryBrand}</if>
|
||||
<if test="machinerySpec != null and machinerySpec != ''"> and machinery_spec = #{machinerySpec}</if>
|
||||
<if test="machineryTypeId != null "> and machinery_type_id = #{machineryTypeId}</if>
|
||||
<if test="requireDate != null "> and require_date = #{requireDate}</if>
|
||||
<if test="finishDate != null "> and finish_date = #{finishDate}</if>
|
||||
<if test="confirmDate != null "> and confirm_date = #{confirmDate}</if>
|
||||
<if test="repairResult != null and repairResult != ''"> and repair_result = #{repairResult}</if>
|
||||
<if test="acceptedBy != null and acceptedBy != ''"> and accepted_by = #{acceptedBy}</if>
|
||||
<if test="confirmBy != null and confirmBy != ''"> and confirm_by = #{confirmBy}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDvRepairByRepairId" parameterType="Long" resultMap="DvRepairResult">
|
||||
<include refid="selectDvRepairVo"/>
|
||||
where repair_id = #{repairId}
|
||||
</select>
|
||||
|
||||
<select id="checkCodeUnique" parameterType="DvRepair" resultMap="DvRepairResult">
|
||||
<include refid="selectDvRepairVo"/>
|
||||
where repair_code = #{repairCode} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertDvRepair" parameterType="DvRepair" useGeneratedKeys="true" keyProperty="repairId">
|
||||
insert into dv_repair
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="repairCode != null and repairCode != ''">repair_code,</if>
|
||||
<if test="repairName != null">repair_name,</if>
|
||||
<if test="machineryId != null">machinery_id,</if>
|
||||
<if test="machineryCode != null and machineryCode != ''">machinery_code,</if>
|
||||
<if test="machineryName != null and machineryName != ''">machinery_name,</if>
|
||||
<if test="machineryBrand != null">machinery_brand,</if>
|
||||
<if test="machinerySpec != null">machinery_spec,</if>
|
||||
<if test="machineryTypeId != null">machinery_type_id,</if>
|
||||
<if test="requireDate != null">require_date,</if>
|
||||
<if test="finishDate != null">finish_date,</if>
|
||||
<if test="confirmDate != null">confirm_date,</if>
|
||||
<if test="repairResult != null">repair_result,</if>
|
||||
<if test="acceptedBy != null">accepted_by,</if>
|
||||
<if test="confirmBy != null">confirm_by,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="repairCode != null and repairCode != ''">#{repairCode},</if>
|
||||
<if test="repairName != null">#{repairName},</if>
|
||||
<if test="machineryId != null">#{machineryId},</if>
|
||||
<if test="machineryCode != null and machineryCode != ''">#{machineryCode},</if>
|
||||
<if test="machineryName != null and machineryName != ''">#{machineryName},</if>
|
||||
<if test="machineryBrand != null">#{machineryBrand},</if>
|
||||
<if test="machinerySpec != null">#{machinerySpec},</if>
|
||||
<if test="machineryTypeId != null">#{machineryTypeId},</if>
|
||||
<if test="requireDate != null">#{requireDate},</if>
|
||||
<if test="finishDate != null">#{finishDate},</if>
|
||||
<if test="confirmDate != null">#{confirmDate},</if>
|
||||
<if test="repairResult != null">#{repairResult},</if>
|
||||
<if test="acceptedBy != null">#{acceptedBy},</if>
|
||||
<if test="confirmBy != null">#{confirmBy},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDvRepair" parameterType="DvRepair">
|
||||
update dv_repair
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="repairCode != null and repairCode != ''">repair_code = #{repairCode},</if>
|
||||
<if test="repairName != null">repair_name = #{repairName},</if>
|
||||
<if test="machineryId != null">machinery_id = #{machineryId},</if>
|
||||
<if test="machineryCode != null and machineryCode != ''">machinery_code = #{machineryCode},</if>
|
||||
<if test="machineryName != null and machineryName != ''">machinery_name = #{machineryName},</if>
|
||||
<if test="machineryBrand != null">machinery_brand = #{machineryBrand},</if>
|
||||
<if test="machinerySpec != null">machinery_spec = #{machinerySpec},</if>
|
||||
<if test="machineryTypeId != null">machinery_type_id = #{machineryTypeId},</if>
|
||||
<if test="requireDate != null">require_date = #{requireDate},</if>
|
||||
<if test="finishDate != null">finish_date = #{finishDate},</if>
|
||||
<if test="confirmDate != null">confirm_date = #{confirmDate},</if>
|
||||
<if test="repairResult != null">repair_result = #{repairResult},</if>
|
||||
<if test="acceptedBy != null">accepted_by = #{acceptedBy},</if>
|
||||
<if test="confirmBy != null">confirm_by = #{confirmBy},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where repair_id = #{repairId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDvRepairByRepairId" parameterType="Long">
|
||||
delete from dv_repair where repair_id = #{repairId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDvRepairByRepairIds" parameterType="String">
|
||||
delete from dv_repair where repair_id in
|
||||
<foreach item="repairId" collection="array" open="(" separator="," close=")">
|
||||
#{repairId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user