|
|
|
|
@ -5,109 +5,136 @@
|
|
|
|
|
<mapper namespace="com.aucma.base.mapper.BaseQualityInspectionItemMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap type="BaseQualityInspectionItem" id="BaseQualityInspectionItemResult">
|
|
|
|
|
<result property="objId" column="obj_id" />
|
|
|
|
|
<result property="qualityDefectCode" column="quality_defect_code" />
|
|
|
|
|
<result property="qualityDefectName" column="quality_defect_name" />
|
|
|
|
|
<result property="parentId" column="parent_id" />
|
|
|
|
|
<result property="materialCategories" column="material_categories" />
|
|
|
|
|
<result property="materialSubclass" column="material_subclass" />
|
|
|
|
|
<result property="plantCode" column="plant_code" />
|
|
|
|
|
<result property="remark" column="remark" />
|
|
|
|
|
<result property="isFlag" column="is_flag" />
|
|
|
|
|
<result property="createdBy" column="created_by" />
|
|
|
|
|
<result property="createdTime" column="created_time" />
|
|
|
|
|
<result property="updatedBy" column="updated_by" />
|
|
|
|
|
<result property="updatedTime" column="updated_time" />
|
|
|
|
|
<result property="objId" column="obj_id"/>
|
|
|
|
|
<result property="qualityDefectCode" column="quality_defect_code"/>
|
|
|
|
|
<result property="qualityDefectName" column="quality_defect_name"/>
|
|
|
|
|
<result property="parentId" column="parent_id"/>
|
|
|
|
|
<result property="materialCategories" column="material_categories"/>
|
|
|
|
|
<result property="materialSubclass" column="material_subclass"/>
|
|
|
|
|
<result property="plantCode" column="plant_code"/>
|
|
|
|
|
<result property="remark" column="remark"/>
|
|
|
|
|
<result property="isFlag" column="is_flag"/>
|
|
|
|
|
<result property="createdBy" column="created_by"/>
|
|
|
|
|
<result property="createdTime" column="created_time"/>
|
|
|
|
|
<result property="updatedBy" column="updated_by"/>
|
|
|
|
|
<result property="updatedTime" column="updated_time"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectBaseQualityInspectionItemVo">
|
|
|
|
|
select obj_id, quality_defect_code, quality_defect_name, parent_id, material_categories, material_subclass, plant_code, remark, is_flag, created_by, created_time, updated_by, updated_time from base_quality_inspection_item
|
|
|
|
|
select obj_id,
|
|
|
|
|
quality_defect_code,
|
|
|
|
|
quality_defect_name,
|
|
|
|
|
parent_id,
|
|
|
|
|
material_categories,
|
|
|
|
|
material_subclass,
|
|
|
|
|
plant_code,
|
|
|
|
|
remark,
|
|
|
|
|
is_flag,
|
|
|
|
|
created_by,
|
|
|
|
|
created_time,
|
|
|
|
|
updated_by,
|
|
|
|
|
updated_time
|
|
|
|
|
from base_quality_inspection_item
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectBaseQualityInspectionItemList" parameterType="BaseQualityInspectionItem" resultMap="BaseQualityInspectionItemResult">
|
|
|
|
|
<select id="selectBaseQualityInspectionItemList" parameterType="BaseQualityInspectionItem"
|
|
|
|
|
resultMap="BaseQualityInspectionItemResult">
|
|
|
|
|
<include refid="selectBaseQualityInspectionItemVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="qualityDefectCode != null and qualityDefectCode != ''"> and quality_defect_code = #{qualityDefectCode}</if>
|
|
|
|
|
<if test="qualityDefectName != null and qualityDefectName != ''"> and quality_defect_name like concat(concat('%', #{qualityDefectName}), '%')</if>
|
|
|
|
|
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
|
|
|
|
|
<if test="materialCategories != null and materialCategories != ''"> and material_categories = #{materialCategories}</if>
|
|
|
|
|
<if test="materialSubclass != null and materialSubclass != ''"> and material_subclass = #{materialSubclass}</if>
|
|
|
|
|
<if test="plantCode != null and plantCode != ''"> and plant_code = #{plantCode}</if>
|
|
|
|
|
<if test="isFlag != null "> and is_flag = #{isFlag}</if>
|
|
|
|
|
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
|
|
|
|
|
<if test="createdTime != null "> and created_time = #{createdTime}</if>
|
|
|
|
|
<if test="updatedBy != null and updatedBy != ''"> and updated_by = #{updatedBy}</if>
|
|
|
|
|
<if test="updatedTime != null "> and updated_time = #{updatedTime}</if>
|
|
|
|
|
<if test="qualityDefectCode != null and qualityDefectCode != ''">and quality_defect_code =
|
|
|
|
|
#{qualityDefectCode}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="qualityDefectName != null and qualityDefectName != ''">and quality_defect_name like
|
|
|
|
|
concat(concat('%', #{qualityDefectName}), '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="parentId != null and parentId != ''">and parent_id = #{parentId}</if>
|
|
|
|
|
<if test="materialCategories != null and materialCategories != ''">and material_categories =
|
|
|
|
|
#{materialCategories}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="materialSubclass != null and materialSubclass != ''">and material_subclass =
|
|
|
|
|
#{materialSubclass}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="plantCode != null and plantCode != ''">and plant_code = #{plantCode}</if>
|
|
|
|
|
<if test="isFlag != null ">and is_flag = #{isFlag}</if>
|
|
|
|
|
<if test="createdBy != null and createdBy != ''">and created_by = #{createdBy}</if>
|
|
|
|
|
<if test="createdTime != null ">and created_time = #{createdTime}</if>
|
|
|
|
|
<if test="updatedBy != null and updatedBy != ''">and updated_by = #{updatedBy}</if>
|
|
|
|
|
<if test="updatedTime != null ">and updated_time = #{updatedTime}</if>
|
|
|
|
|
</where>
|
|
|
|
|
order by quality_defect_code
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectBaseQualityInspectionItemByObjId" parameterType="Long" resultMap="BaseQualityInspectionItemResult">
|
|
|
|
|
<include refid="selectBaseQualityInspectionItemVo"/>
|
|
|
|
|
where obj_id = #{objId}
|
|
|
|
|
<select id="selectBaseQualityInspectionItemByObjId" parameterType="Long"
|
|
|
|
|
resultMap="BaseQualityInspectionItemResult">
|
|
|
|
|
<include refid="selectBaseQualityInspectionItemVo"/>
|
|
|
|
|
where obj_id = #{objId}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectBaseQualityInspectionItemParent" resultMap="BaseQualityInspectionItemResult">
|
|
|
|
|
<include refid="selectBaseQualityInspectionItemVo"/>
|
|
|
|
|
where PARENT_ID = 0
|
|
|
|
|
order by quality_defect_code
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertBaseQualityInspectionItem" parameterType="BaseQualityInspectionItem">
|
|
|
|
|
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
|
|
|
|
|
SELECT seq_base_quality_inspection.NEXTVAL as objId FROM DUAL
|
|
|
|
|
</selectKey>
|
|
|
|
|
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
|
|
|
|
|
SELECT seq_base_quality_inspection.NEXTVAL as objId FROM DUAL
|
|
|
|
|
</selectKey>
|
|
|
|
|
insert into base_quality_inspection_item
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="objId != null">obj_id,</if>
|
|
|
|
|
<if test="qualityDefectCode != null">quality_defect_code,</if>
|
|
|
|
|
<if test="qualityDefectName != null">quality_defect_name,</if>
|
|
|
|
|
<if test="parentId != null">parent_id,</if>
|
|
|
|
|
<if test="materialCategories != null">material_categories,</if>
|
|
|
|
|
<if test="materialSubclass != null">material_subclass,</if>
|
|
|
|
|
<if test="plantCode != null">plant_code,</if>
|
|
|
|
|
<if test="remark != null">remark,</if>
|
|
|
|
|
<if test="isFlag != null">is_flag,</if>
|
|
|
|
|
<if test="createdBy != null">created_by,</if>
|
|
|
|
|
<if test="createdTime != null">created_time,</if>
|
|
|
|
|
<if test="updatedBy != null">updated_by,</if>
|
|
|
|
|
<if test="updatedTime != null">updated_time,</if>
|
|
|
|
|
<if test="objId != null">obj_id,</if>
|
|
|
|
|
<if test="qualityDefectCode != null">quality_defect_code,</if>
|
|
|
|
|
<if test="qualityDefectName != null">quality_defect_name,</if>
|
|
|
|
|
<if test="parentId != null">parent_id,</if>
|
|
|
|
|
<if test="materialCategories != null">material_categories,</if>
|
|
|
|
|
<if test="materialSubclass != null">material_subclass,</if>
|
|
|
|
|
<if test="plantCode != null">plant_code,</if>
|
|
|
|
|
<if test="remark != null">remark,</if>
|
|
|
|
|
<if test="isFlag != null">is_flag,</if>
|
|
|
|
|
<if test="createdBy != null">created_by,</if>
|
|
|
|
|
<if test="createdTime != null">created_time,</if>
|
|
|
|
|
<if test="updatedBy != null">updated_by,</if>
|
|
|
|
|
<if test="updatedTime != null">updated_time,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="objId != null">#{objId},</if>
|
|
|
|
|
<if test="qualityDefectCode != null">#{qualityDefectCode},</if>
|
|
|
|
|
<if test="qualityDefectName != null">#{qualityDefectName},</if>
|
|
|
|
|
<if test="parentId != null">#{parentId},</if>
|
|
|
|
|
<if test="materialCategories != null">#{materialCategories},</if>
|
|
|
|
|
<if test="materialSubclass != null">#{materialSubclass},</if>
|
|
|
|
|
<if test="plantCode != null">#{plantCode},</if>
|
|
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
|
|
<if test="isFlag != null">#{isFlag},</if>
|
|
|
|
|
<if test="createdBy != null">#{createdBy},</if>
|
|
|
|
|
<if test="createdTime != null">#{createdTime},</if>
|
|
|
|
|
<if test="updatedBy != null">#{updatedBy},</if>
|
|
|
|
|
<if test="updatedTime != null">#{updatedTime},</if>
|
|
|
|
|
<if test="objId != null">#{objId},</if>
|
|
|
|
|
<if test="qualityDefectCode != null">#{qualityDefectCode},</if>
|
|
|
|
|
<if test="qualityDefectName != null">#{qualityDefectName},</if>
|
|
|
|
|
<if test="parentId != null">#{parentId},</if>
|
|
|
|
|
<if test="materialCategories != null">#{materialCategories},</if>
|
|
|
|
|
<if test="materialSubclass != null">#{materialSubclass},</if>
|
|
|
|
|
<if test="plantCode != null">#{plantCode},</if>
|
|
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
|
|
<if test="isFlag != null">#{isFlag},</if>
|
|
|
|
|
<if test="createdBy != null">#{createdBy},</if>
|
|
|
|
|
<if test="createdTime != null">#{createdTime},</if>
|
|
|
|
|
<if test="updatedBy != null">#{updatedBy},</if>
|
|
|
|
|
<if test="updatedTime != null">#{updatedTime},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateBaseQualityInspectionItem" parameterType="BaseQualityInspectionItem">
|
|
|
|
|
update base_quality_inspection_item
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="qualityDefectCode != null">quality_defect_code = #{qualityDefectCode},</if>
|
|
|
|
|
<if test="qualityDefectName != null">quality_defect_name = #{qualityDefectName},</if>
|
|
|
|
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
|
|
|
|
<if test="materialCategories != null">material_categories = #{materialCategories},</if>
|
|
|
|
|
<if test="materialSubclass != null">material_subclass = #{materialSubclass},</if>
|
|
|
|
|
<if test="plantCode != null">plant_code = #{plantCode},</if>
|
|
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
|
|
<if test="isFlag != null">is_flag = #{isFlag},</if>
|
|
|
|
|
<if test="createdBy != null">created_by = #{createdBy},</if>
|
|
|
|
|
<if test="createdTime != null">created_time = #{createdTime},</if>
|
|
|
|
|
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
|
|
|
|
|
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
|
|
|
|
|
<if test="qualityDefectCode != null">quality_defect_code = #{qualityDefectCode},</if>
|
|
|
|
|
<if test="qualityDefectName != null">quality_defect_name = #{qualityDefectName},</if>
|
|
|
|
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
|
|
|
|
<if test="materialCategories != null">material_categories = #{materialCategories},</if>
|
|
|
|
|
<if test="materialSubclass != null">material_subclass = #{materialSubclass},</if>
|
|
|
|
|
<if test="plantCode != null">plant_code = #{plantCode},</if>
|
|
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
|
|
<if test="isFlag != null">is_flag = #{isFlag},</if>
|
|
|
|
|
<if test="createdBy != null">created_by = #{createdBy},</if>
|
|
|
|
|
<if test="createdTime != null">created_time = #{createdTime},</if>
|
|
|
|
|
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
|
|
|
|
|
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where obj_id = #{objId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteBaseQualityInspectionItemByObjId" parameterType="Long">
|
|
|
|
|
delete from base_quality_inspection_item where obj_id = #{objId}
|
|
|
|
|
delete
|
|
|
|
|
from base_quality_inspection_item
|
|
|
|
|
where obj_id = #{objId}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteBaseQualityInspectionItemByObjIds" parameterType="String">
|
|
|
|
|
|