|
@@ -3,20 +3,6 @@
|
|
|
<mapper namespace="com.qmth.sop.business.mapper.TBQualityProblemApplyMapper">
|
|
|
|
|
|
<select id="query" resultType="com.qmth.sop.business.bean.result.TBQualityProblemApplyResult">
|
|
|
-<!-- SELECT-->
|
|
|
-<!-- a.*,-->
|
|
|
-<!-- u.real_name user_name,-->
|
|
|
-<!-- cu.real_name create_name,-->
|
|
|
-<!-- si.type sop_type,-->
|
|
|
-<!-- sc.NAME custom,-->
|
|
|
-<!-- sc.type custom_type-->
|
|
|
-<!-- FROM-->
|
|
|
-<!-- t_b_quality_problem_apply a-->
|
|
|
-<!-- LEFT JOIN sys_user u ON u.id = a.user_id-->
|
|
|
-<!-- LEFT JOIN sys_user cu ON cu.id = a.create_id-->
|
|
|
-<!-- LEFT JOIN t_b_sop_info si ON si.crm_no = a.crm_no-->
|
|
|
-<!-- AND si.sop_no = a.sop_no-->
|
|
|
-<!-- LEFT JOIN sys_custom sc ON sc.id = si.custom_id-->
|
|
|
SELECT
|
|
|
distinct a.*,
|
|
|
si.type sopType,
|
|
@@ -37,8 +23,7 @@
|
|
|
where find_in_set(us1.id, (select tffl.pend_approve_id from t_f_flow_log tffl where tffl.flow_id = fe.flow_id order by tffl.create_time desc limit 1))) pend_approve_users
|
|
|
FROM
|
|
|
t_b_quality_problem_apply a
|
|
|
- LEFT JOIN t_b_sop_info si ON si.crm_no = a.crm_no
|
|
|
- AND si.sop_no = a.sop_no
|
|
|
+ LEFT JOIN t_b_sop_info si on si.sop_no = a.sop_no
|
|
|
LEFT JOIN sys_custom sc ON sc.id = si.custom_id
|
|
|
LEFT JOIN t_f_custom_flow_entity fe ON fe.`code`= a.problem_no
|
|
|
LEFT JOIN t_f_flow_approve fa ON fa.flow_id = fe.flow_id
|
|
@@ -57,10 +42,10 @@
|
|
|
and a.type = #{type}
|
|
|
</if>
|
|
|
<if test="reason != null and reason != ''">
|
|
|
- and sc.reason = #{reason}
|
|
|
+ and a.reason = #{reason}
|
|
|
</if>
|
|
|
<if test="degree != null and degree != ''">
|
|
|
- and sc.influence_degree = #{degree}
|
|
|
+ and a.influence_degree = #{degree}
|
|
|
</if>
|
|
|
<if test="custom != null and custom != ''">
|
|
|
and sc.name like concat('%', #{custom} , '%')
|