|
|
@@ -1051,7 +1051,7 @@
|
|
|
</select>
|
|
|
|
|
|
|
|
|
- <select id="selectAdminCustomerList" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminCustomerBo">
|
|
|
+ <select id="selectAdminCustomerList" resultType="com.goafanti.admin.bo.AdminCustomerBo">
|
|
|
select a.id as aid,a.name as aName,d.name as depName,ifnull(b.userCount,0) as userCount,ifnull(c.timeCount,0) as inputCount,
|
|
|
ifnull(c.timeCount,0) as receiveCount from admin a
|
|
|
left join (select aid,count(aid) as userCount from user where aid is not null
|
|
|
@@ -1083,23 +1083,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectAdminCustomerCount" parameterType="java.lang.String" resultType="java.lang.Integer">
|
|
|
- select a.id as aid,a.name as aName,d.name as depName,ifnull(b.userCount,0) as userCount,ifnull(c.timeCount,0) as inputCount,
|
|
|
- ifnull(c.timeCount,0) as receiveCount from admin a
|
|
|
- left join (select aid,count(aid) as userCount from user where aid is not null
|
|
|
- and share_type=0 and source !=0 and type=1
|
|
|
- group by aid) b on a.id=b.aid
|
|
|
- left join (select aid,count(aid) as timeCount from `user` where aid is not null
|
|
|
- and share_type=0 and source =1 and type=1
|
|
|
- <if test="startTime != null and endTime != null">
|
|
|
- and create_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- group by aid) c on a.id=c.aid
|
|
|
- left join (select aid,count(aid) as timeCount from `user` where aid is not null
|
|
|
- and share_type=0 and source =2 and type=1
|
|
|
- <if test="startTime != null and endTime != null">
|
|
|
- and transfer_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
|
|
|
- </if>
|
|
|
- group by aid) d on a.id=c.aid
|
|
|
+ select count(*) from admin a
|
|
|
left join department d on a.department_id=d.id
|
|
|
left join user_role e on a.id=e.uid
|
|
|
left join `role` f on e.rid=f.id
|
|
|
@@ -1110,20 +1094,29 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectAdminCustomerDetailList" parameterType="java.lang.String" resultType="com.goafanti.admin.bo.AdminCustomerDetailBo">
|
|
|
+ <select id="selectAdminCustomerDetailList" resultType="com.goafanti.admin.bo.AdminCustomerDetailBo">
|
|
|
select a.id,a.nickname as name,a.source,c.contacts,c.contact_mobile as contactMobile,
|
|
|
a.create_time as createTime,b.time_stamp 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 organization_identity c on a.id=c.uid
|
|
|
- where a.aid is not null
|
|
|
+ where a.aid is not null and a.share_type=0 and a.type=1
|
|
|
<if test="aid != null">
|
|
|
and a.aid= #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- and a.share_type=0
|
|
|
- and a.type=1
|
|
|
+ <if test="type==null">
|
|
|
+ and a.source !=4
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type == 0">
|
|
|
+ and a.source =1
|
|
|
+ and a.create_time
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type == 1">
|
|
|
+ and a.source =2
|
|
|
+ and a.transfer_time
|
|
|
+ </if>
|
|
|
<if test="startTime != null and endTime != null">
|
|
|
- and a.create_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
|
|
|
+ between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="page_sql!=null">
|
|
|
${page_sql}
|
|
|
@@ -1134,12 +1127,18 @@
|
|
|
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 organization_identity c on a.id=c.uid
|
|
|
- where a.aid is not null
|
|
|
+ where a.aid is not null and a.share_type=0 and a.type=1
|
|
|
<if test="aid != null">
|
|
|
and a.aid= #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- and a.share_type=0
|
|
|
- and a.type=1
|
|
|
+ <if test="type == null or type != 1">
|
|
|
+ and a.source !=0
|
|
|
+ and a.create_time
|
|
|
+ </if>
|
|
|
+ <if test="type!=null and type == 1">
|
|
|
+ and a.source =2
|
|
|
+ and a.transfer_time
|
|
|
+ </if>
|
|
|
<if test="startTime != null and endTime != null">
|
|
|
and a.create_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
|
|
|
</if>
|