来料检验单行的缺陷信息
This commit is contained in:
parent
2ce6915d28
commit
41946e7493
@ -8,9 +8,7 @@ import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.mes.qc.domain.QcIqcLine;
|
||||
import com.ktg.mes.qc.domain.QcTemplateIndex;
|
||||
import com.ktg.mes.qc.domain.QcTemplateProduct;
|
||||
import com.ktg.mes.qc.service.IQcIqcLineService;
|
||||
import com.ktg.mes.qc.service.IQcTemplateIndexService;
|
||||
import com.ktg.mes.qc.service.IQcTemplateProductService;
|
||||
import com.ktg.mes.qc.service.*;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -27,7 +25,6 @@ import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.mes.qc.domain.QcIqc;
|
||||
import com.ktg.mes.qc.service.IQcIqcService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
@ -53,6 +50,9 @@ public class QcIqcController extends BaseController
|
||||
@Autowired
|
||||
private IQcIqcLineService qcIqcLineService;
|
||||
|
||||
@Autowired
|
||||
private IQcIqcDefectService qcIqcDefectService;
|
||||
|
||||
/**
|
||||
* 查询来料检验单列表
|
||||
*/
|
||||
@ -137,6 +137,7 @@ public class QcIqcController extends BaseController
|
||||
return AjaxResult.error("当前产品未配置检测模板!");
|
||||
}
|
||||
qcIqcLineService.deleteByIqcId(qcIqc.getIqcId());
|
||||
qcIqcDefectService.deleteByIqcId(qcIqc.getIqcId());
|
||||
int ret = qcIqcService.updateQcIqc(qcIqc);
|
||||
generateLine(qcIqc);
|
||||
return toAjax(ret);
|
||||
@ -154,6 +155,7 @@ public class QcIqcController extends BaseController
|
||||
for (Long iqcId:iqcIds
|
||||
) {
|
||||
qcIqcLineService.deleteByIqcId(iqcId);
|
||||
qcIqcDefectService.deleteByIqcId(iqcId);
|
||||
}
|
||||
return toAjax(qcIqcService.deleteQcIqcByIqcIds(iqcIds));
|
||||
}
|
||||
|
@ -0,0 +1,104 @@
|
||||
package com.ktg.mes.qc.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
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.qc.domain.QcIqcDefect;
|
||||
import com.ktg.mes.qc.service.IQcIqcDefectService;
|
||||
import com.ktg.common.utils.poi.ExcelUtil;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 来料检验单缺陷记录Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-19
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/qc/iqcdefect")
|
||||
public class QcIqcDefectController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IQcIqcDefectService qcIqcDefectService;
|
||||
|
||||
/**
|
||||
* 查询来料检验单缺陷记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:qc:iqcdefect:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(QcIqcDefect qcIqcDefect)
|
||||
{
|
||||
startPage();
|
||||
List<QcIqcDefect> list = qcIqcDefectService.selectQcIqcDefectList(qcIqcDefect);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出来料检验单缺陷记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:qc:iqcdefect:export')")
|
||||
@Log(title = "来料检验单缺陷记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, QcIqcDefect qcIqcDefect)
|
||||
{
|
||||
List<QcIqcDefect> list = qcIqcDefectService.selectQcIqcDefectList(qcIqcDefect);
|
||||
ExcelUtil<QcIqcDefect> util = new ExcelUtil<QcIqcDefect>(QcIqcDefect.class);
|
||||
util.exportExcel(response, list, "来料检验单缺陷记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取来料检验单缺陷记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:qc:iqcdefect:query')")
|
||||
@GetMapping(value = "/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
|
||||
{
|
||||
return AjaxResult.success(qcIqcDefectService.selectQcIqcDefectByRecordId(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增来料检验单缺陷记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:qc:iqcdefect:add')")
|
||||
@Log(title = "来料检验单缺陷记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody QcIqcDefect qcIqcDefect)
|
||||
{
|
||||
return toAjax(qcIqcDefectService.insertQcIqcDefect(qcIqcDefect));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改来料检验单缺陷记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:qc:iqcdefect:edit')")
|
||||
@Log(title = "来料检验单缺陷记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody QcIqcDefect qcIqcDefect)
|
||||
{
|
||||
return toAjax(qcIqcDefectService.updateQcIqcDefect(qcIqcDefect));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除来料检验单缺陷记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mes:qc:iqcdefect:remove')")
|
||||
@Log(title = "来料检验单缺陷记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] recordIds)
|
||||
{
|
||||
return toAjax(qcIqcDefectService.deleteQcIqcDefectByRecordIds(recordIds));
|
||||
}
|
||||
}
|
164
ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcIqcDefect.java
Normal file
164
ktg-mes/src/main/java/com/ktg/mes/qc/domain/QcIqcDefect.java
Normal file
@ -0,0 +1,164 @@
|
||||
package com.ktg.mes.qc.domain;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 来料检验单缺陷记录对象 qc_iqc_defect
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-19
|
||||
*/
|
||||
public class QcIqcDefect extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 缺陷ID */
|
||||
private Long recordId;
|
||||
|
||||
/** 来料检验单ID */
|
||||
@Excel(name = "来料检验单ID")
|
||||
private Long iqcId;
|
||||
|
||||
/** 来料检验单行ID */
|
||||
@Excel(name = "来料检验单行ID")
|
||||
private Long lineId;
|
||||
|
||||
/** 缺陷描述 */
|
||||
@Excel(name = "缺陷描述")
|
||||
private String defectName;
|
||||
|
||||
/** 缺陷等级 */
|
||||
@Excel(name = "缺陷等级")
|
||||
private String defectLevel;
|
||||
|
||||
/** 缺陷数量 */
|
||||
@Excel(name = "缺陷数量")
|
||||
private Long defectQuantity;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
public void setRecordId(Long recordId)
|
||||
{
|
||||
this.recordId = recordId;
|
||||
}
|
||||
|
||||
public Long getRecordId()
|
||||
{
|
||||
return recordId;
|
||||
}
|
||||
public void setIqcId(Long iqcId)
|
||||
{
|
||||
this.iqcId = iqcId;
|
||||
}
|
||||
|
||||
public Long getIqcId()
|
||||
{
|
||||
return iqcId;
|
||||
}
|
||||
public void setLineId(Long lineId)
|
||||
{
|
||||
this.lineId = lineId;
|
||||
}
|
||||
|
||||
public Long getLineId()
|
||||
{
|
||||
return lineId;
|
||||
}
|
||||
public void setDefectName(String defectName)
|
||||
{
|
||||
this.defectName = defectName;
|
||||
}
|
||||
|
||||
public String getDefectName()
|
||||
{
|
||||
return defectName;
|
||||
}
|
||||
public void setDefectLevel(String defectLevel)
|
||||
{
|
||||
this.defectLevel = defectLevel;
|
||||
}
|
||||
|
||||
public String getDefectLevel()
|
||||
{
|
||||
return defectLevel;
|
||||
}
|
||||
public void setDefectQuantity(Long defectQuantity)
|
||||
{
|
||||
this.defectQuantity = defectQuantity;
|
||||
}
|
||||
|
||||
public Long getDefectQuantity()
|
||||
{
|
||||
return defectQuantity;
|
||||
}
|
||||
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("recordId", getRecordId())
|
||||
.append("iqcId", getIqcId())
|
||||
.append("lineId", getLineId())
|
||||
.append("defectName", getDefectName())
|
||||
.append("defectLevel", getDefectLevel())
|
||||
.append("defectQuantity", getDefectQuantity())
|
||||
.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.qc.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.qc.domain.QcIqcDefect;
|
||||
|
||||
/**
|
||||
* 来料检验单缺陷记录Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-19
|
||||
*/
|
||||
public interface QcIqcDefectMapper
|
||||
{
|
||||
/**
|
||||
* 查询来料检验单缺陷记录
|
||||
*
|
||||
* @param recordId 来料检验单缺陷记录主键
|
||||
* @return 来料检验单缺陷记录
|
||||
*/
|
||||
public QcIqcDefect selectQcIqcDefectByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询来料检验单缺陷记录列表
|
||||
*
|
||||
* @param qcIqcDefect 来料检验单缺陷记录
|
||||
* @return 来料检验单缺陷记录集合
|
||||
*/
|
||||
public List<QcIqcDefect> selectQcIqcDefectList(QcIqcDefect qcIqcDefect);
|
||||
|
||||
/**
|
||||
* 新增来料检验单缺陷记录
|
||||
*
|
||||
* @param qcIqcDefect 来料检验单缺陷记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertQcIqcDefect(QcIqcDefect qcIqcDefect);
|
||||
|
||||
/**
|
||||
* 修改来料检验单缺陷记录
|
||||
*
|
||||
* @param qcIqcDefect 来料检验单缺陷记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateQcIqcDefect(QcIqcDefect qcIqcDefect);
|
||||
|
||||
/**
|
||||
* 删除来料检验单缺陷记录
|
||||
*
|
||||
* @param recordId 来料检验单缺陷记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcIqcDefectByRecordId(Long recordId);
|
||||
|
||||
|
||||
public int deleteByIqcId(Long iqcId);
|
||||
|
||||
/**
|
||||
* 批量删除来料检验单缺陷记录
|
||||
*
|
||||
* @param recordIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcIqcDefectByRecordIds(Long[] recordIds);
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.ktg.mes.qc.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.mes.qc.domain.QcIqcDefect;
|
||||
|
||||
/**
|
||||
* 来料检验单缺陷记录Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-19
|
||||
*/
|
||||
public interface IQcIqcDefectService
|
||||
{
|
||||
/**
|
||||
* 查询来料检验单缺陷记录
|
||||
*
|
||||
* @param recordId 来料检验单缺陷记录主键
|
||||
* @return 来料检验单缺陷记录
|
||||
*/
|
||||
public QcIqcDefect selectQcIqcDefectByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询来料检验单缺陷记录列表
|
||||
*
|
||||
* @param qcIqcDefect 来料检验单缺陷记录
|
||||
* @return 来料检验单缺陷记录集合
|
||||
*/
|
||||
public List<QcIqcDefect> selectQcIqcDefectList(QcIqcDefect qcIqcDefect);
|
||||
|
||||
/**
|
||||
* 新增来料检验单缺陷记录
|
||||
*
|
||||
* @param qcIqcDefect 来料检验单缺陷记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertQcIqcDefect(QcIqcDefect qcIqcDefect);
|
||||
|
||||
/**
|
||||
* 修改来料检验单缺陷记录
|
||||
*
|
||||
* @param qcIqcDefect 来料检验单缺陷记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateQcIqcDefect(QcIqcDefect qcIqcDefect);
|
||||
|
||||
/**
|
||||
* 批量删除来料检验单缺陷记录
|
||||
*
|
||||
* @param recordIds 需要删除的来料检验单缺陷记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcIqcDefectByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除来料检验单下所有缺陷记录
|
||||
* @param iqcID
|
||||
* @return
|
||||
*/
|
||||
public int deleteByIqcId(Long iqcID);
|
||||
|
||||
/**
|
||||
* 删除来料检验单缺陷记录信息
|
||||
*
|
||||
* @param recordId 来料检验单缺陷记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcIqcDefectByRecordId(Long recordId);
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package com.ktg.mes.qc.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ktg.mes.qc.mapper.QcIqcDefectMapper;
|
||||
import com.ktg.mes.qc.domain.QcIqcDefect;
|
||||
import com.ktg.mes.qc.service.IQcIqcDefectService;
|
||||
|
||||
/**
|
||||
* 来料检验单缺陷记录Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-19
|
||||
*/
|
||||
@Service
|
||||
public class QcIqcDefectServiceImpl implements IQcIqcDefectService
|
||||
{
|
||||
@Autowired
|
||||
private QcIqcDefectMapper qcIqcDefectMapper;
|
||||
|
||||
/**
|
||||
* 查询来料检验单缺陷记录
|
||||
*
|
||||
* @param recordId 来料检验单缺陷记录主键
|
||||
* @return 来料检验单缺陷记录
|
||||
*/
|
||||
@Override
|
||||
public QcIqcDefect selectQcIqcDefectByRecordId(Long recordId)
|
||||
{
|
||||
return qcIqcDefectMapper.selectQcIqcDefectByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询来料检验单缺陷记录列表
|
||||
*
|
||||
* @param qcIqcDefect 来料检验单缺陷记录
|
||||
* @return 来料检验单缺陷记录
|
||||
*/
|
||||
@Override
|
||||
public List<QcIqcDefect> selectQcIqcDefectList(QcIqcDefect qcIqcDefect)
|
||||
{
|
||||
return qcIqcDefectMapper.selectQcIqcDefectList(qcIqcDefect);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增来料检验单缺陷记录
|
||||
*
|
||||
* @param qcIqcDefect 来料检验单缺陷记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertQcIqcDefect(QcIqcDefect qcIqcDefect)
|
||||
{
|
||||
qcIqcDefect.setCreateTime(DateUtils.getNowDate());
|
||||
return qcIqcDefectMapper.insertQcIqcDefect(qcIqcDefect);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改来料检验单缺陷记录
|
||||
*
|
||||
* @param qcIqcDefect 来料检验单缺陷记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateQcIqcDefect(QcIqcDefect qcIqcDefect)
|
||||
{
|
||||
qcIqcDefect.setUpdateTime(DateUtils.getNowDate());
|
||||
return qcIqcDefectMapper.updateQcIqcDefect(qcIqcDefect);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除来料检验单缺陷记录
|
||||
*
|
||||
* @param recordIds 需要删除的来料检验单缺陷记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteQcIqcDefectByRecordIds(Long[] recordIds)
|
||||
{
|
||||
return qcIqcDefectMapper.deleteQcIqcDefectByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByIqcId(Long iqcID) {
|
||||
return qcIqcDefectMapper.deleteByIqcId(iqcID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除来料检验单缺陷记录信息
|
||||
*
|
||||
* @param recordId 来料检验单缺陷记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteQcIqcDefectByRecordId(Long recordId)
|
||||
{
|
||||
return qcIqcDefectMapper.deleteQcIqcDefectByRecordId(recordId);
|
||||
}
|
||||
}
|
116
ktg-mes/src/main/resources/mapper/qc/QcIqcDefectMapper.xml
Normal file
116
ktg-mes/src/main/resources/mapper/qc/QcIqcDefectMapper.xml
Normal file
@ -0,0 +1,116 @@
|
||||
<?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.qc.mapper.QcIqcDefectMapper">
|
||||
|
||||
<resultMap type="QcIqcDefect" id="QcIqcDefectResult">
|
||||
<result property="recordId" column="record_id" />
|
||||
<result property="iqcId" column="iqc_id" />
|
||||
<result property="lineId" column="line_id" />
|
||||
<result property="defectName" column="defect_name" />
|
||||
<result property="defectLevel" column="defect_level" />
|
||||
<result property="defectQuantity" column="defect_quantity" />
|
||||
<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="selectQcIqcDefectVo">
|
||||
select record_id, iqc_id, line_id, defect_name, defect_level, defect_quantity, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from qc_iqc_defect
|
||||
</sql>
|
||||
|
||||
<select id="selectQcIqcDefectList" parameterType="QcIqcDefect" resultMap="QcIqcDefectResult">
|
||||
<include refid="selectQcIqcDefectVo"/>
|
||||
<where>
|
||||
<if test="iqcId != null "> and iqc_id = #{iqcId}</if>
|
||||
<if test="lineId != null "> and line_id = #{lineId}</if>
|
||||
<if test="defectName != null and defectName != ''"> and defect_name like concat('%', #{defectName}, '%')</if>
|
||||
<if test="defectLevel != null and defectLevel != ''"> and defect_level = #{defectLevel}</if>
|
||||
<if test="defectQuantity != null "> and defect_quantity = #{defectQuantity}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectQcIqcDefectByRecordId" parameterType="Long" resultMap="QcIqcDefectResult">
|
||||
<include refid="selectQcIqcDefectVo"/>
|
||||
where record_id = #{recordId}
|
||||
</select>
|
||||
|
||||
<insert id="insertQcIqcDefect" parameterType="QcIqcDefect" useGeneratedKeys="true" keyProperty="recordId">
|
||||
insert into qc_iqc_defect
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="iqcId != null">iqc_id,</if>
|
||||
<if test="lineId != null">line_id,</if>
|
||||
<if test="defectName != null and defectName != ''">defect_name,</if>
|
||||
<if test="defectLevel != null and defectLevel != ''">defect_level,</if>
|
||||
<if test="defectQuantity != null">defect_quantity,</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="iqcId != null">#{iqcId},</if>
|
||||
<if test="lineId != null">#{lineId},</if>
|
||||
<if test="defectName != null and defectName != ''">#{defectName},</if>
|
||||
<if test="defectLevel != null and defectLevel != ''">#{defectLevel},</if>
|
||||
<if test="defectQuantity != null">#{defectQuantity},</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="updateQcIqcDefect" parameterType="QcIqcDefect">
|
||||
update qc_iqc_defect
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="iqcId != null">iqc_id = #{iqcId},</if>
|
||||
<if test="lineId != null">line_id = #{lineId},</if>
|
||||
<if test="defectName != null and defectName != ''">defect_name = #{defectName},</if>
|
||||
<if test="defectLevel != null and defectLevel != ''">defect_level = #{defectLevel},</if>
|
||||
<if test="defectQuantity != null">defect_quantity = #{defectQuantity},</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 record_id = #{recordId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteQcIqcDefectByRecordId" parameterType="Long">
|
||||
delete from qc_iqc_defect where record_id = #{recordId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByIqcId" parameterType="Long">
|
||||
delete from qc_iqc_defect where iqc_id = #{iqcId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteQcIqcDefectByRecordIds" parameterType="String">
|
||||
delete from qc_iqc_defect where record_id in
|
||||
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
||||
#{recordId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user