ソースを参照

用户跟进列表修改

anderx 1 年間 前
コミット
9b2b524d7a
共有1 個のファイルを変更した12 個の追加49 個の削除を含む
  1. 12 49
      src/main/java/com/goafanti/common/mapper/UserFollowMapper.xml

+ 12 - 49
src/main/java/com/goafanti/common/mapper/UserFollowMapper.xml

@@ -226,60 +226,14 @@
         from user_follow a left join `user`b on a.uid =b.id left join organization_identity c on a.uid=c.uid
         left join admin d on a.aid =d.id left join business_project e on a.pid =e.id
         where 1=1
-        <if test="shiroType == 0">
-            and a.aid= #{aid}
-        </if>
-        <if test="shiroType == 1">
-            and a.aid in
-            <foreach close=")" collection="aids" item="id" open="(" separator=",">
-                #{id}
-            </foreach>
-        </if>
-        <if test="followName != null">
-            and a.follow_name  like concat('%',#{followName},'%')
-        </if>
-        <if test="userName != null">
-            and b.nickname like concat('%',#{userName},'%')
-        </if>
-        <if test="userType == 1">
-            and b.share_type =0
-        </if>
-        <if test="userType == 2">
-            and b.share_type =1
-        </if>
-        <if test="userType == 3">
-            and b.share_type =2
-        </if>
-        <if test="userType == 4">
-            and b.share_type =3
-        </if>
-        <if test="contactType != null">
-            and a.contact_type = #{contactType}
-        </if>
-        <if test="followStartTime !=null and followEndTime !=null">
-            and a.create_time between #{followStartTime} and #{followEndTime}
-        </if>
-        <if test="createStartTime !=null and createEndTime !=null">
-            and b.transfer_time between #{createStartTime} and #{createEndTime}
-        </if>
-        <if test="guidanceStartTime !=null and guidanceEndTime !=null">
-            and a.guidance_time between #{guidanceStartTime} and #{guidanceEndTime}
-        </if>
-        <if test="deps != null">
-            and d.department_id in
-            <foreach close=")" collection="deps" item="depId" open="(" separator=",">
-                #{depId}
-            </foreach>
-        </if>
+         <include refid="userFollowSql"/>
+
         order by  a.create_time desc
         <if test="page_sql != null">
             ${page_sql}
         </if>
     </select>
-    <select id="userFollowCount" resultType="java.lang.Integer">
-        select count(*)
-        from user_follow a left join `user`b on a.uid =b.id
-        left join admin d on a.aid =d.id where 1=1
+    <sql id="userFollowSql">
         <if test="shiroType == 0">
             and a.aid= #{aid}
         </if>
@@ -307,6 +261,9 @@
         <if test="userType == 4">
             and b.share_type =3
         </if>
+        <if test="userType == 5">
+            and a.type=1
+        </if>
         <if test="contactType != null">
             and a.contact_type = #{contactType}
         </if>
@@ -325,6 +282,12 @@
                 #{depId}
             </foreach>
         </if>
+    </sql>
+    <select id="userFollowCount" resultType="java.lang.Integer">
+        select count(*)
+        from user_follow a left join `user`b on a.uid =b.id
+        left join admin d on a.aid =d.id where 1=1
+        <include refid="userFollowSql"/>
     </select>
     <select id="selectByaidAndDate" resultType="java.lang.Integer">
         select count(*)followCount