|
|
@@ -1951,4 +1951,27 @@ inner join(
|
|
|
and a.credit_rating is not null and a.credit_rating !=''
|
|
|
and a.id=#{uid,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
+ <select id="userDataStatistics" resultType="com.goafanti.report.bo.userDataListBo">
|
|
|
+ select a.name ,c.name as depName,ifnull(d.count,0) as signUser,ifnull(e.count,0) as fullUser,
|
|
|
+ ifnull(f.count,0) as dayFullUser,ifnull(g.count,0) as dayNewUser,ifnull(h.count,0) as countUser,
|
|
|
+ ifnull(i.count,0) as signFullUser
|
|
|
+ from admin a inner join (select uid from user_role x
|
|
|
+ inner join(select id from `role` where role_name in ('营销员','营销经理','营销管理员')) y
|
|
|
+ on x.rid=y.id)b on a.id =b.uid left join department_management c on a.department_id=c.id
|
|
|
+ left join (select x.aid,count(1)as count from (select aid,uid from user_lock_release
|
|
|
+ where type=1 and status=0 group by aid,uid)x group by aid)d on a.id=d.aid
|
|
|
+ left join (select aid,count(1) as count from user where integrity=1 group by aid) e on a.id=e.aid
|
|
|
+ left join (select aid,count(1) as count
|
|
|
+ from user where integrity=1 and to_days(update_time)=to_days(now()) group by aid) f on a.id=f.aid
|
|
|
+ left join (select aid,count(1) as count
|
|
|
+ from user where type=1 and status=0 and share_type=0 and to_days(create_time)=to_days(now()) group by aid) g on a.id=g.aid
|
|
|
+ left join (select aid,count(1) as count
|
|
|
+ from user where type=1 and status=0 and share_type=0 group by aid) h on a.id=h.aid
|
|
|
+ left join (select x.aid,count(1)as count from (select x1.aid,x1.uid from user_lock_release x1
|
|
|
+ left join user y on x1.uid=y.id where x1.type=1
|
|
|
+ and x1.status=0 and y.integrity=1 group by aid,uid)x group by aid) i on a.id=h.aid
|
|
|
+ <if test="depId!=null and depId!=''">
|
|
|
+ where a.department_id= #{depId,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|