Browse Source

部门客户统计修改及新增字段

anderx 1 year ago
parent
commit
39bf0cf013
1 changed files with 9 additions and 38 deletions
  1. 9 38
      src/main/java/com/goafanti/common/mapper/AdminMapper.xml

+ 9 - 38
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -958,6 +958,13 @@
             )e on a.id=e.uid
         </if>
         where  a.type=1 and a.new_channel=0
+        <include refid="AdminCustomerDetailSql"/>
+        <if test="page_sql!=null">
+            ${page_sql}
+        </if>
+    </select>
+
+    <sql id="AdminCustomerDetailSql">
         <if test="type != 5 and type !=6">
             and a.aid=  #{aid,jdbcType=VARCHAR}
         </if>
@@ -997,10 +1004,7 @@
                 and  a.transfer_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
             </if>
         </if>
-        <if test="page_sql!=null">
-            ${page_sql}
-        </if>
-    </select>
+    </sql>
 
     <select id="selectAdminCustomerDetailCount" parameterType="java.lang.String" resultType="java.lang.Integer">
         select count(*)
@@ -1015,40 +1019,7 @@
             )e on a.id=e.uid
         </if>
         where  a.type=1 and a.new_channel=0
-        <if test="type != 5 and type !=6">
-            and a.aid=  #{aid,jdbcType=VARCHAR}
-        </if>
-        <if test="type == 5 or type ==6">
-            and e.aid=  #{aid,jdbcType=VARCHAR}
-        </if>
-        <if test="type == 0">
-            and  a.share_type = 0
-        </if>
-        <if test="type == 1">
-            and  a.share_type = 3
-        </if>
-        <if test="type ==0  or type==3 or type==5 or type==7">
-            and a.channel=0
-        </if>
-        <if test="type == 1 or type==4 or type==6">
-            and a.channel=1
-        </if>
-        <if test="type == 2">
-            and a.share_type=2
-        </if>
-        <if test="type == 3 or type==4">
-            and a.source=1
-            and  a.share_type = 0
-        </if>
-        <if test="type==7 ">
-            and a.share_type = 0
-            and a.source=2
-        </if>
-        <if test="type!=5 and type!=6">
-            <if test="startTime != null and endTime != null">
-                and  a.transfer_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
-            </if>
-        </if>
+       <include refid="AdminCustomerDetailSql"/>
     </select>