过程检验单头信息

This commit is contained in:
JinLu.Yin 2022-08-29 20:30:50 +08:00
parent 923f9a02eb
commit e0a6b9cd79
6 changed files with 1153 additions and 0 deletions

View File

@ -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.QcIpqc;
import com.ktg.mes.qc.service.IQcIpqcService;
import com.ktg.common.utils.poi.ExcelUtil;
import com.ktg.common.core.page.TableDataInfo;
/**
* 过程检验单Controller
*
* @author yinjinlu
* @date 2022-08-29
*/
@RestController
@RequestMapping("/mes/qc/ipqc")
public class QcIpqcController extends BaseController
{
@Autowired
private IQcIpqcService qcIpqcService;
/**
* 查询过程检验单列表
*/
@PreAuthorize("@ss.hasPermi('mes:qc:ipqc:list')")
@GetMapping("/list")
public TableDataInfo list(QcIpqc qcIpqc)
{
startPage();
List<QcIpqc> list = qcIpqcService.selectQcIpqcList(qcIpqc);
return getDataTable(list);
}
/**
* 导出过程检验单列表
*/
@PreAuthorize("@ss.hasPermi('mes:qc:ipqc:export')")
@Log(title = "过程检验单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, QcIpqc qcIpqc)
{
List<QcIpqc> list = qcIpqcService.selectQcIpqcList(qcIpqc);
ExcelUtil<QcIpqc> util = new ExcelUtil<QcIpqc>(QcIpqc.class);
util.exportExcel(response, list, "过程检验单数据");
}
/**
* 获取过程检验单详细信息
*/
@PreAuthorize("@ss.hasPermi('mes:qc:ipqc:query')")
@GetMapping(value = "/{ipqcId}")
public AjaxResult getInfo(@PathVariable("ipqcId") Long ipqcId)
{
return AjaxResult.success(qcIpqcService.selectQcIpqcByIpqcId(ipqcId));
}
/**
* 新增过程检验单
*/
@PreAuthorize("@ss.hasPermi('mes:qc:ipqc:add')")
@Log(title = "过程检验单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody QcIpqc qcIpqc)
{
return toAjax(qcIpqcService.insertQcIpqc(qcIpqc));
}
/**
* 修改过程检验单
*/
@PreAuthorize("@ss.hasPermi('mes:qc:ipqc:edit')")
@Log(title = "过程检验单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody QcIpqc qcIpqc)
{
return toAjax(qcIpqcService.updateQcIpqc(qcIpqc));
}
/**
* 删除过程检验单
*/
@PreAuthorize("@ss.hasPermi('mes:qc:ipqc:remove')")
@Log(title = "过程检验单", businessType = BusinessType.DELETE)
@DeleteMapping("/{ipqcIds}")
public AjaxResult remove(@PathVariable Long[] ipqcIds)
{
return toAjax(qcIpqcService.deleteQcIpqcByIpqcIds(ipqcIds));
}
}

View File

@ -0,0 +1,574 @@
package com.ktg.mes.qc.domain;
import java.math.BigDecimal;
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;
/**
* 过程检验单对象 qc_ipqc
*
* @author yinjinlu
* @date 2022-08-29
*/
public class QcIpqc extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 检验单ID */
private Long ipqcId;
/** 检验单编号 */
@Excel(name = "检验单编号")
private String ipqcCode;
/** 检验单名称 */
@Excel(name = "检验单名称")
private String ipqcName;
/** 检验类型 */
@Excel(name = "检验类型")
private String ipqcType;
/** 检验模板ID */
@Excel(name = "检验模板ID")
private Long templateId;
/** 工单ID */
@Excel(name = "工单ID")
private Long workorderId;
/** 工单编码 */
@Excel(name = "工单编码")
private String workorderCode;
/** 工单名称 */
@Excel(name = "工单名称")
private String workorderName;
/** 任务ID */
@Excel(name = "任务ID")
private Long taskId;
/** 任务编号 */
@Excel(name = "任务编号")
private String taskCode;
/** 任务名称 */
@Excel(name = "任务名称")
private String taskName;
/** 工作站ID */
@Excel(name = "工作站ID")
private Long workstationId;
/** 工作站编号 */
@Excel(name = "工作站编号")
private String workstationCode;
/** 工作站名称 */
@Excel(name = "工作站名称")
private String workstationName;
/** 工序ID */
@Excel(name = "工序ID")
private Long processId;
/** 工序编码 */
@Excel(name = "工序编码")
private String processCode;
/** 工序名称 */
@Excel(name = "工序名称")
private String processName;
/** 产品物料ID */
@Excel(name = "产品物料ID")
private Long itemId;
/** 产品物料编码 */
@Excel(name = "产品物料编码")
private String itemCode;
/** 产品物料名称 */
@Excel(name = "产品物料名称")
private String itemName;
/** 规格型号 */
@Excel(name = "规格型号")
private String specification;
/** 单位 */
@Excel(name = "单位")
private String unitOfMeasure;
/** 检测数量 */
@Excel(name = "检测数量")
private BigDecimal quantityCheck;
/** 不合格数 */
@Excel(name = "不合格数")
private BigDecimal quantityUnqualified;
/** 合格品数量 */
@Excel(name = "合格品数量")
private BigDecimal quantityQualified;
/** 致命缺陷率 */
@Excel(name = "致命缺陷率")
private BigDecimal crRate;
/** 严重缺陷率 */
@Excel(name = "严重缺陷率")
private BigDecimal majRate;
/** 轻微缺陷率 */
@Excel(name = "轻微缺陷率")
private BigDecimal minRate;
/** 致命缺陷数量 */
@Excel(name = "致命缺陷数量")
private BigDecimal crQuantity;
/** 严重缺陷数量 */
@Excel(name = "严重缺陷数量")
private BigDecimal majQuantity;
/** 轻微缺陷数量 */
@Excel(name = "轻微缺陷数量")
private BigDecimal minQuantity;
/** 检测结果 */
@Excel(name = "检测结果")
private String checkResult;
/** 检测日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "检测日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date inspectDate;
/** 检测人员 */
@Excel(name = "检测人员")
private String inspector;
/** 单据状态 */
@Excel(name = "单据状态")
private String status;
/** 预留字段1 */
private String attr1;
/** 预留字段2 */
private String attr2;
/** 预留字段3 */
private Long attr3;
/** 预留字段4 */
private Long attr4;
public void setIpqcId(Long ipqcId)
{
this.ipqcId = ipqcId;
}
public Long getIpqcId()
{
return ipqcId;
}
public void setIpqcCode(String ipqcCode)
{
this.ipqcCode = ipqcCode;
}
public String getIpqcCode()
{
return ipqcCode;
}
public void setIpqcName(String ipqcName)
{
this.ipqcName = ipqcName;
}
public String getIpqcName()
{
return ipqcName;
}
public void setIpqcType(String ipqcType)
{
this.ipqcType = ipqcType;
}
public String getIpqcType()
{
return ipqcType;
}
public void setTemplateId(Long templateId)
{
this.templateId = templateId;
}
public Long getTemplateId()
{
return templateId;
}
public void setWorkorderId(Long workorderId)
{
this.workorderId = workorderId;
}
public Long getWorkorderId()
{
return workorderId;
}
public void setWorkorderCode(String workorderCode)
{
this.workorderCode = workorderCode;
}
public String getWorkorderCode()
{
return workorderCode;
}
public void setWorkorderName(String workorderName)
{
this.workorderName = workorderName;
}
public String getWorkorderName()
{
return workorderName;
}
public void setTaskId(Long taskId)
{
this.taskId = taskId;
}
public Long getTaskId()
{
return taskId;
}
public void setTaskCode(String taskCode)
{
this.taskCode = taskCode;
}
public String getTaskCode()
{
return taskCode;
}
public void setTaskName(String taskName)
{
this.taskName = taskName;
}
public String getTaskName()
{
return taskName;
}
public void setWorkstationId(Long workstationId)
{
this.workstationId = workstationId;
}
public Long getWorkstationId()
{
return workstationId;
}
public void setWorkstationCode(String workstationCode)
{
this.workstationCode = workstationCode;
}
public String getWorkstationCode()
{
return workstationCode;
}
public void setWorkstationName(String workstationName)
{
this.workstationName = workstationName;
}
public String getWorkstationName()
{
return workstationName;
}
public void setProcessId(Long processId)
{
this.processId = processId;
}
public Long getProcessId()
{
return processId;
}
public void setProcessCode(String processCode)
{
this.processCode = processCode;
}
public String getProcessCode()
{
return processCode;
}
public void setProcessName(String processName)
{
this.processName = processName;
}
public String getProcessName()
{
return processName;
}
public void setItemId(Long itemId)
{
this.itemId = itemId;
}
public Long getItemId()
{
return itemId;
}
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 setSpecification(String specification)
{
this.specification = specification;
}
public String getSpecification()
{
return specification;
}
public void setUnitOfMeasure(String unitOfMeasure)
{
this.unitOfMeasure = unitOfMeasure;
}
public String getUnitOfMeasure()
{
return unitOfMeasure;
}
public void setQuantityCheck(BigDecimal quantityCheck)
{
this.quantityCheck = quantityCheck;
}
public BigDecimal getQuantityCheck()
{
return quantityCheck;
}
public void setQuantityUnqualified(BigDecimal quantityUnqualified)
{
this.quantityUnqualified = quantityUnqualified;
}
public BigDecimal getQuantityUnqualified()
{
return quantityUnqualified;
}
public void setQuantityQualified(BigDecimal quantityQualified)
{
this.quantityQualified = quantityQualified;
}
public BigDecimal getQuantityQualified()
{
return quantityQualified;
}
public void setCrRate(BigDecimal crRate)
{
this.crRate = crRate;
}
public BigDecimal getCrRate()
{
return crRate;
}
public void setMajRate(BigDecimal majRate)
{
this.majRate = majRate;
}
public BigDecimal getMajRate()
{
return majRate;
}
public void setMinRate(BigDecimal minRate)
{
this.minRate = minRate;
}
public BigDecimal getMinRate()
{
return minRate;
}
public void setCrQuantity(BigDecimal crQuantity)
{
this.crQuantity = crQuantity;
}
public BigDecimal getCrQuantity()
{
return crQuantity;
}
public void setMajQuantity(BigDecimal majQuantity)
{
this.majQuantity = majQuantity;
}
public BigDecimal getMajQuantity()
{
return majQuantity;
}
public void setMinQuantity(BigDecimal minQuantity)
{
this.minQuantity = minQuantity;
}
public BigDecimal getMinQuantity()
{
return minQuantity;
}
public void setCheckResult(String checkResult)
{
this.checkResult = checkResult;
}
public String getCheckResult()
{
return checkResult;
}
public void setInspectDate(Date inspectDate)
{
this.inspectDate = inspectDate;
}
public Date getInspectDate()
{
return inspectDate;
}
public void setInspector(String inspector)
{
this.inspector = inspector;
}
public String getInspector()
{
return inspector;
}
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("ipqcId", getIpqcId())
.append("ipqcCode", getIpqcCode())
.append("ipqcName", getIpqcName())
.append("ipqcType", getIpqcType())
.append("templateId", getTemplateId())
.append("workorderId", getWorkorderId())
.append("workorderCode", getWorkorderCode())
.append("workorderName", getWorkorderName())
.append("taskId", getTaskId())
.append("taskCode", getTaskCode())
.append("taskName", getTaskName())
.append("workstationId", getWorkstationId())
.append("workstationCode", getWorkstationCode())
.append("workstationName", getWorkstationName())
.append("processId", getProcessId())
.append("processCode", getProcessCode())
.append("processName", getProcessName())
.append("itemId", getItemId())
.append("itemCode", getItemCode())
.append("itemName", getItemName())
.append("specification", getSpecification())
.append("unitOfMeasure", getUnitOfMeasure())
.append("quantityCheck", getQuantityCheck())
.append("quantityUnqualified", getQuantityUnqualified())
.append("quantityQualified", getQuantityQualified())
.append("crRate", getCrRate())
.append("majRate", getMajRate())
.append("minRate", getMinRate())
.append("crQuantity", getCrQuantity())
.append("majQuantity", getMajQuantity())
.append("minQuantity", getMinQuantity())
.append("checkResult", getCheckResult())
.append("inspectDate", getInspectDate())
.append("inspector", getInspector())
.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();
}
}

View File

@ -0,0 +1,61 @@
package com.ktg.mes.qc.mapper;
import java.util.List;
import com.ktg.mes.qc.domain.QcIpqc;
/**
* 过程检验单Mapper接口
*
* @author yinjinlu
* @date 2022-08-29
*/
public interface QcIpqcMapper
{
/**
* 查询过程检验单
*
* @param ipqcId 过程检验单主键
* @return 过程检验单
*/
public QcIpqc selectQcIpqcByIpqcId(Long ipqcId);
/**
* 查询过程检验单列表
*
* @param qcIpqc 过程检验单
* @return 过程检验单集合
*/
public List<QcIpqc> selectQcIpqcList(QcIpqc qcIpqc);
/**
* 新增过程检验单
*
* @param qcIpqc 过程检验单
* @return 结果
*/
public int insertQcIpqc(QcIpqc qcIpqc);
/**
* 修改过程检验单
*
* @param qcIpqc 过程检验单
* @return 结果
*/
public int updateQcIpqc(QcIpqc qcIpqc);
/**
* 删除过程检验单
*
* @param ipqcId 过程检验单主键
* @return 结果
*/
public int deleteQcIpqcByIpqcId(Long ipqcId);
/**
* 批量删除过程检验单
*
* @param ipqcIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteQcIpqcByIpqcIds(Long[] ipqcIds);
}

View File

@ -0,0 +1,61 @@
package com.ktg.mes.qc.service;
import java.util.List;
import com.ktg.mes.qc.domain.QcIpqc;
/**
* 过程检验单Service接口
*
* @author yinjinlu
* @date 2022-08-29
*/
public interface IQcIpqcService
{
/**
* 查询过程检验单
*
* @param ipqcId 过程检验单主键
* @return 过程检验单
*/
public QcIpqc selectQcIpqcByIpqcId(Long ipqcId);
/**
* 查询过程检验单列表
*
* @param qcIpqc 过程检验单
* @return 过程检验单集合
*/
public List<QcIpqc> selectQcIpqcList(QcIpqc qcIpqc);
/**
* 新增过程检验单
*
* @param qcIpqc 过程检验单
* @return 结果
*/
public int insertQcIpqc(QcIpqc qcIpqc);
/**
* 修改过程检验单
*
* @param qcIpqc 过程检验单
* @return 结果
*/
public int updateQcIpqc(QcIpqc qcIpqc);
/**
* 批量删除过程检验单
*
* @param ipqcIds 需要删除的过程检验单主键集合
* @return 结果
*/
public int deleteQcIpqcByIpqcIds(Long[] ipqcIds);
/**
* 删除过程检验单信息
*
* @param ipqcId 过程检验单主键
* @return 结果
*/
public int deleteQcIpqcByIpqcId(Long ipqcId);
}

View File

@ -0,0 +1,96 @@
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.QcIpqcMapper;
import com.ktg.mes.qc.domain.QcIpqc;
import com.ktg.mes.qc.service.IQcIpqcService;
/**
* 过程检验单Service业务层处理
*
* @author yinjinlu
* @date 2022-08-29
*/
@Service
public class QcIpqcServiceImpl implements IQcIpqcService
{
@Autowired
private QcIpqcMapper qcIpqcMapper;
/**
* 查询过程检验单
*
* @param ipqcId 过程检验单主键
* @return 过程检验单
*/
@Override
public QcIpqc selectQcIpqcByIpqcId(Long ipqcId)
{
return qcIpqcMapper.selectQcIpqcByIpqcId(ipqcId);
}
/**
* 查询过程检验单列表
*
* @param qcIpqc 过程检验单
* @return 过程检验单
*/
@Override
public List<QcIpqc> selectQcIpqcList(QcIpqc qcIpqc)
{
return qcIpqcMapper.selectQcIpqcList(qcIpqc);
}
/**
* 新增过程检验单
*
* @param qcIpqc 过程检验单
* @return 结果
*/
@Override
public int insertQcIpqc(QcIpqc qcIpqc)
{
qcIpqc.setCreateTime(DateUtils.getNowDate());
return qcIpqcMapper.insertQcIpqc(qcIpqc);
}
/**
* 修改过程检验单
*
* @param qcIpqc 过程检验单
* @return 结果
*/
@Override
public int updateQcIpqc(QcIpqc qcIpqc)
{
qcIpqc.setUpdateTime(DateUtils.getNowDate());
return qcIpqcMapper.updateQcIpqc(qcIpqc);
}
/**
* 批量删除过程检验单
*
* @param ipqcIds 需要删除的过程检验单主键
* @return 结果
*/
@Override
public int deleteQcIpqcByIpqcIds(Long[] ipqcIds)
{
return qcIpqcMapper.deleteQcIpqcByIpqcIds(ipqcIds);
}
/**
* 删除过程检验单信息
*
* @param ipqcId 过程检验单主键
* @return 结果
*/
@Override
public int deleteQcIpqcByIpqcId(Long ipqcId)
{
return qcIpqcMapper.deleteQcIpqcByIpqcId(ipqcId);
}
}

View File

@ -0,0 +1,257 @@
<?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.QcIpqcMapper">
<resultMap type="QcIpqc" id="QcIpqcResult">
<result property="ipqcId" column="ipqc_id" />
<result property="ipqcCode" column="ipqc_code" />
<result property="ipqcName" column="ipqc_name" />
<result property="ipqcType" column="ipqc_type" />
<result property="templateId" column="template_id" />
<result property="workorderId" column="workorder_id" />
<result property="workorderCode" column="workorder_code" />
<result property="workorderName" column="workorder_name" />
<result property="taskId" column="task_id" />
<result property="taskCode" column="task_code" />
<result property="taskName" column="task_name" />
<result property="workstationId" column="workstation_id" />
<result property="workstationCode" column="workstation_code" />
<result property="workstationName" column="workstation_name" />
<result property="processId" column="process_id" />
<result property="processCode" column="process_code" />
<result property="processName" column="process_name" />
<result property="itemId" column="item_id" />
<result property="itemCode" column="item_code" />
<result property="itemName" column="item_name" />
<result property="specification" column="specification" />
<result property="unitOfMeasure" column="unit_of_measure" />
<result property="quantityCheck" column="quantity_check" />
<result property="quantityUnqualified" column="quantity_unqualified" />
<result property="quantityQualified" column="quantity_qualified" />
<result property="crRate" column="cr_rate" />
<result property="majRate" column="maj_rate" />
<result property="minRate" column="min_rate" />
<result property="crQuantity" column="cr_quantity" />
<result property="majQuantity" column="maj_quantity" />
<result property="minQuantity" column="min_quantity" />
<result property="checkResult" column="check_result" />
<result property="inspectDate" column="inspect_date" />
<result property="inspector" column="inspector" />
<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="selectQcIpqcVo">
select ipqc_id, ipqc_code, ipqc_name, ipqc_type, template_id, workorder_id, workorder_code, workorder_name, task_id, task_code, task_name, workstation_id, workstation_code, workstation_name, process_id, process_code, process_name, item_id, item_code, item_name, specification, unit_of_measure, quantity_check, quantity_unqualified, quantity_qualified, cr_rate, maj_rate, min_rate, cr_quantity, maj_quantity, min_quantity, check_result, inspect_date, inspector, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from qc_ipqc
</sql>
<select id="selectQcIpqcList" parameterType="QcIpqc" resultMap="QcIpqcResult">
<include refid="selectQcIpqcVo"/>
<where>
<if test="ipqcCode != null and ipqcCode != ''"> and ipqc_code = #{ipqcCode}</if>
<if test="ipqcName != null and ipqcName != ''"> and ipqc_name like concat('%', #{ipqcName}, '%')</if>
<if test="ipqcType != null and ipqcType != ''"> and ipqc_type = #{ipqcType}</if>
<if test="templateId != null "> and template_id = #{templateId}</if>
<if test="workorderId != null "> and workorder_id = #{workorderId}</if>
<if test="workorderCode != null and workorderCode != ''"> and workorder_code = #{workorderCode}</if>
<if test="workorderName != null and workorderName != ''"> and workorder_name like concat('%', #{workorderName}, '%')</if>
<if test="taskId != null "> and task_id = #{taskId}</if>
<if test="taskCode != null and taskCode != ''"> and task_code = #{taskCode}</if>
<if test="taskName != null and taskName != ''"> and task_name like concat('%', #{taskName}, '%')</if>
<if test="workstationId != null "> and workstation_id = #{workstationId}</if>
<if test="workstationCode != null and workstationCode != ''"> and workstation_code = #{workstationCode}</if>
<if test="workstationName != null and workstationName != ''"> and workstation_name like concat('%', #{workstationName}, '%')</if>
<if test="processId != null "> and process_id = #{processId}</if>
<if test="processCode != null and processCode != ''"> and process_code = #{processCode}</if>
<if test="processName != null and processName != ''"> and process_name like concat('%', #{processName}, '%')</if>
<if test="itemId != null "> and item_id = #{itemId}</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="specification != null and specification != ''"> and specification = #{specification}</if>
<if test="unitOfMeasure != null and unitOfMeasure != ''"> and unit_of_measure = #{unitOfMeasure}</if>
<if test="quantityCheck != null "> and quantity_check = #{quantityCheck}</if>
<if test="quantityUnqualified != null "> and quantity_unqualified = #{quantityUnqualified}</if>
<if test="quantityQualified != null "> and quantity_qualified = #{quantityQualified}</if>
<if test="crRate != null "> and cr_rate = #{crRate}</if>
<if test="majRate != null "> and maj_rate = #{majRate}</if>
<if test="minRate != null "> and min_rate = #{minRate}</if>
<if test="crQuantity != null "> and cr_quantity = #{crQuantity}</if>
<if test="majQuantity != null "> and maj_quantity = #{majQuantity}</if>
<if test="minQuantity != null "> and min_quantity = #{minQuantity}</if>
<if test="checkResult != null and checkResult != ''"> and check_result = #{checkResult}</if>
<if test="inspectDate != null "> and inspect_date = #{inspectDate}</if>
<if test="inspector != null and inspector != ''"> and inspector = #{inspector}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
</where>
</select>
<select id="selectQcIpqcByIpqcId" parameterType="Long" resultMap="QcIpqcResult">
<include refid="selectQcIpqcVo"/>
where ipqc_id = #{ipqcId}
</select>
<insert id="insertQcIpqc" parameterType="QcIpqc" useGeneratedKeys="true" keyProperty="ipqcId">
insert into qc_ipqc
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="ipqcCode != null and ipqcCode != ''">ipqc_code,</if>
<if test="ipqcName != null">ipqc_name,</if>
<if test="ipqcType != null and ipqcType != ''">ipqc_type,</if>
<if test="templateId != null">template_id,</if>
<if test="workorderId != null">workorder_id,</if>
<if test="workorderCode != null and workorderCode != ''">workorder_code,</if>
<if test="workorderName != null and workorderName != ''">workorder_name,</if>
<if test="taskId != null">task_id,</if>
<if test="taskCode != null and taskCode != ''">task_code,</if>
<if test="taskName != null and taskName != ''">task_name,</if>
<if test="workstationId != null">workstation_id,</if>
<if test="workstationCode != null and workstationCode != ''">workstation_code,</if>
<if test="workstationName != null and workstationName != ''">workstation_name,</if>
<if test="processId != null">process_id,</if>
<if test="processCode != null">process_code,</if>
<if test="processName != null">process_name,</if>
<if test="itemId != null">item_id,</if>
<if test="itemCode != null">item_code,</if>
<if test="itemName != null">item_name,</if>
<if test="specification != null">specification,</if>
<if test="unitOfMeasure != null">unit_of_measure,</if>
<if test="quantityCheck != null">quantity_check,</if>
<if test="quantityUnqualified != null">quantity_unqualified,</if>
<if test="quantityQualified != null">quantity_qualified,</if>
<if test="crRate != null">cr_rate,</if>
<if test="majRate != null">maj_rate,</if>
<if test="minRate != null">min_rate,</if>
<if test="crQuantity != null">cr_quantity,</if>
<if test="majQuantity != null">maj_quantity,</if>
<if test="minQuantity != null">min_quantity,</if>
<if test="checkResult != null">check_result,</if>
<if test="inspectDate != null">inspect_date,</if>
<if test="inspector != null">inspector,</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="ipqcCode != null and ipqcCode != ''">#{ipqcCode},</if>
<if test="ipqcName != null">#{ipqcName},</if>
<if test="ipqcType != null and ipqcType != ''">#{ipqcType},</if>
<if test="templateId != null">#{templateId},</if>
<if test="workorderId != null">#{workorderId},</if>
<if test="workorderCode != null and workorderCode != ''">#{workorderCode},</if>
<if test="workorderName != null and workorderName != ''">#{workorderName},</if>
<if test="taskId != null">#{taskId},</if>
<if test="taskCode != null and taskCode != ''">#{taskCode},</if>
<if test="taskName != null and taskName != ''">#{taskName},</if>
<if test="workstationId != null">#{workstationId},</if>
<if test="workstationCode != null and workstationCode != ''">#{workstationCode},</if>
<if test="workstationName != null and workstationName != ''">#{workstationName},</if>
<if test="processId != null">#{processId},</if>
<if test="processCode != null">#{processCode},</if>
<if test="processName != null">#{processName},</if>
<if test="itemId != null">#{itemId},</if>
<if test="itemCode != null">#{itemCode},</if>
<if test="itemName != null">#{itemName},</if>
<if test="specification != null">#{specification},</if>
<if test="unitOfMeasure != null">#{unitOfMeasure},</if>
<if test="quantityCheck != null">#{quantityCheck},</if>
<if test="quantityUnqualified != null">#{quantityUnqualified},</if>
<if test="quantityQualified != null">#{quantityQualified},</if>
<if test="crRate != null">#{crRate},</if>
<if test="majRate != null">#{majRate},</if>
<if test="minRate != null">#{minRate},</if>
<if test="crQuantity != null">#{crQuantity},</if>
<if test="majQuantity != null">#{majQuantity},</if>
<if test="minQuantity != null">#{minQuantity},</if>
<if test="checkResult != null">#{checkResult},</if>
<if test="inspectDate != null">#{inspectDate},</if>
<if test="inspector != null">#{inspector},</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="updateQcIpqc" parameterType="QcIpqc">
update qc_ipqc
<trim prefix="SET" suffixOverrides=",">
<if test="ipqcCode != null and ipqcCode != ''">ipqc_code = #{ipqcCode},</if>
<if test="ipqcName != null">ipqc_name = #{ipqcName},</if>
<if test="ipqcType != null and ipqcType != ''">ipqc_type = #{ipqcType},</if>
<if test="templateId != null">template_id = #{templateId},</if>
<if test="workorderId != null">workorder_id = #{workorderId},</if>
<if test="workorderCode != null and workorderCode != ''">workorder_code = #{workorderCode},</if>
<if test="workorderName != null and workorderName != ''">workorder_name = #{workorderName},</if>
<if test="taskId != null">task_id = #{taskId},</if>
<if test="taskCode != null and taskCode != ''">task_code = #{taskCode},</if>
<if test="taskName != null and taskName != ''">task_name = #{taskName},</if>
<if test="workstationId != null">workstation_id = #{workstationId},</if>
<if test="workstationCode != null and workstationCode != ''">workstation_code = #{workstationCode},</if>
<if test="workstationName != null and workstationName != ''">workstation_name = #{workstationName},</if>
<if test="processId != null">process_id = #{processId},</if>
<if test="processCode != null">process_code = #{processCode},</if>
<if test="processName != null">process_name = #{processName},</if>
<if test="itemId != null">item_id = #{itemId},</if>
<if test="itemCode != null">item_code = #{itemCode},</if>
<if test="itemName != null">item_name = #{itemName},</if>
<if test="specification != null">specification = #{specification},</if>
<if test="unitOfMeasure != null">unit_of_measure = #{unitOfMeasure},</if>
<if test="quantityCheck != null">quantity_check = #{quantityCheck},</if>
<if test="quantityUnqualified != null">quantity_unqualified = #{quantityUnqualified},</if>
<if test="quantityQualified != null">quantity_qualified = #{quantityQualified},</if>
<if test="crRate != null">cr_rate = #{crRate},</if>
<if test="majRate != null">maj_rate = #{majRate},</if>
<if test="minRate != null">min_rate = #{minRate},</if>
<if test="crQuantity != null">cr_quantity = #{crQuantity},</if>
<if test="majQuantity != null">maj_quantity = #{majQuantity},</if>
<if test="minQuantity != null">min_quantity = #{minQuantity},</if>
<if test="checkResult != null">check_result = #{checkResult},</if>
<if test="inspectDate != null">inspect_date = #{inspectDate},</if>
<if test="inspector != null">inspector = #{inspector},</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 ipqc_id = #{ipqcId}
</update>
<delete id="deleteQcIpqcByIpqcId" parameterType="Long">
delete from qc_ipqc where ipqc_id = #{ipqcId}
</delete>
<delete id="deleteQcIpqcByIpqcIds" parameterType="String">
delete from qc_ipqc where ipqc_id in
<foreach item="ipqcId" collection="array" open="(" separator="," close=")">
#{ipqcId}
</foreach>
</delete>
</mapper>