wangliang 9 months ago
parent
commit
edebd9b83e
1 changed files with 6 additions and 6 deletions
  1. 6 6
      sop-business/src/main/resources/mapper/TBDingApplyMapper.xml

+ 6 - 6
sop-business/src/main/resources/mapper/TBDingApplyMapper.xml

@@ -105,17 +105,17 @@
             <if test="dpr != null and !dpr.hasAdmin and !dpr.hasPmo">
                 <choose>
                     <when test="dpr.hasBusiness">
-                        AND tbs.service_lead_id = #{dpr.requestUserId}
+                        AND (tbs.service_lead_id = #{dpr.requestUserId} or EXISTS(SELECT 1 FROM t_f_flow_log tffl where tffl.flow_id = tfcfe.flow_id and tffl.approve_id = #{dpr.requestUserId}))
                     </when>
                     <otherwise>
                         <choose>
                             <when test="dpr.hasRegionManager">
-                                AND tbc.lead_id = #{dpr.requestUserId}
+                                AND (tbc.lead_id = #{dpr.requestUserId} or EXISTS(SELECT 1 FROM t_f_flow_log tffl where tffl.flow_id = tfcfe.flow_id and tffl.approve_id = #{dpr.requestUserId}))
                             </when>
                             <otherwise>
                                 <choose>
                                     <when test="dpr.hasRegionCoordinator">
-                                        AND tbc.region_coordinator_id = #{dpr.requestUserId}
+                                        AND (tbc.region_coordinator_id = #{dpr.requestUserId} or EXISTS(SELECT 1 FROM t_f_flow_log tffl where tffl.flow_id = tfcfe.flow_id and tffl.approve_id = #{dpr.requestUserId}))
                                     </when>
                                 </choose>
                             </otherwise>
@@ -238,17 +238,17 @@
             <if test="dpr != null and !dpr.hasAdmin and !dpr.hasPmo">
                 <choose>
                     <when test="dpr.hasBusiness">
-                        AND tbs.service_lead_id = #{dpr.requestUserId}
+                        AND (tbs.service_lead_id = #{dpr.requestUserId} or EXISTS(SELECT 1 FROM t_f_flow_log tffl where tffl.flow_id = tfcfe.flow_id and tffl.approve_id = #{dpr.requestUserId}))
                     </when>
                     <otherwise>
                         <choose>
                             <when test="dpr.hasRegionManager">
-                                AND tbc.lead_id = #{dpr.requestUserId}
+                                AND (tbc.lead_id = #{dpr.requestUserId} or EXISTS(SELECT 1 FROM t_f_flow_log tffl where tffl.flow_id = tfcfe.flow_id and tffl.approve_id = #{dpr.requestUserId}))
                             </when>
                             <otherwise>
                                 <choose>
                                     <when test="dpr.hasRegionCoordinator">
-                                        AND tbc.region_coordinator_id = #{dpr.requestUserId}
+                                        AND (tbc.region_coordinator_id = #{dpr.requestUserId} or EXISTS(SELECT 1 FROM t_f_flow_log tffl where tffl.flow_id = tfcfe.flow_id and tffl.approve_id = #{dpr.requestUserId}))
                                     </when>
                                 </choose>
                             </otherwise>