|
|
|
@ -20,6 +20,8 @@
|
|
|
|
|
<result property="updateBy" column="update_by"/>
|
|
|
|
|
<result property="updateTime" column="update_time"/>
|
|
|
|
|
<result property="ratio" column="ratio" />
|
|
|
|
|
<result property="checkName" column="check_name"/>
|
|
|
|
|
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectQcDefectTypeVo">
|
|
|
|
@ -30,30 +32,29 @@
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectQcDefectTypeList" parameterType="QcDefectType" resultMap="QcDefectTypeResult">
|
|
|
|
|
<include refid="selectQcDefectTypeVo"/>
|
|
|
|
|
select qdt.defect_id, qdt.defect_code, qdt.defect_type, qdt.defect_subclass, qdt.defect_remark,
|
|
|
|
|
qdt.factory_code, qdt.attr1, qdt.attr2, qdt.attr3,
|
|
|
|
|
qdt.create_by, qdt.create_time, qdt.update_by, qdt.update_time,qdt.ratio,qct.check_name
|
|
|
|
|
from qc_defect_type qdt
|
|
|
|
|
left join qc_check_type qct on qdt.defect_type = qct.id
|
|
|
|
|
<where>
|
|
|
|
|
<if test="defectCode != null and defectCode != ''">and defect_code like concat('%', #{defectCode}, '%')
|
|
|
|
|
<if test="defectCode != null and defectCode != ''">and qdt.defect_code like concat('%', #{defectCode}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="defectType != null and defectType != ''">and defect_type like concat('%', #{defectType}, '%')
|
|
|
|
|
<if test="defectType != null and defectType != ''">and qdt.defect_type = #{defectType}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="defectSubclass != null and defectSubclass != ''">and defect_subclass like concat('%',
|
|
|
|
|
<if test="defectSubclass != null and defectSubclass != ''">and qdt.defect_subclass like concat('%',
|
|
|
|
|
#{defectSubclass}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="defectRemark != null and defectRemark != ''">and defect_remark = #{defectRemark}</if>
|
|
|
|
|
<if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if>
|
|
|
|
|
<if test="attr1 != null and attr1 != ''">and attr1 = #{attr1}</if>
|
|
|
|
|
<if test="attr2 != null and attr2 != ''">and attr2 = #{attr2}</if>
|
|
|
|
|
<if test="attr3 != null and attr3 != ''">and attr3 = #{attr3}</if>
|
|
|
|
|
<if test="delFlag != null and delFlag != ''">and del_flag = #{delFlag}</if>
|
|
|
|
|
<if test="createTimeStart != null ">and CONVERT(date,create_time) >= #{createTimeStart}</if>
|
|
|
|
|
<if test="createTimeEnd != null ">and #{createTimeEnd} >= CONVERT(date,create_time)</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">and create_by like concat('%', #{createBy}, '%')</if>
|
|
|
|
|
<if test="updateTimeStart != null ">and CONVERT(date,update_time) >= #{updateTimeStart}</if>
|
|
|
|
|
<if test="updateTimeEnd != null ">and #{updateTimeEnd} >= CONVERT(date,update_time)</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">and update_by like concat('%', #{updateBy}, '%')</if>
|
|
|
|
|
and del_flag = '0'
|
|
|
|
|
<if test="defectRemark != null and defectRemark != ''">and qdt.defect_remark = #{defectRemark}</if>
|
|
|
|
|
<if test="createTimeStart != null ">and CONVERT(date,qdt.create_time) >= #{createTimeStart}</if>
|
|
|
|
|
<if test="createTimeEnd != null ">and #{createTimeEnd} >= CONVERT(date,qdt.create_time)</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">and qdt.create_by like concat('%', #{createBy}, '%')</if>
|
|
|
|
|
<if test="updateTimeStart != null ">and CONVERT(date,qdt.update_time) >= #{updateTimeStart}</if>
|
|
|
|
|
<if test="updateTimeEnd != null ">and #{updateTimeEnd} >= CONVERT(date,qdt.update_time)</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">and qdt.update_by like concat('%', #{updateBy}, '%')</if>
|
|
|
|
|
and qdt.del_flag = '0' and qct.del_flag = '0'
|
|
|
|
|
</where>
|
|
|
|
|
ORDER BY create_time DESC
|
|
|
|
|
ORDER BY qct.check_name DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectQcDefectTypeByDefectId" parameterType="String" resultMap="QcDefectTypeResult">
|
|
|
|
@ -142,4 +143,7 @@
|
|
|
|
|
where defect_type = #{defectType}
|
|
|
|
|
order by defect_code
|
|
|
|
|
</select>
|
|
|
|
|
<select id="getCheckTypes" resultType="com.op.quality.domain.QcCheckType">
|
|
|
|
|
select id,check_name checkName from qc_check_type where del_flag = '0' order by type_code
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|
|
|
|
|