<?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="org.jeecg.modules.qms.mapper.InspectionItemMapper">
|
|
|
<select id="queryList" resultType="map" parameterType="String">
|
SELECT
|
t1.id,
|
t1.item_code itemCode,
|
t1.item_name itemName,
|
t1.item_category itemCategory,
|
t1.qualitative_or_quantitative qualitativeOrQuantitative,
|
t1.inspection_tools inspectionTools,
|
t1.item_status itemStatus,
|
t1.create_time createTime,
|
t2.item_text itemCategoryName,
|
t3.item_text qualitativeOrQuantitativeName,
|
t1.remark,
|
t4.sorter,
|
t4.standard_value standardValue,
|
t4.max_value 'maxValue',
|
t4.min_value 'minValue',
|
t4.plan_id planId
|
FROM
|
qms_inspection_item t1
|
left join qms_inspection_plan_item t4 on t4.item_id = t1.id
|
LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'item_category' ) t2 ON t2.item_value = t1.item_category
|
left join ( SELECT * FROM v_sys_dict WHERE dict_code = 'qualitative_or_quantitative' ) t3 on t3.item_value = t1.qualitative_or_quantitative
|
${ew.customSqlSegment}
|
</select>
|
|
|
<select id="queryListByPlanId" resultType="map" parameterType="String">
|
SELECT
|
t1.id,
|
t1.item_code itemCode,
|
t1.item_name itemName,
|
t1.item_category itemCategory,
|
t1.qualitative_or_quantitative qualitativeOrQuantitative,
|
t1.inspection_tools inspectionTools,
|
t1.item_status itemStatus,
|
t1.create_time createTime,
|
t2.sorter,
|
t2.standard_value standardValue,
|
t2.min_value 'minValue',
|
t2.max_value 'maxValue',
|
t3.plan_code planCode,
|
t3.plan_name planName,
|
t3.material_number materialNumber,
|
t3.material_name materialName,
|
t6.item_text planCategoryName,
|
t4.item_text itemCategoryName,
|
t5.item_text qualitativeOrQuantitativeName,
|
t1.remark
|
FROM
|
qms_inspection_item t1
|
INNER JOIN qms_inspection_plan_item t2 ON t2.item_id = t1.id
|
INNER JOIN qms_inspection_plan t3 ON t3.id = t2.plan_id
|
LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'item_category' ) t4 ON t4.item_value = t1.item_category
|
LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'qualitative_or_quantitative' ) t5 ON t5.item_value = t1.qualitative_or_quantitative
|
LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'plan_category' ) t6 ON t6.item_value = t3.plan_category
|
${ew.customSqlSegment}
|
</select>
|
</mapper>
|