refactor(qms): 重构检测项定义相关代码

- 更新相关 mapper 和 XML 文件
- 修正mapper的命名;删去xml的结果:租户id返回VO;xml的sql语句加上逻辑删除的条件判断
- 修改检测项定义实体类,将标准值、上下限等字段类型从 Long 改为 BigDecimal
-增加检测项类别名称、检测类型编码等关联字段
- 优化模板项服务实现,增加同一主表下检测项不能重复的校验
hwmom-htk
zch 6 months ago
parent 5995918c08
commit 1a3d3ebb69

@ -6,6 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
import java.math.BigDecimal;
/**
* qc_inspection_item
@ -48,7 +49,7 @@ public class QcInspectionItem extends TenantEntity {
private Long categoryId;
/**
*
* ()
*/
private Long inspectionType;
@ -70,17 +71,17 @@ public class QcInspectionItem extends TenantEntity {
/**
*
*/
private Long standardValue;
private BigDecimal standardValue;
/**
*
*/
private Long upperLimit;
private BigDecimal upperLimit;
/**
*
*/
private Long lowerLimit;
private BigDecimal lowerLimit;
/**
*
@ -90,12 +91,12 @@ public class QcInspectionItem extends TenantEntity {
/**
*
*/
private Long specUpper;
private BigDecimal specUpper;
/**
*
*/
private Long specLower;
private BigDecimal specLower;
/**
*
@ -123,5 +124,23 @@ public class QcInspectionItem extends TenantEntity {
@TableLogic
private String delFlag;
/**
*
*/
@TableField(exist = false)
private String categoryName;//JOIN
/**
*
*/
@TableField(exist = false)
private String typeCode;//join
/**
*
*/
@TableField(exist = false)
private String typeName;//join
}

@ -9,6 +9,8 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
import java.math.BigDecimal;
/**
* qc_inspection_item
*
@ -47,7 +49,7 @@ public class QcInspectionItemBo extends BaseEntity {
private Long categoryId;
/**
*
* ()
*/
private Long inspectionType;
@ -69,17 +71,17 @@ public class QcInspectionItemBo extends BaseEntity {
/**
*
*/
private Long standardValue;
private BigDecimal standardValue;
/**
*
*/
private Long upperLimit;
private BigDecimal upperLimit;
/**
*
*/
private Long lowerLimit;
private BigDecimal lowerLimit;
/**
*
@ -89,12 +91,12 @@ public class QcInspectionItemBo extends BaseEntity {
/**
*
*/
private Long specUpper;
private BigDecimal specUpper;
/**
*
*/
private Long specLower;
private BigDecimal specLower;
/**
*

@ -10,6 +10,7 @@ import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@ -60,9 +61,9 @@ public class QcInspectionItemVo implements Serializable {
private Long categoryId;
/**
*
* ()
*/
@ExcelProperty(value = "检测类型")
@ExcelProperty(value = "检测类型")
private Long inspectionType;
/**
@ -90,19 +91,19 @@ public class QcInspectionItemVo implements Serializable {
*
*/
@ExcelProperty(value = "标准值")
private Long standardValue;
private BigDecimal standardValue;
/**
*
*/
@ExcelProperty(value = "控制上限")
private Long upperLimit;
private BigDecimal upperLimit;
/**
*
*/
@ExcelProperty(value = "控制下限")
private Long lowerLimit;
private BigDecimal lowerLimit;
/**
*
@ -114,13 +115,13 @@ public class QcInspectionItemVo implements Serializable {
*
*/
@ExcelProperty(value = "规格上限")
private Long specUpper;
private BigDecimal specUpper;
/**
*
*/
@ExcelProperty(value = "规格下限")
private Long specLower;
private BigDecimal specLower;
/**
*
@ -148,4 +149,20 @@ public class QcInspectionItemVo implements Serializable {
private String isDefault;
/**
*
*/
private String categoryName;//JOIN
/**
*
*/
private String typeCode;//join
/**
*
*/
private String typeName;//join
}

@ -21,7 +21,7 @@ public interface QcInspectionItemCategoryMapper extends BaseMapperPlus<QcInspect
* @param bo
* @return
*/
List<QcInspectionItemCategoryVo> selectVoList(QcInspectionItemCategoryBo bo);
List<QcInspectionItemCategoryVo> selectQcInspectionItemCategoryList(QcInspectionItemCategoryBo bo);
/**
*
@ -29,6 +29,6 @@ public interface QcInspectionItemCategoryMapper extends BaseMapperPlus<QcInspect
* @param categoryId
* @return
*/
QcInspectionItemCategoryVo selectVoByCategoryId(Long categoryId);
QcInspectionItemCategoryVo selectQcInspectionItemCategoryByCategoryId(Long categoryId);
}

@ -21,7 +21,7 @@ public interface QcInspectionItemMapper extends BaseMapperPlus<QcInspectionItem,
* @param bo
* @return
*/
List<QcInspectionItemVo> selectVoList(QcInspectionItemBo bo);
List<QcInspectionItemVo> selectQcInspectionItemList(QcInspectionItemBo bo);
/**
*
@ -29,6 +29,6 @@ public interface QcInspectionItemMapper extends BaseMapperPlus<QcInspectionItem,
* @param itemId
* @return
*/
QcInspectionItemVo selectVoByItemId(Long itemId);
QcInspectionItemVo selectQcInspectionItemByItemId(Long itemId);
}

@ -21,7 +21,7 @@ public interface QcInspectionMainMapper extends BaseMapperPlus<QcInspectionMain,
* @param bo
* @return
*/
List<QcInspectionMainVo> selectVoList(QcInspectionMainBo bo);
List<QcInspectionMainVo> selectQcInspectionMainList(QcInspectionMainBo bo);
/**
*
@ -29,6 +29,6 @@ public interface QcInspectionMainMapper extends BaseMapperPlus<QcInspectionMain,
* @param inspectionId
* @return
*/
QcInspectionMainVo selectVoByInspectionId(Long inspectionId);
QcInspectionMainVo selectQcInspectionMainByInspectionId(Long inspectionId);
}

@ -21,7 +21,7 @@ public interface QcInspectionResultMapper extends BaseMapperPlus<QcInspectionRes
* @param bo
* @return
*/
List<QcInspectionResultVo> selectVoList(QcInspectionResultBo bo);
List<QcInspectionResultVo> selectQcInspectionResultList(QcInspectionResultBo bo);
/**
*
@ -29,6 +29,6 @@ public interface QcInspectionResultMapper extends BaseMapperPlus<QcInspectionRes
* @param resultId
* @return
*/
QcInspectionResultVo selectVoByResultId(Long resultId);
QcInspectionResultVo selectQcInspectionResultByResultId(Long resultId);
}

@ -21,7 +21,7 @@ public interface QcInspectionTemplateMapper extends BaseMapperPlus<QcInspectionT
* @param bo
* @return
*/
List<QcInspectionTemplateVo> selectVoList(QcInspectionTemplateBo bo);
List<QcInspectionTemplateVo> selectQcInspectionTemplateList(QcInspectionTemplateBo bo);
/**
*
@ -29,6 +29,6 @@ public interface QcInspectionTemplateMapper extends BaseMapperPlus<QcInspectionT
* @param templateId
* @return
*/
QcInspectionTemplateVo selectVoByTemplateId(Long templateId);
QcInspectionTemplateVo selectQcInspectionTemplateByTemplateId(Long templateId);
}

@ -21,7 +21,7 @@ public interface QcInspectionTypeMapper extends BaseMapperPlus<QcInspectionType,
* @param bo
* @return
*/
List<QcInspectionTypeVo> selectVoList(QcInspectionTypeBo bo);
List<QcInspectionTypeVo> selectQcInspectionTypeList(QcInspectionTypeBo bo);
/**
*
@ -29,6 +29,6 @@ public interface QcInspectionTypeMapper extends BaseMapperPlus<QcInspectionType,
* @param typeId
* @return
*/
QcInspectionTypeVo selectVoByTypeId(Long typeId);
QcInspectionTypeVo selectQcInspectionTypeByTypeId(Long typeId);
}

@ -21,7 +21,7 @@ public interface QcTemplateItemMapper extends BaseMapperPlus<QcTemplateItem, QcT
* @param bo
* @return
*/
List<QcTemplateItemVo> selectVoList(QcTemplateItemBo bo);
List<QcTemplateItemVo> selectQcTemplateItemList(QcTemplateItemBo bo);
/**
*
@ -29,6 +29,8 @@ public interface QcTemplateItemMapper extends BaseMapperPlus<QcTemplateItem, QcT
* @param templateItemId
* @return
*/
QcTemplateItemVo selectVoByTemplateItemId(Long templateItemId);
QcTemplateItemVo selectQcTemplateItemByTemplateItemId(Long templateItemId);
QcTemplateItemVo selectQcTemplateItemByItemId(Long itemId);
}

@ -21,7 +21,7 @@ public interface QcUnqualifiedRecordMapper extends BaseMapperPlus<QcUnqualifiedR
* @param bo
* @return
*/
List<QcUnqualifiedRecordVo> selectVoList(QcUnqualifiedRecordBo bo);
List<QcUnqualifiedRecordVo> selectQcUnqualifiedRecordList(QcUnqualifiedRecordBo bo);
/**
*
@ -29,6 +29,6 @@ public interface QcUnqualifiedRecordMapper extends BaseMapperPlus<QcUnqualifiedR
* @param recordId
* @return
*/
QcUnqualifiedRecordVo selectVoByRecordId(Long recordId);
QcUnqualifiedRecordVo selectQcUnqualifiedRecordByRecordId(Long recordId);
}

@ -21,7 +21,7 @@ public interface QcUnqualifiedReviewMapper extends BaseMapperPlus<QcUnqualifiedR
* @param bo
* @return
*/
List<QcUnqualifiedReviewVo> selectVoList(QcUnqualifiedReviewBo bo);
List<QcUnqualifiedReviewVo> selectQcUnqualifiedReviewList(QcUnqualifiedReviewBo bo);
/**
*
@ -29,6 +29,6 @@ public interface QcUnqualifiedReviewMapper extends BaseMapperPlus<QcUnqualifiedR
* @param reviewId
* @return
*/
QcUnqualifiedReviewVo selectVoByReviewId(Long reviewId);
QcUnqualifiedReviewVo selectQcUnqualifiedReviewByReviewId(Long reviewId);
}

@ -1,5 +1,6 @@
package org.dromara.qms.service.impl;
import cn.hutool.core.bean.BeanUtil;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
@ -9,13 +10,23 @@ import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.dromara.qms.domain.QcInspectionItemCategory;
import org.dromara.qms.domain.QcInspectionType;
import org.dromara.qms.domain.QcTemplateItem;
import org.dromara.qms.domain.bo.QcTemplateItemBo;
import org.dromara.qms.domain.vo.QcTemplateItemVo;
import org.dromara.qms.mapper.QcTemplateItemMapper;
import org.dromara.qms.service.IQcTemplateItemService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.dromara.qms.domain.bo.QcInspectionItemBo;
import org.dromara.qms.domain.vo.QcInspectionItemVo;
import org.dromara.qms.domain.QcInspectionItem;
import org.dromara.qms.mapper.QcInspectionItemMapper;
import org.dromara.qms.service.IQcInspectionItemService;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Collection;
@ -32,6 +43,9 @@ public class QcInspectionItemServiceImpl implements IQcInspectionItemService {
private final QcInspectionItemMapper baseMapper;
private final QcTemplateItemMapper qcTemplateItemMapper;
private final IQcTemplateItemService qcTemplateItemService;
/**
*
*
@ -73,6 +87,14 @@ public class QcInspectionItemServiceImpl implements IQcInspectionItemService {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<QcInspectionItem> lqw = JoinWrappers.lambda(QcInspectionItem.class)
.selectAll(QcInspectionItem.class)
//检测项类别名称
.select(QcInspectionItemCategory::getCategoryName)
.leftJoin(QcInspectionItemCategory.class,QcInspectionItemCategory::getCategoryId,QcInspectionItem::getCategoryId)
.select(QcInspectionType::getTypeName,QcInspectionType::getTypeCode)
.leftJoin(QcInspectionType.class,QcInspectionType::getTypeId,QcInspectionItem::getInspectionType)
.eq(bo.getItemId() != null, QcInspectionItem::getItemId, bo.getItemId())
.eq(StringUtils.isNotBlank(bo.getItemCode()), QcInspectionItem::getItemCode, bo.getItemCode())
.like(StringUtils.isNotBlank(bo.getItemName()), QcInspectionItem::getItemName, bo.getItemName())
@ -120,9 +142,35 @@ public class QcInspectionItemServiceImpl implements IQcInspectionItemService {
* @return
*/
@Override
@Transactional
public Boolean updateByBo(QcInspectionItemBo bo) {
QcInspectionItem update = MapstructUtils.convert(bo, QcInspectionItem.class);
validEntityBeforeSave(update);
// 创建一个新的QcTemplateItemBo对象
QcTemplateItem qcTemplateItem = new QcTemplateItem();
QcTemplateItemVo newQcTemplateItem = qcTemplateItemMapper.selectQcTemplateItemByItemId(update.getItemId());
newQcTemplateItem.setItemCode(update.getItemCode());
newQcTemplateItem.setItemName(update.getItemName());
newQcTemplateItem.setInspectionItemCode(update.getItemCode());
newQcTemplateItem.setInspectionItemName(update.getItemName());
newQcTemplateItem.setInspectionPosition(update.getInspectionPosition());
newQcTemplateItem.setCategoryName(update.getCategoryName());
newQcTemplateItem.setInspectionType(update.getInspectionType());
newQcTemplateItem.setDetectType(update.getDetectType());
newQcTemplateItem.setControlType(update.getControlType());
newQcTemplateItem.setStandardValue(update.getStandardValue());
newQcTemplateItem.setUpperLimit(update.getUpperLimit());
newQcTemplateItem.setLowerLimit(update.getLowerLimit());
newQcTemplateItem.setSpecName(update.getSpecName());
newQcTemplateItem.setSpecUpper(update.getSpecUpper());
newQcTemplateItem.setSpecLower(update.getSpecLower());
newQcTemplateItem.setDescription(update.getDescription());
BeanUtils.copyProperties(newQcTemplateItem, qcTemplateItem);
// qcTemplateItemService.updateByBo(qcTemplateItemBo);
qcTemplateItemMapper.updateById(qcTemplateItem);
return baseMapper.updateById(update) > 0;
}

@ -1,5 +1,6 @@
package org.dromara.qms.service.impl;
import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
@ -18,6 +19,7 @@ import org.dromara.qms.domain.vo.QcTemplateItemVo;
import org.dromara.qms.domain.QcTemplateItem;
import org.dromara.qms.mapper.QcTemplateItemMapper;
import org.dromara.qms.service.IQcTemplateItemService;
import org.springframework.util.ObjectUtils;
import java.util.List;
import java.util.Map;
@ -143,6 +145,14 @@ public class QcTemplateItemServiceImpl implements IQcTemplateItemService {
*/
private void validEntityBeforeSave(QcTemplateItem entity){
//TODO 做一些数据校验,如唯一约束
//同一主表下的检测项不能重复
QcTemplateItemBo query = new QcTemplateItemBo();
query.setTemplateId(entity.getTemplateId());
query.setItemId(entity.getItemId());
List<QcTemplateItemVo> list = queryList(query);
if ( !ObjectUtils.isEmpty(list)) {
throw new ServiceException("同一主表下的检测项不能重复");
}
}
/**

@ -6,7 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="QcInspectionItemCategory" id="QcInspectionItemCategoryResult">
<result property="categoryId" column="category_id" />
<result property="tenantId" column="tenant_id" />
<result property="parentId" column="parent_id" />
<result property="ancestors" column="ancestors" />
<result property="categoryCode" column="category_code" />
@ -24,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectQcInspectionItemCategoryVo">
select category_id, tenant_id, parent_id, ancestors, category_code, category_name, type_id, description, create_by, create_dept, create_time, update_by, update_time, del_flag
from qc_inspection_item_category
where del_flag = '0'
</sql>
<select id="selectQcInspectionItemCategoryList" parameterType="QcInspectionItemCategory" resultMap="QcInspectionItemCategoryResult">
@ -42,6 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectQcInspectionItemCategoryByCategoryId" parameterType="Long" resultMap="QcInspectionItemCategoryResult">
<include refid="selectQcInspectionItemCategoryVo"/>
where category_id = #{categoryId}
AND del_flag = '0'
</select>
</mapper>

@ -6,7 +6,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="QcInspectionItem" id="QcInspectionItemResult">
<result property="itemId" column="item_id" />
<result property="tenantId" column="tenant_id" />
<result property="itemCode" column="item_code" />
<result property="itemName" column="item_name" />
<result property="inspectionPosition" column="inspection_position" />
@ -61,11 +60,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="optionName != null and optionName != ''"> and option_name like concat('%', #{optionName}, '%')</if>
<if test="isDefault != null and isDefault != ''"> and is_default = #{isDefault}</if>
</where>
AND del_flag = '0'
</select>
<select id="selectQcInspectionItemByItemId" parameterType="Long" resultMap="QcInspectionItemResult">
<include refid="selectQcInspectionItemVo"/>
where item_id = #{itemId}
AND del_flag = '0'
</select>
</mapper>

@ -6,7 +6,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="QcInspectionMain" id="QcInspectionMainResult">
<result property="inspectionId" column="inspection_id" />
<result property="tenantId" column="tenant_id" />
<result property="inspectionNo" column="inspection_no" />
<result property="materialCode" column="material_code" />
<result property="materialType" column="material_type" />
@ -68,11 +67,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="barcode != null and barcode != ''"> and barcode = #{barcode}</if>
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
</where>
AND del_flag = '0'
</select>
<select id="selectQcInspectionMainByInspectionId" parameterType="Long" resultMap="QcInspectionMainResult">
<include refid="selectQcInspectionMainVo"/>
where inspection_id = #{inspectionId}
AND del_flag = '0'
</select>
</mapper>

@ -6,7 +6,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="QcInspectionResult" id="QcInspectionResultResult">
<result property="resultId" column="result_id" />
<result property="tenantId" column="tenant_id" />
<result property="inspectionId" column="inspection_id" />
<result property="itemId" column="item_id" />
<result property="detectResult" column="detect_result" />
@ -37,11 +36,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="specInspection != null and specInspection != ''"> and spec_inspection = #{specInspection}</if>
<if test="problemDetail != null and problemDetail != ''"> and problem_detail = #{problemDetail}</if>
</where>
AND del_flag = '0'
</select>
<select id="selectQcInspectionResultByResultId" parameterType="Long" resultMap="QcInspectionResultResult">
<include refid="selectQcInspectionResultVo"/>
where result_id = #{resultId}
AND del_flag = '0'
</select>
</mapper>

@ -6,7 +6,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="QcInspectionTemplate" id="QcInspectionTemplateResult">
<result property="templateId" column="template_id" />
<result property="tenantId" column="tenant_id" />
<result property="templateCode" column="template_code" />
<result property="templateName" column="template_name" />
<result property="materialCode" column="material_code" />
@ -49,11 +48,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
<if test="description != null and description != ''"> and description = #{description}</if>
</where>
AND del_flag = '0'
</select>
<select id="selectQcInspectionTemplateByTemplateId" parameterType="Long" resultMap="QcInspectionTemplateResult">
<include refid="selectQcInspectionTemplateVo"/>
where template_id = #{templateId}
AND del_flag = '0'
</select>
</mapper>

@ -6,7 +6,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="QcInspectionType" id="QcInspectionTypeResult">
<result property="typeId" column="type_id" />
<result property="tenantId" column="tenant_id" />
<result property="typeCode" column="type_code" />
<result property="typeName" column="type_name" />
<result property="qcInspectionType" column="qc_inspection_type" />
@ -33,11 +32,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="qcInspectionType != null "> and qc_inspection_type = #{qcInspectionType}</if>
<if test="createMethod != null "> and create_method = #{createMethod}</if>
</where>
AND del_flag = '0'
</select>
<select id="selectQcInspectionTypeByTypeId" parameterType="Long" resultMap="QcInspectionTypeResult">
<include refid="selectQcInspectionTypeVo"/>
where type_id = #{typeId}
AND del_flag = '0'
</select>
</mapper>

@ -4,9 +4,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.dromara.qms.mapper.QcTemplateItemMapper">
<resultMap type="QcTemplateItem" id="QcTemplateItemResult">
<resultMap type="org.dromara.qms.domain.vo.QcTemplateItemVo" id="QcTemplateItemResult">
<result property="templateItemId" column="template_item_id" />
<result property="tenantId" column="tenant_id" />
<result property="templateId" column="template_id" />
<result property="itemId" column="item_id" />
<result property="itemCode" column="item_code" />
@ -23,16 +22,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="specUpper" column="spec_upper" />
<result property="specLower" column="spec_lower" />
<result property="description" column="description" />
<result property="createDept" column="create_dept" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectQcTemplateItemVo">
select template_item_id, tenant_id, template_id, item_id, item_code, item_name, inspection_position, category_name, inspection_type, detect_type, control_type, standard_value, upper_limit, lower_limit, spec_name, spec_upper, spec_lower, description, create_dept, create_by, create_time, update_by, update_time, del_flag
select template_item_id, tenant_id, template_id, item_id, item_code, item_name, inspection_position, category_name, inspection_type, detect_type, control_type, standard_value, upper_limit, lower_limit, spec_name, spec_upper, spec_lower, description, del_flag
from qc_template_item
</sql>
@ -57,6 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="specLower != null "> and spec_lower = #{specLower}</if>
<if test="description != null and description != ''"> and description = #{description}</if>
</where>
AND del_flag = '0'
</select>
<select id="selectQcTemplateItemByTemplateItemId" parameterType="Long" resultMap="QcTemplateItemResult">
@ -64,4 +59,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where template_item_id = #{templateItemId}
</select>
<select id="selectQcTemplateItemByItemId" parameterType="Long" resultMap="QcTemplateItemResult">
<include refid="selectQcTemplateItemVo"/>
where item_id = #{itemId}
AND del_flag = '0'
</select>
</mapper>

@ -4,9 +4,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.dromara.qms.mapper.QcUnqualifiedRecordMapper">
<resultMap type="QcUnqualifiedRecord" id="QcUnqualifiedRecordResult">
<resultMap type="QcUnqualifiedRecordVo" id="QcUnqualifiedRecordResult">
<result property="recordId" column="record_id" />
<result property="tenantId" column="tenant_id" />
<result property="reviewId" column="review_id" />
<result property="remark" column="remark" />
<result property="createDept" column="create_dept" />
@ -28,11 +27,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="recordId != null "> and record_id = #{recordId}</if>
<if test="reviewId != null "> and review_id = #{reviewId}</if>
</where>
AND del_flag = '0'
</select>
<select id="selectQcUnqualifiedRecordByRecordId" parameterType="Long" resultMap="QcUnqualifiedRecordResult">
<include refid="selectQcUnqualifiedRecordVo"/>
where record_id = #{recordId}
AND del_flag = '0'
</select>
</mapper>

@ -6,7 +6,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="QcUnqualifiedReview" id="QcUnqualifiedReviewResult">
<result property="reviewId" column="review_id" />
<result property="tenantId" column="tenant_id" />
<result property="unqualifiedNo" column="unqualified_no" />
<result property="inspectionId" column="inspection_id" />
<result property="typeId" column="type_id" />
@ -51,11 +50,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="reviewer != null and reviewer != ''"> and reviewer = #{reviewer}</if>
<if test="reviewTime != null "> and review_time = #{reviewTime}</if>
</where>
AND del_flag = '0'
</select>
<select id="selectQcUnqualifiedReviewByReviewId" parameterType="Long" resultMap="QcUnqualifiedReviewResult">
<include refid="selectQcUnqualifiedReviewVo"/>
where review_id = #{reviewId}
AND del_flag = '0'
</select>
</mapper>

Loading…
Cancel
Save