Kaynağa Gözat

已提报业务员、已提报经销商分析接口增加提报数量;去除原提报内容字段,调整原提报时间为最新提报时间
修改提报占比分析计算逻辑
修改未提报人员攻击的条件过滤

沈静伟 3 yıl önce
ebeveyn
işleme
e8c719858b

+ 3 - 2
src/dsb/com/cnd3b/restcontroller/enterprise/webclient/submitedit/SQL/分析_已提报业务员.sql

@@ -1,6 +1,7 @@
-select t1.tsubmiteditid, t2.fname, t2.fphonenumber,t1.fcontent,t1.submitdate, t1.tenterprise_userid
+select t1.tenterprise_userid,t1.tsubmiteditid, t2.fname, t2.fphonenumber,max(t1.submitdate)as submitdate,count(0)as submitcount
 from tsubmitedit t1
        inner join tenterprise_users t2 on t1.siteid = t2.siteid and t1.tenterprise_userid = t2.tenterprise_userid and t2.fusertype='ÆóÒµ'
 where t1.siteid = $siteid$
   and t1.tsubmiteditmodelid = $tsubmiteditmodelid$
-  and t1.fstatus='Ìá½»'
+  and t1.fstatus='Ìá½»'
+  group by t1.tenterprise_userid,t1.tsubmiteditid, t2.fname, t2.fphonenumber

+ 3 - 2
src/dsb/com/cnd3b/restcontroller/enterprise/webclient/submitedit/SQL/分析_已提报经销商.sql

@@ -1,8 +1,9 @@
-select t1.tsubmiteditid,t4.fname fsaler, t2.fname, t3.fprovince, t3.fcity, t3.fcounty, t2.fphonenumber,t1.fcontent,t1.submitdate, t1.tenterprise_userid
+select t1.tenterprise_userid, t4.fname fsaler, t2.fname, t3.fprovince, t3.fcity, t3.fcounty, t2.fphonenumber,max(t1.submitdate)as submitdate,count(0)as submitcount
 from tsubmitedit t1
        inner join tenterprise_users t2 on t1.siteid = t2.siteid and t1.tenterprise_userid = t2.tenterprise_userid
        inner join tagents t3 on t2.siteid = t3.siteid and t2.tagentsid = t3.tagentsid
        inner join tenterprise_users t4 on t3.siteid = t4.siteid and t3.fsaleruserid = t4.tenterprise_userid
 where t1.siteid = $siteid$
   and t1.tsubmiteditmodelid = $tsubmiteditmodelid$
-  and t1.fstatus='Ìá½»'
+  and t1.fstatus='Ìá½»'
+group by t1.tenterprise_userid, t4.fname, t2.fname, t3.fprovince, t3.fcity, t3.fcounty, t2.fphonenumber

+ 6 - 2
src/dsb/com/cnd3b/restcontroller/enterprise/webclient/submitedit/SQL/分析_提报占比分析.sql

@@ -1,2 +1,6 @@
-select case when fstatus ='提交' then '已提报'else '未提报' end as ftype,count(0)fcount  from tsubmitedit
-where siteid=$siteid$ and tsubmiteditmodelid=$tsubmiteditmodelid$ group by case when fstatus ='提交' then '已提报'else '未提报' end
+select '已提报' as ftype,count(distinct tenterprise_userid)fcount from tsubmitedit
+where siteid=$siteid$ and tsubmiteditmodelid=$tsubmiteditmodelid$ and fstatus='提交'
+union all
+select '未提报' as ftype,count(distinct tenterprise_userid)fcount from tsubmitedit t1
+where siteid=$siteid$ and tsubmiteditmodelid=$tsubmiteditmodelid$ and fstatus='新建'
+and not exists (select *from tsubmitedit where siteid=$siteid$ and tsubmiteditmodelid=$tsubmiteditmodelid$ and tenterprise_userid=t1.tenterprise_userid and fstatus='提交')

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/webclient/submitedit/SQL/分析_未提报业务员.sql

@@ -3,4 +3,4 @@ from tsubmitedit t1
        inner join tenterprise_users t2 on t1.siteid = t2.siteid and t1.tenterprise_userid = t2.tenterprise_userid and t2.fusertype='ÆóÒµ'
 where t1.siteid = $siteid$
   and t1.tsubmiteditmodelid = $tsubmiteditmodelid$
-  and t1.fstatus='н¨'
+  and t1.fstatus='н¨' and not exists(select * from tsubmitedit where siteid=$siteid$ and tsubmiteditmodelid=$tsubmiteditmodelid$ and tenterprise_userid=t1.tenterprise_userid and fstatus='Ìá½»')

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/webclient/submitedit/SQL/分析_未提报经销商.sql

@@ -5,4 +5,4 @@ from tsubmitedit t1
        inner join tenterprise_users t4 on t3.siteid = t4.siteid and t3.fsaleruserid = t4.tenterprise_userid
 where t1.siteid = $siteid$
   and t1.tsubmiteditmodelid = $tsubmiteditmodelid$
-  and t1.fstatus='н¨'
+  and t1.fstatus='н¨'and not exists(select * from tsubmitedit where siteid=$siteid$ and tsubmiteditmodelid=$tsubmiteditmodelid$ and tenterprise_userid=t1.tenterprise_userid and fstatus='Ìá½»')