|
|
@@ -2233,7 +2233,8 @@ inner join(
|
|
|
|
|
|
<select id="selectChannelCountsList" resultType="com.goafanti.customer.bo.OutChannelCounts">
|
|
|
select b.name,b.id aid,a.counts,a.wfp unallocated,a.yfp allocated,a.yqd sign,a.ysf common
|
|
|
- from (select t1.aid,sum(tj)counts ,sum(t1.wfp)wfp,sum(t1.yfp)yfp,sum(t1.yqd)yqd,sum(t1.ysf)ysf from
|
|
|
+ from admin b
|
|
|
+ left join (select t1.aid,sum(tj)counts ,sum(t1.wfp)wfp,sum(t1.yfp)yfp,sum(t1.yqd)yqd,sum(t1.ysf)ysf from
|
|
|
(select x.aid,x.uid,
|
|
|
if(x.status=8,0,1) tj,
|
|
|
case x.status when 0 then 1 when 6 then 1 else 0 end as wfp,
|
|
|
@@ -2251,33 +2252,15 @@ inner join(
|
|
|
<if test="type==2 and startTime !=null and endTime !=null">
|
|
|
and x.sign_time between #{startTime} and #{endTime}
|
|
|
</if>
|
|
|
- )t1 group by t1.aid)a
|
|
|
- left join admin b on a.aid=b.id
|
|
|
+ )t1 group by t1.aid)a on a.aid=b.id left join user_role ur on b.id=ur.uid
|
|
|
+ left join `role` r on r.id=ur.rid where r.role_type=90
|
|
|
<if test="page_sql != null">
|
|
|
${page_sql}
|
|
|
</if>
|
|
|
</select>
|
|
|
<select id="selectChannelCountsCount" resultType="java.lang.Integer">
|
|
|
- select count(*)
|
|
|
- from
|
|
|
- (select t1.aid,sum(tj)counts ,sum(t1.wfp)wfp,sum(t1.yfp)yfp,sum(t1.yqd)yqd,sum(t1.ysf)ysf from
|
|
|
- (select x.aid,x.uid,
|
|
|
- if(x.status=8,0,1) tj,
|
|
|
- case x.status when 0 then 1 when 6 then 1 else 0 end as wfp,
|
|
|
- case x.status when 1 then 1 when 2 then 1 else 0 end as yfp,
|
|
|
- case x.status when 7 then 1 else 0 end as yqd,
|
|
|
- case x.status when 8 then 1 else 0 end as ysf
|
|
|
- from user_channel x left join user y on x.uid =y.id
|
|
|
- where 1=1 and x.status in (0,1,2,6,7,8)
|
|
|
- <if test="type==0 and startTime !=null and endTime !=null">
|
|
|
- and x.create_time between #{startTime} and #{endTime}
|
|
|
- </if>
|
|
|
- <if test="type==1 and startTime !=null and endTime !=null">
|
|
|
- and x.distribution_time between #{startTime} and #{endTime}
|
|
|
- </if>
|
|
|
- <if test="type==2 and startTime !=null and endTime !=null">
|
|
|
- and x.sign_time between #{startTime} and #{endTime}
|
|
|
- </if>
|
|
|
- )t1 group by t1.aid)t2
|
|
|
+ select count(*) from admin b left join user_role ur on b.id=ur.uid
|
|
|
+ left join `role` r on r.id=ur.rid
|
|
|
+ where r.role_type=90
|
|
|
</select>
|
|
|
</mapper>
|