|
|
@@ -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">
|