检测模板添加检测项

This commit is contained in:
JinLu.Yin 2022-05-18 15:15:50 +08:00
parent efaface48b
commit 0c9920eca8
7 changed files with 759 additions and 5 deletions

View File

@ -49,13 +49,12 @@ public class QcTemplateController extends BaseController
startPage(); startPage();
List<QcTemplate> list = qcTemplateService.selectQcTemplateList(qcTemplate); List<QcTemplate> list = qcTemplateService.selectQcTemplateList(qcTemplate);
if(CollUtil.isNotEmpty(list)){ if(CollUtil.isNotEmpty(list)){
int i=0; for (int i=0;i<list.size();i++)
for (QcTemplate template: list {
) { QcTemplate template = list.get(i);
template.setQcTypesParam(template.getQcTypes().split(",")); template.setQcTypesParam(template.getQcTypes().split(","));
list.set(i,template); list.set(i,template);
} }
i++;
} }
return getDataTable(list); return getDataTable(list);
} }
@ -80,7 +79,11 @@ public class QcTemplateController extends BaseController
@GetMapping(value = "/{templateId}") @GetMapping(value = "/{templateId}")
public AjaxResult getInfo(@PathVariable("templateId") Long templateId) public AjaxResult getInfo(@PathVariable("templateId") Long templateId)
{ {
return AjaxResult.success(qcTemplateService.selectQcTemplateByTemplateId(templateId)); QcTemplate template = qcTemplateService.selectQcTemplateByTemplateId(templateId);
if(StringUtils.isNotNull(template)){
template.setQcTypesParam(template.getQcTypes().split(","));
}
return AjaxResult.success(template);
} }
/** /**
@ -96,7 +99,9 @@ public class QcTemplateController extends BaseController
} }
if(ArrayUtil.isNotEmpty(qcTemplate.getQcTypesParam())){ if(ArrayUtil.isNotEmpty(qcTemplate.getQcTypesParam())){
qcTemplate.setQcTypes(null); //先置空
String[] types = qcTemplate.getQcTypesParam(); String[] types = qcTemplate.getQcTypesParam();
//根据输入参数重新生成
for (String type:types for (String type:types
) { ) {
if(StringUtils.isNotNull(qcTemplate.getQcTypes())){ if(StringUtils.isNotNull(qcTemplate.getQcTypes())){
@ -122,6 +127,7 @@ public class QcTemplateController extends BaseController
return AjaxResult.error("检测模板编号已存在!"); return AjaxResult.error("检测模板编号已存在!");
} }
if(ArrayUtil.isNotEmpty(qcTemplate.getQcTypesParam())){ if(ArrayUtil.isNotEmpty(qcTemplate.getQcTypesParam())){
qcTemplate.setQcTypes(null); //先置空
String[] types = qcTemplate.getQcTypesParam(); String[] types = qcTemplate.getQcTypesParam();
for (String type:types for (String type:types
) { ) {

View File

@ -0,0 +1,120 @@
package com.ktg.mes.qc.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ktg.mes.qc.domain.QcIndex;
import com.ktg.mes.qc.service.IQcIndexService;
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.QcTemplateIndex;
import com.ktg.mes.qc.service.IQcTemplateIndexService;
import com.ktg.common.utils.poi.ExcelUtil;
import com.ktg.common.core.page.TableDataInfo;
/**
* 检测模板-检测项Controller
*
* @author yinjinlu
* @date 2022-05-18
*/
@RestController
@RequestMapping("/mes/qc/templateindex")
public class QcTemplateIndexController extends BaseController
{
@Autowired
private IQcTemplateIndexService qcTemplateIndexService;
@Autowired
private IQcIndexService qcIndexService;
/**
* 查询检测模板-检测项列表
*/
@PreAuthorize("@ss.hasPermi('mes:qc:templateindex:list')")
@GetMapping("/list")
public TableDataInfo list(QcTemplateIndex qcTemplateIndex)
{
startPage();
List<QcTemplateIndex> list = qcTemplateIndexService.selectQcTemplateIndexList(qcTemplateIndex);
return getDataTable(list);
}
/**
* 导出检测模板-检测项列表
*/
@PreAuthorize("@ss.hasPermi('mes:qc:templateindex:export')")
@Log(title = "检测模板-检测项", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, QcTemplateIndex qcTemplateIndex)
{
List<QcTemplateIndex> list = qcTemplateIndexService.selectQcTemplateIndexList(qcTemplateIndex);
ExcelUtil<QcTemplateIndex> util = new ExcelUtil<QcTemplateIndex>(QcTemplateIndex.class);
util.exportExcel(response, list, "检测模板-检测项数据");
}
/**
* 获取检测模板-检测项详细信息
*/
@PreAuthorize("@ss.hasPermi('mes:qc:templateindex:query')")
@GetMapping(value = "/{recordId}")
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
{
return AjaxResult.success(qcTemplateIndexService.selectQcTemplateIndexByRecordId(recordId));
}
/**
* 新增检测模板-检测项
*/
@PreAuthorize("@ss.hasPermi('mes:qc:templateindex:add')")
@Log(title = "检测模板-检测项", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody QcTemplateIndex qcTemplateIndex)
{
QcIndex index =qcIndexService.selectQcIndexByIndexId(qcTemplateIndex.getIndexId());
qcTemplateIndex.setIndexCode(index.getIndexCode());
qcTemplateIndex.setIndexName(index.getIndexName());
qcTemplateIndex.setIndexType(index.getIndexType());
qcTemplateIndex.setQcTool(index.getQcTool());
return toAjax(qcTemplateIndexService.insertQcTemplateIndex(qcTemplateIndex));
}
/**
* 修改检测模板-检测项
*/
@PreAuthorize("@ss.hasPermi('mes:qc:templateindex:edit')")
@Log(title = "检测模板-检测项", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody QcTemplateIndex qcTemplateIndex)
{
QcIndex index =qcIndexService.selectQcIndexByIndexId(qcTemplateIndex.getIndexId());
qcTemplateIndex.setIndexCode(index.getIndexCode());
qcTemplateIndex.setIndexName(index.getIndexName());
qcTemplateIndex.setIndexType(index.getIndexType());
qcTemplateIndex.setQcTool(index.getQcTool());
return toAjax(qcTemplateIndexService.updateQcTemplateIndex(qcTemplateIndex));
}
/**
* 删除检测模板-检测项
*/
@PreAuthorize("@ss.hasPermi('mes:qc:templateindex:remove')")
@Log(title = "检测模板-检测项", businessType = BusinessType.DELETE)
@DeleteMapping("/{recordIds}")
public AjaxResult remove(@PathVariable Long[] recordIds)
{
return toAjax(qcTemplateIndexService.deleteQcTemplateIndexByRecordIds(recordIds));
}
}

View File

@ -0,0 +1,263 @@
package com.ktg.mes.qc.domain;
import java.math.BigDecimal;
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_template_index
*
* @author yinjinlu
* @date 2022-05-18
*/
public class QcTemplateIndex extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 记录ID */
private Long recordId;
/** 检测模板ID */
@Excel(name = "检测模板ID")
private Long templateId;
/** 检测项ID */
@Excel(name = "检测项ID")
private Long indexId;
/** 检测项编码 */
@Excel(name = "检测项编码")
private String indexCode;
/** 检测项名称 */
@Excel(name = "检测项名称")
private String indexName;
/** 检测项类型 */
@Excel(name = "检测项类型")
private String indexType;
/** 检测工具 */
@Excel(name = "检测工具")
private String qcTool;
/** 检测方法 */
@Excel(name = "检测方法")
private String checkMethod;
/** 标准值 */
@Excel(name = "标准值")
private BigDecimal standerVal;
/** 单位 */
@Excel(name = "单位")
private String unitOfMeasure;
/** 误差上限 */
@Excel(name = "误差上限")
private BigDecimal thresholdMax;
/** 误差下限 */
@Excel(name = "误差下限")
private BigDecimal thresholdMin;
/** 说明图 */
@Excel(name = "说明图")
private String docUrl;
/** 预留字段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 setTemplateId(Long templateId)
{
this.templateId = templateId;
}
public Long getTemplateId()
{
return templateId;
}
public void setIndexId(Long indexId)
{
this.indexId = indexId;
}
public Long getIndexId()
{
return indexId;
}
public void setIndexCode(String indexCode)
{
this.indexCode = indexCode;
}
public String getIndexCode()
{
return indexCode;
}
public void setIndexName(String indexName)
{
this.indexName = indexName;
}
public String getIndexName()
{
return indexName;
}
public void setIndexType(String indexType)
{
this.indexType = indexType;
}
public String getIndexType()
{
return indexType;
}
public void setQcTool(String qcTool)
{
this.qcTool = qcTool;
}
public String getQcTool()
{
return qcTool;
}
public void setCheckMethod(String checkMethod)
{
this.checkMethod = checkMethod;
}
public String getCheckMethod()
{
return checkMethod;
}
public void setStanderVal(BigDecimal standerVal)
{
this.standerVal = standerVal;
}
public BigDecimal getStanderVal()
{
return standerVal;
}
public void setUnitOfMeasure(String unitOfMeasure)
{
this.unitOfMeasure = unitOfMeasure;
}
public String getUnitOfMeasure()
{
return unitOfMeasure;
}
public void setThresholdMax(BigDecimal thresholdMax)
{
this.thresholdMax = thresholdMax;
}
public BigDecimal getThresholdMax()
{
return thresholdMax;
}
public void setThresholdMin(BigDecimal thresholdMin)
{
this.thresholdMin = thresholdMin;
}
public BigDecimal getThresholdMin()
{
return thresholdMin;
}
public void setDocUrl(String docUrl)
{
this.docUrl = docUrl;
}
public String getDocUrl()
{
return docUrl;
}
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("templateId", getTemplateId())
.append("indexId", getIndexId())
.append("indexCode", getIndexCode())
.append("indexName", getIndexName())
.append("indexType", getIndexType())
.append("qcTool", getQcTool())
.append("checkMethod", getCheckMethod())
.append("standerVal", getStanderVal())
.append("unitOfMeasure", getUnitOfMeasure())
.append("thresholdMax", getThresholdMax())
.append("thresholdMin", getThresholdMin())
.append("docUrl", getDocUrl())
.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.QcTemplateIndex;
/**
* 检测模板-检测项Mapper接口
*
* @author yinjinlu
* @date 2022-05-18
*/
public interface QcTemplateIndexMapper
{
/**
* 查询检测模板-检测项
*
* @param recordId 检测模板-检测项主键
* @return 检测模板-检测项
*/
public QcTemplateIndex selectQcTemplateIndexByRecordId(Long recordId);
/**
* 查询检测模板-检测项列表
*
* @param qcTemplateIndex 检测模板-检测项
* @return 检测模板-检测项集合
*/
public List<QcTemplateIndex> selectQcTemplateIndexList(QcTemplateIndex qcTemplateIndex);
/**
* 新增检测模板-检测项
*
* @param qcTemplateIndex 检测模板-检测项
* @return 结果
*/
public int insertQcTemplateIndex(QcTemplateIndex qcTemplateIndex);
/**
* 修改检测模板-检测项
*
* @param qcTemplateIndex 检测模板-检测项
* @return 结果
*/
public int updateQcTemplateIndex(QcTemplateIndex qcTemplateIndex);
/**
* 删除检测模板-检测项
*
* @param recordId 检测模板-检测项主键
* @return 结果
*/
public int deleteQcTemplateIndexByRecordId(Long recordId);
/**
* 批量删除检测模板-检测项
*
* @param recordIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteQcTemplateIndexByRecordIds(Long[] recordIds);
}

View File

@ -0,0 +1,61 @@
package com.ktg.mes.qc.service;
import java.util.List;
import com.ktg.mes.qc.domain.QcTemplateIndex;
/**
* 检测模板-检测项Service接口
*
* @author yinjinlu
* @date 2022-05-18
*/
public interface IQcTemplateIndexService
{
/**
* 查询检测模板-检测项
*
* @param recordId 检测模板-检测项主键
* @return 检测模板-检测项
*/
public QcTemplateIndex selectQcTemplateIndexByRecordId(Long recordId);
/**
* 查询检测模板-检测项列表
*
* @param qcTemplateIndex 检测模板-检测项
* @return 检测模板-检测项集合
*/
public List<QcTemplateIndex> selectQcTemplateIndexList(QcTemplateIndex qcTemplateIndex);
/**
* 新增检测模板-检测项
*
* @param qcTemplateIndex 检测模板-检测项
* @return 结果
*/
public int insertQcTemplateIndex(QcTemplateIndex qcTemplateIndex);
/**
* 修改检测模板-检测项
*
* @param qcTemplateIndex 检测模板-检测项
* @return 结果
*/
public int updateQcTemplateIndex(QcTemplateIndex qcTemplateIndex);
/**
* 批量删除检测模板-检测项
*
* @param recordIds 需要删除的检测模板-检测项主键集合
* @return 结果
*/
public int deleteQcTemplateIndexByRecordIds(Long[] recordIds);
/**
* 删除检测模板-检测项信息
*
* @param recordId 检测模板-检测项主键
* @return 结果
*/
public int deleteQcTemplateIndexByRecordId(Long recordId);
}

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.QcTemplateIndexMapper;
import com.ktg.mes.qc.domain.QcTemplateIndex;
import com.ktg.mes.qc.service.IQcTemplateIndexService;
/**
* 检测模板-检测项Service业务层处理
*
* @author yinjinlu
* @date 2022-05-18
*/
@Service
public class QcTemplateIndexServiceImpl implements IQcTemplateIndexService
{
@Autowired
private QcTemplateIndexMapper qcTemplateIndexMapper;
/**
* 查询检测模板-检测项
*
* @param recordId 检测模板-检测项主键
* @return 检测模板-检测项
*/
@Override
public QcTemplateIndex selectQcTemplateIndexByRecordId(Long recordId)
{
return qcTemplateIndexMapper.selectQcTemplateIndexByRecordId(recordId);
}
/**
* 查询检测模板-检测项列表
*
* @param qcTemplateIndex 检测模板-检测项
* @return 检测模板-检测项
*/
@Override
public List<QcTemplateIndex> selectQcTemplateIndexList(QcTemplateIndex qcTemplateIndex)
{
return qcTemplateIndexMapper.selectQcTemplateIndexList(qcTemplateIndex);
}
/**
* 新增检测模板-检测项
*
* @param qcTemplateIndex 检测模板-检测项
* @return 结果
*/
@Override
public int insertQcTemplateIndex(QcTemplateIndex qcTemplateIndex)
{
qcTemplateIndex.setCreateTime(DateUtils.getNowDate());
return qcTemplateIndexMapper.insertQcTemplateIndex(qcTemplateIndex);
}
/**
* 修改检测模板-检测项
*
* @param qcTemplateIndex 检测模板-检测项
* @return 结果
*/
@Override
public int updateQcTemplateIndex(QcTemplateIndex qcTemplateIndex)
{
qcTemplateIndex.setUpdateTime(DateUtils.getNowDate());
return qcTemplateIndexMapper.updateQcTemplateIndex(qcTemplateIndex);
}
/**
* 批量删除检测模板-检测项
*
* @param recordIds 需要删除的检测模板-检测项主键
* @return 结果
*/
@Override
public int deleteQcTemplateIndexByRecordIds(Long[] recordIds)
{
return qcTemplateIndexMapper.deleteQcTemplateIndexByRecordIds(recordIds);
}
/**
* 删除检测模板-检测项信息
*
* @param recordId 检测模板-检测项主键
* @return 结果
*/
@Override
public int deleteQcTemplateIndexByRecordId(Long recordId)
{
return qcTemplateIndexMapper.deleteQcTemplateIndexByRecordId(recordId);
}
}

View File

@ -0,0 +1,147 @@
<?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.QcTemplateIndexMapper">
<resultMap type="QcTemplateIndex" id="QcTemplateIndexResult">
<result property="recordId" column="record_id" />
<result property="templateId" column="template_id" />
<result property="indexId" column="index_id" />
<result property="indexCode" column="index_code" />
<result property="indexName" column="index_name" />
<result property="indexType" column="index_type" />
<result property="qcTool" column="qc_tool" />
<result property="checkMethod" column="check_method" />
<result property="standerVal" column="stander_val" />
<result property="unitOfMeasure" column="unit_of_measure" />
<result property="thresholdMax" column="threshold_max" />
<result property="thresholdMin" column="threshold_min" />
<result property="docUrl" column="doc_url" />
<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="selectQcTemplateIndexVo">
select record_id, template_id, index_id, index_code, index_name, index_type, qc_tool, check_method, stander_val, unit_of_measure, threshold_max, threshold_min, doc_url, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from qc_template_index
</sql>
<select id="selectQcTemplateIndexList" parameterType="QcTemplateIndex" resultMap="QcTemplateIndexResult">
<include refid="selectQcTemplateIndexVo"/>
<where>
<if test="templateId != null "> and template_id = #{templateId}</if>
<if test="indexId != null "> and index_id = #{indexId}</if>
<if test="indexCode != null and indexCode != ''"> and index_code = #{indexCode}</if>
<if test="indexName != null and indexName != ''"> and index_name like concat('%', #{indexName}, '%')</if>
<if test="indexType != null and indexType != ''"> and index_type = #{indexType}</if>
<if test="qcTool != null and qcTool != ''"> and qc_tool = #{qcTool}</if>
<if test="checkMethod != null and checkMethod != ''"> and check_method = #{checkMethod}</if>
<if test="standerVal != null "> and stander_val = #{standerVal}</if>
<if test="unitOfMeasure != null and unitOfMeasure != ''"> and unit_of_measure = #{unitOfMeasure}</if>
<if test="thresholdMax != null "> and threshold_max = #{thresholdMax}</if>
<if test="thresholdMin != null "> and threshold_min = #{thresholdMin}</if>
<if test="docUrl != null and docUrl != ''"> and doc_url = #{docUrl}</if>
</where>
</select>
<select id="selectQcTemplateIndexByRecordId" parameterType="Long" resultMap="QcTemplateIndexResult">
<include refid="selectQcTemplateIndexVo"/>
where record_id = #{recordId}
</select>
<insert id="insertQcTemplateIndex" parameterType="QcTemplateIndex" useGeneratedKeys="true" keyProperty="recordId">
insert into qc_template_index
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="templateId != null">template_id,</if>
<if test="indexId != null">index_id,</if>
<if test="indexCode != null and indexCode != ''">index_code,</if>
<if test="indexName != null and indexName != ''">index_name,</if>
<if test="indexType != null and indexType != ''">index_type,</if>
<if test="qcTool != null">qc_tool,</if>
<if test="checkMethod != null">check_method,</if>
<if test="standerVal != null">stander_val,</if>
<if test="unitOfMeasure != null">unit_of_measure,</if>
<if test="thresholdMax != null">threshold_max,</if>
<if test="thresholdMin != null">threshold_min,</if>
<if test="docUrl != null">doc_url,</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="templateId != null">#{templateId},</if>
<if test="indexId != null">#{indexId},</if>
<if test="indexCode != null and indexCode != ''">#{indexCode},</if>
<if test="indexName != null and indexName != ''">#{indexName},</if>
<if test="indexType != null and indexType != ''">#{indexType},</if>
<if test="qcTool != null">#{qcTool},</if>
<if test="checkMethod != null">#{checkMethod},</if>
<if test="standerVal != null">#{standerVal},</if>
<if test="unitOfMeasure != null">#{unitOfMeasure},</if>
<if test="thresholdMax != null">#{thresholdMax},</if>
<if test="thresholdMin != null">#{thresholdMin},</if>
<if test="docUrl != null">#{docUrl},</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="updateQcTemplateIndex" parameterType="QcTemplateIndex">
update qc_template_index
<trim prefix="SET" suffixOverrides=",">
<if test="templateId != null">template_id = #{templateId},</if>
<if test="indexId != null">index_id = #{indexId},</if>
<if test="indexCode != null and indexCode != ''">index_code = #{indexCode},</if>
<if test="indexName != null and indexName != ''">index_name = #{indexName},</if>
<if test="indexType != null and indexType != ''">index_type = #{indexType},</if>
<if test="qcTool != null">qc_tool = #{qcTool},</if>
<if test="checkMethod != null">check_method = #{checkMethod},</if>
<if test="standerVal != null">stander_val = #{standerVal},</if>
<if test="unitOfMeasure != null">unit_of_measure = #{unitOfMeasure},</if>
<if test="thresholdMax != null">threshold_max = #{thresholdMax},</if>
<if test="thresholdMin != null">threshold_min = #{thresholdMin},</if>
<if test="docUrl != null">doc_url = #{docUrl},</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="deleteQcTemplateIndexByRecordId" parameterType="Long">
delete from qc_template_index where record_id = #{recordId}
</delete>
<delete id="deleteQcTemplateIndexByRecordIds" parameterType="String">
delete from qc_template_index where record_id in
<foreach item="recordId" collection="array" open="(" separator="," close=")">
#{recordId}
</foreach>
</delete>
</mapper>