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

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

@ -6,6 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.io.Serial; import java.io.Serial;
import java.math.BigDecimal;
/** /**
* qc_inspection_item * qc_inspection_item
@ -48,7 +49,7 @@ public class QcInspectionItem extends TenantEntity {
private Long categoryId; private Long categoryId;
/** /**
* * ()
*/ */
private Long inspectionType; 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 @TableLogic
private String delFlag; 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 lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*; import jakarta.validation.constraints.*;
import java.math.BigDecimal;
/** /**
* qc_inspection_item * qc_inspection_item
* *
@ -47,7 +49,7 @@ public class QcInspectionItemBo extends BaseEntity {
private Long categoryId; private Long categoryId;
/** /**
* * ()
*/ */
private Long inspectionType; 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.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
@ -60,9 +61,9 @@ public class QcInspectionItemVo implements Serializable {
private Long categoryId; private Long categoryId;
/** /**
* * ()
*/ */
@ExcelProperty(value = "检测类型") @ExcelProperty(value = "检测类型")
private Long inspectionType; private Long inspectionType;
/** /**
@ -90,19 +91,19 @@ public class QcInspectionItemVo implements Serializable {
* *
*/ */
@ExcelProperty(value = "标准值") @ExcelProperty(value = "标准值")
private Long standardValue; private BigDecimal standardValue;
/** /**
* *
*/ */
@ExcelProperty(value = "控制上限") @ExcelProperty(value = "控制上限")
private Long upperLimit; private BigDecimal upperLimit;
/** /**
* *
*/ */
@ExcelProperty(value = "控制下限") @ExcelProperty(value = "控制下限")
private Long lowerLimit; private BigDecimal lowerLimit;
/** /**
* *
@ -114,13 +115,13 @@ public class QcInspectionItemVo implements Serializable {
* *
*/ */
@ExcelProperty(value = "规格上限") @ExcelProperty(value = "规格上限")
private Long specUpper; private BigDecimal specUpper;
/** /**
* *
*/ */
@ExcelProperty(value = "规格下限") @ExcelProperty(value = "规格下限")
private Long specLower; private BigDecimal specLower;
/** /**
* *
@ -148,4 +149,20 @@ public class QcInspectionItemVo implements Serializable {
private String isDefault; 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 * @param bo
* @return * @return
*/ */
List<QcInspectionItemCategoryVo> selectVoList(QcInspectionItemCategoryBo bo); List<QcInspectionItemCategoryVo> selectQcInspectionItemCategoryList(QcInspectionItemCategoryBo bo);
/** /**
* *
@ -29,6 +29,6 @@ public interface QcInspectionItemCategoryMapper extends BaseMapperPlus<QcInspect
* @param categoryId * @param categoryId
* @return * @return
*/ */
QcInspectionItemCategoryVo selectVoByCategoryId(Long categoryId); QcInspectionItemCategoryVo selectQcInspectionItemCategoryByCategoryId(Long categoryId);
} }

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

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

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

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

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

@ -21,7 +21,7 @@ public interface QcTemplateItemMapper extends BaseMapperPlus<QcTemplateItem, QcT
* @param bo * @param bo
* @return * @return
*/ */
List<QcTemplateItemVo> selectVoList(QcTemplateItemBo bo); List<QcTemplateItemVo> selectQcTemplateItemList(QcTemplateItemBo bo);
/** /**
* *
@ -29,6 +29,8 @@ public interface QcTemplateItemMapper extends BaseMapperPlus<QcTemplateItem, QcT
* @param templateItemId * @param templateItemId
* @return * @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 * @param bo
* @return * @return
*/ */
List<QcUnqualifiedRecordVo> selectVoList(QcUnqualifiedRecordBo bo); List<QcUnqualifiedRecordVo> selectQcUnqualifiedRecordList(QcUnqualifiedRecordBo bo);
/** /**
* *
@ -29,6 +29,6 @@ public interface QcUnqualifiedRecordMapper extends BaseMapperPlus<QcUnqualifiedR
* @param recordId * @param recordId
* @return * @return
*/ */
QcUnqualifiedRecordVo selectVoByRecordId(Long recordId); QcUnqualifiedRecordVo selectQcUnqualifiedRecordByRecordId(Long recordId);
} }

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

@ -1,5 +1,6 @@
package org.dromara.qms.service.impl; 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.MapstructUtils;
import org.dromara.common.core.utils.StringUtils; import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo; 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.github.yulichang.wrapper.MPJLambdaWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor; 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.springframework.stereotype.Service;
import org.dromara.qms.domain.bo.QcInspectionItemBo; import org.dromara.qms.domain.bo.QcInspectionItemBo;
import org.dromara.qms.domain.vo.QcInspectionItemVo; import org.dromara.qms.domain.vo.QcInspectionItemVo;
import org.dromara.qms.domain.QcInspectionItem; import org.dromara.qms.domain.QcInspectionItem;
import org.dromara.qms.mapper.QcInspectionItemMapper; import org.dromara.qms.mapper.QcInspectionItemMapper;
import org.dromara.qms.service.IQcInspectionItemService; import org.dromara.qms.service.IQcInspectionItemService;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Collection; import java.util.Collection;
@ -32,6 +43,9 @@ public class QcInspectionItemServiceImpl implements IQcInspectionItemService {
private final QcInspectionItemMapper baseMapper; 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(); Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<QcInspectionItem> lqw = JoinWrappers.lambda(QcInspectionItem.class) MPJLambdaWrapper<QcInspectionItem> lqw = JoinWrappers.lambda(QcInspectionItem.class)
.selectAll(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(bo.getItemId() != null, QcInspectionItem::getItemId, bo.getItemId())
.eq(StringUtils.isNotBlank(bo.getItemCode()), QcInspectionItem::getItemCode, bo.getItemCode()) .eq(StringUtils.isNotBlank(bo.getItemCode()), QcInspectionItem::getItemCode, bo.getItemCode())
.like(StringUtils.isNotBlank(bo.getItemName()), QcInspectionItem::getItemName, bo.getItemName()) .like(StringUtils.isNotBlank(bo.getItemName()), QcInspectionItem::getItemName, bo.getItemName())
@ -120,9 +142,35 @@ public class QcInspectionItemServiceImpl implements IQcInspectionItemService {
* @return * @return
*/ */
@Override @Override
@Transactional
public Boolean updateByBo(QcInspectionItemBo bo) { public Boolean updateByBo(QcInspectionItemBo bo) {
QcInspectionItem update = MapstructUtils.convert(bo, QcInspectionItem.class); QcInspectionItem update = MapstructUtils.convert(bo, QcInspectionItem.class);
validEntityBeforeSave(update); 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; return baseMapper.updateById(update) > 0;
} }

@ -1,5 +1,6 @@
package org.dromara.qms.service.impl; 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.MapstructUtils;
import org.dromara.common.core.utils.StringUtils; import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo; 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.domain.QcTemplateItem;
import org.dromara.qms.mapper.QcTemplateItemMapper; import org.dromara.qms.mapper.QcTemplateItemMapper;
import org.dromara.qms.service.IQcTemplateItemService; import org.dromara.qms.service.IQcTemplateItemService;
import org.springframework.util.ObjectUtils;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -143,6 +145,14 @@ public class QcTemplateItemServiceImpl implements IQcTemplateItemService {
*/ */
private void validEntityBeforeSave(QcTemplateItem entity){ private void validEntityBeforeSave(QcTemplateItem entity){
//TODO 做一些数据校验,如唯一约束 //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"> <resultMap type="QcInspectionItemCategory" id="QcInspectionItemCategoryResult">
<result property="categoryId" column="category_id" /> <result property="categoryId" column="category_id" />
<result property="tenantId" column="tenant_id" />
<result property="parentId" column="parent_id" /> <result property="parentId" column="parent_id" />
<result property="ancestors" column="ancestors" /> <result property="ancestors" column="ancestors" />
<result property="categoryCode" column="category_code" /> <result property="categoryCode" column="category_code" />
@ -24,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectQcInspectionItemCategoryVo"> <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 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 from qc_inspection_item_category
where del_flag = '0'
</sql> </sql>
<select id="selectQcInspectionItemCategoryList" parameterType="QcInspectionItemCategory" resultMap="QcInspectionItemCategoryResult"> <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"> <select id="selectQcInspectionItemCategoryByCategoryId" parameterType="Long" resultMap="QcInspectionItemCategoryResult">
<include refid="selectQcInspectionItemCategoryVo"/> <include refid="selectQcInspectionItemCategoryVo"/>
where category_id = #{categoryId} where category_id = #{categoryId}
AND del_flag = '0'
</select> </select>
</mapper> </mapper>

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

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

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

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

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

@ -4,9 +4,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.dromara.qms.mapper.QcTemplateItemMapper"> <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="templateItemId" column="template_item_id" />
<result property="tenantId" column="tenant_id" />
<result property="templateId" column="template_id" /> <result property="templateId" column="template_id" />
<result property="itemId" column="item_id" /> <result property="itemId" column="item_id" />
<result property="itemCode" column="item_code" /> <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="specUpper" column="spec_upper" />
<result property="specLower" column="spec_lower" /> <result property="specLower" column="spec_lower" />
<result property="description" column="description" /> <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> </resultMap>
<sql id="selectQcTemplateItemVo"> <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 from qc_template_item
</sql> </sql>
@ -57,6 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="specLower != null "> and spec_lower = #{specLower}</if> <if test="specLower != null "> and spec_lower = #{specLower}</if>
<if test="description != null and description != ''"> and description = #{description}</if> <if test="description != null and description != ''"> and description = #{description}</if>
</where> </where>
AND del_flag = '0'
</select> </select>
<select id="selectQcTemplateItemByTemplateItemId" parameterType="Long" resultMap="QcTemplateItemResult"> <select id="selectQcTemplateItemByTemplateItemId" parameterType="Long" resultMap="QcTemplateItemResult">
@ -64,4 +59,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where template_item_id = #{templateItemId} where template_item_id = #{templateItemId}
</select> </select>
<select id="selectQcTemplateItemByItemId" parameterType="Long" resultMap="QcTemplateItemResult">
<include refid="selectQcTemplateItemVo"/>
where item_id = #{itemId}
AND del_flag = '0'
</select>
</mapper> </mapper>

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

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

Loading…
Cancel
Save