Browse Source

会员可视化表去重与优化

anderx 11 months ago
parent
commit
efa8e35436
1 changed files with 9 additions and 2 deletions
  1. 9 2
      src/main/java/com/goafanti/common/mapper/TaskDetailsMapper.xml

+ 9 - 2
src/main/java/com/goafanti/common/mapper/TaskDetailsMapper.xml

@@ -1277,6 +1277,7 @@ feature_other = values(feature_other)
 
     <select id="selectTaskDetailsList" resultMap="TaskDetailsMap">
         select
+        distinct
         a.*
         from task_details a
         <include refid="selectTaskDetailsSql"/>
@@ -1286,15 +1287,21 @@ feature_other = values(feature_other)
     </select>
     <sql id="selectTaskDetailsSql">
         left join t_order_task b on a.id =b.progress_tid
+        <if test="roleStatus ==2">
         left join admin c on b.task_receiver=c.id
+        </if>
+        <if test="userName != null and userName != ''">
         left join t_order_mid d on b.order_no=d.order_no
+        </if>
+        <if test="contractNo !=null">
         left join t_order_new e on b.order_no=e.order_no
+        </if>
         <if test="serviceYear !=null">
             left join t_task_member f on b.id=f.tid
         </if>
         <where>
             <if test="roleStatus ==1">
-                and c.id= #{aid}
+                and b.task_receiver= #{aid}
             </if>
             <if test="roleStatus ==2">
                 and c.superior_id= #{aid}
@@ -1359,7 +1366,7 @@ feature_other = values(feature_other)
     </sql>
     <select id="selectTaskDetailsCount" resultType="java.lang.Integer">
         select
-        count(*)
+        count(distinct a.id)
         from task_details a
         <include refid="selectTaskDetailsSql"/>
     </select>