anderx лет назад: 4
Родитель
Сommit
80810a060b

+ 3 - 5
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -1106,10 +1106,10 @@
   
    <select id="selectAdminCustomerDetailList"  resultType="com.goafanti.admin.bo.AdminCustomerDetailBo">
 select a.id,a.nickname as name,a.source,c.name contacts,c.mobile as contactMobile,
-	a.create_time as createTime,b.time_stamp as followTime
+	a.create_time as createTime,b.last_follow_time as followTime
 	from user a 
-	left join (select uid,max(time_stamp) as time_stamp from user_follow group by uid) b  on a.id=b.uid
-	left join (select uid,name ,mobile from organization_contact_book where major=1) c on a.id=c.uid
+	left join (select uid,last_follow_time from user_mid where aid= #{aid}) b  on a.id=b.uid
+	left join (select uid,name ,mobile from organization_contact_book where major=1 limit 1 ) c on a.id=c.uid
 	<if test="type==5 or type==6">
 	left join (select aid,uid from public_release where clock_in =1
 	and aid= #{aid,jdbcType=VARCHAR}
@@ -1158,8 +1158,6 @@ select a.id,a.nickname as name,a.source,c.name contacts,c.mobile as contactMobil
   <select id="selectAdminCustomerDetailCount" parameterType="java.lang.String" resultType="java.lang.Integer">
   	select count(*) 
   	from user a 
-	left join (select uid,max(time_stamp) as time_stamp from user_follow group by uid) b  on a.id=b.uid
-	left join (select uid,name ,mobile from organization_contact_book where major=1) c on a.id=c.uid
 	<if test="type==5 or type==6">
       left join (select aid,uid from public_release where clock_in =1
       and aid= #{aid,jdbcType=VARCHAR}

+ 7 - 5
src/main/java/com/goafanti/common/mapper/OrganizationManagementMapper.xml

@@ -646,9 +646,10 @@
 	</select>
 	
 	<select id="getDepAll" resultType="com.goafanti.admin.bo.AdminCustomerBo">
-	select a.id aid,a.name aName,d.id depId,d.name depName,b.userCount,b.channelCount,b.signCount,b.newCount,b.channelNewCount,b.receiveCount,
-        b.completeCount,b.channelCompleteCount
-        from admin a inner join (select x.aid,x.userCount,x.channelCount,signCount,x.newCount,x.channelNewCount,x.receiveCount,
+        select a.id aid,a.name aName,d.id depId,d.name depName,ifnull(b.userCount,0)userCount,ifnull(b.channelCount,0)channelCount,
+        ifnull(b.signCount,0)signCount,ifnull(b.newCount,0)newCount,ifnull(b.channelNewCount,0)channelNewCount,ifnull( b.receiveCount,0)receiveCount,
+        ifnull( b.completeCount,0)completeCount,ifnull(b.channelCompleteCount,0)channelCompleteCount
+        from admin a left join (select x.aid,x.userCount,x.channelCount,signCount,x.newCount,x.channelNewCount,x.receiveCount,
         ifnull(y.completeCount,0)completeCount,ifnull(y.channelCompleteCount,0)channelCompleteCount
         from (select aid,sum(if( share_type=0 and channel=0,1,0))userCount,
         sum(if(share_type=0 and  channel=1,1,0))channelCount,
@@ -668,8 +669,9 @@
         </if>
         group by a.aid ) y on x.aid=y.aid)b on a.id=b.aid
         left join department d on a.department_id=d.id
-        where 1=1
-	<if test="adminName !=null">
+        left join user_role e on a.id=e.uid left join (select id from `role`where role_type in(96,996)) f on e.rid=f.id
+        where  a.status='正常'
+        <if test="adminName !=null">
 	and a.name  like concat('%',#{adminName},'%')  
 	</if>
 	<if test="depId !=null">