Browse Source

营销报表去处已转公共客户显示为私有客户数

anderx 7 years ago
parent
commit
b1d4781f97

+ 4 - 1
src/main/java/com/goafanti/common/mapper/DailySalesReportMapper.xml

@@ -257,6 +257,7 @@ from ( select
 			( select aid, count( aid ) as count1
 				from user 
 				where aid is not null and aid !=''
+				and share_type=0
 				group by aid
 			) y left join admin z on
 			y.aid = z.id
@@ -348,7 +349,8 @@ from(
 select a.id,sum(e.privateCustomersCount) as privateCustomersCount
 	from admin a left join user_role b
 	on a.id=b.uid left join role c
-	on b.rid=c.id left join (select aid,count(0) as privateCustomersCount from user group by aid)e
+	on b.rid=c.id left join (select aid,count(0) as privateCustomersCount from user where aid is not null and aid !=''
+				and share_type=0 group by aid)e
 	on a.id=e.aid  where c.role_name in ('营销员','营销经理','营销管理员')
 	<if test="depId != null">
 	and a.department_id = #{depId,jdbcType=VARCHAR}
@@ -424,6 +426,7 @@ from ( select
 			( select aid, count( aid ) as count1
 				from user 
 				where aid is not null and aid !=''
+				and share_type=0
 				group by aid
 			) y left join admin z on
 			y.aid = z.id