Просмотр исходного кода

公共方法数据查询全部加入站点条件

沈静伟 4 лет назад
Родитель
Сommit
f128880847

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/SQL/优质商品.sql

@@ -1,2 +1,2 @@
 select t1.tagents_productid,t1.tagentsid,t1.fintroduction,t1.fprodname,t1.fprodclassname from tagents_product t1
-where t1.fprodclassname=$saleprodclass$
+where t1.fprodclassname=$saleprodclass$ and t1.siteid=$siteid$

+ 2 - 1
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/SQL/优质商户.sql

@@ -1 +1,2 @@
-select t1.tagentsid,t1.saleprodclass,t1.fbrand,t1.fagentname from tagents t1 where t1.saleprodclass=$saleprodclass$
+select t1.tagentsid,t1.saleprodclass,t1.fbrand,t1.fagentname from tagents t1
+where t1.saleprodclass=$saleprodclass$ and t1.siteid=$siteid$

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/SQL/优质商户详情.sql

@@ -1,3 +1,3 @@
 select t1.fbrand, t1.fcontact, t1.faddress, t1.siteid, t1.fphonenumber, t1.fdutyparagraph, t1.saleprodclass,t1.fintroduction,t1.fagentname
 from tagents AS t1
-  and t1.tagentsid = $tagentsid$
+  and t1.tagentsid = $tagentsid$ and t1.siteid=$siteid$

+ 3 - 3
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/SQL/统计数据展示.sql

@@ -3,9 +3,9 @@ sum(t.fagentcount)as fagentcount,
 sum(t.forderamount)as forderamount,
 sum(t.fsupplyanddemandcount)as fsupplyanddemandcount,
 sum(t.fusercount)as fusercount from (
-select count(0)as fagentcount,0 as fsupplyanddemandcount,0 as fusercount,0 as forderamount from tagents where ftype='ÆÕͨ'
+select count(0)as fagentcount,0 as fsupplyanddemandcount,0 as fusercount,0 as forderamount from tagents where ftype='ÆÕͨ' and siteid=$siteid$
 union all
-select 0 as fagentcount,count(0) as fsupplyanddemandcount,0 as fusercount,0 as forderamount from tsupplyanddemand 
+select 0 as fagentcount,count(0) as fsupplyanddemandcount,0 as fusercount,0 as forderamount from tsupplyanddemand and siteid=$siteid$
 union all
-select 0 as fagentcount,0 as fsupplyanddemandcount,count(0) as fusercount,0 as forderamount from tenterprise_users
+select 0 as fagentcount,0 as fsupplyanddemandcount,count(0) as fusercount,0 as forderamount from tenterprise_users and siteid=$siteid$
 )t

+ 6 - 2
src/dsb/com/cnd3b/restcontroller/publicmethod/homepage/homepage.java

@@ -21,6 +21,7 @@ public class homepage extends Controller {
     public String getStatisticalData() {
         this.siteid = content.getString("siteid");
         SQLFactory sqlFactory = new SQLFactory(this, "统计数据展示");
+        sqlFactory.addParameter("siteid", siteid);
         Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
         return getSucReturnObject().setData(rows).saveToDataPool(10).toString();
     }
@@ -108,6 +109,7 @@ public class homepage extends Controller {
         this.siteid = content.getString("siteid");
         SQLFactory agentlistSql = new SQLFactory(this, "优质商户", pageSize, pageNumber, "t1.tagentsid");
         agentlistSql.addParameter("saleprodclass", content.getString("saleprodclass"));
+        agentlistSql.addParameter("siteid", siteid);
         Rows rows = agentlistSql.runSqlQuery();
         RowsMap map = getAttachmentUrl("tagents", rows.toArrayList("tagentsid"));
         for (Row row : rows) {
@@ -126,6 +128,7 @@ public class homepage extends Controller {
         SQLFactory sql = new SQLFactory(this, "优质商户详情", pageSize, pageNumber, "t1.tagents_productid");
         sql.addParameter("tagentsid", content.getString("tagentsid"));
         sql.addParameter("saleprodclass", content.getString("saleprodclass"));
+        sql.addParameter("siteid", siteid);
         Rows rows = dbConnect.runSqlQuery(sql.getSQL());
         for (Row row : rows) {
             row.put("saleprodclass", JSONArray.parseArray(row.getString("saleprodclass")));
@@ -141,8 +144,9 @@ public class homepage extends Controller {
      */
     public String prodList() {
         this.siteid = content.getString("siteid");
-        SQLFactory agentlistSql = new SQLFactory(this, "优质商品");
-        Rows rows = agentlistSql.runSqlQuery();
+        SQLFactory prodlistSql = new SQLFactory(this, "优质商品");
+        prodlistSql.addParameter("siteid", siteid);
+        Rows rows = prodlistSql.runSqlQuery();
         RowsMap map = getAttachmentUrl("tagents_product", rows.toArrayList("tagents_productid"));
         for (Row row : rows) {
             row.put("attinfos", map.get(row.getString("tagents_productid")));

+ 2 - 2
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/当前线上观众人数查询.sql

@@ -3,7 +3,7 @@ select ROW_NUMBER()over(partition by t1.channelid order by t1.time desc)as num,t
 t1.count,t2.channelcoverimageurl,t2.fliveshowurl,
 t3.fbrand,t3.flocationclass,t3.flocation,t3.fintroduction
 from tlive_usercount t1
-inner join tlive t2 on t1.channelid=t2.channelid --and t2.livestatus='live'
+inner join tlive t2 on t1.channelid=t2.channelid and t2.livestatus='live'
 inner join tactivity_agentmsg t3 on t2.siteid=t3.siteid and t2.tagentsid=t3.tagentsid
-where t2.tactivityid=$tactivityid$
+where t2.tactivityid=$tactivityid$ and t2.siteid=$siteid$
 )t where t.num=1

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/活动直播间总数查询.sql

@@ -1 +1 @@
-select count(0)fcount from tlive where livestatus='live' and tactivityid=$tactivityid$
+select count(0)fcount from tlive where livestatus='live' and tactivityid=$tactivityid$ and siteid=$siteid

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/活动直播间观众总数查询.sql

@@ -1,4 +1,4 @@
 select count(0)fcount from tlive_viewlog t1
 inner join tlive t2 on t1.channelid=t2.channelid
 inner join tactivity t3 on t2.siteid=t3.siteid and t2.tactivityid=t3.tactivityid
-where t3.tactivityid=$tactivityid$
+where t3.tactivityid=$tactivityid$ and t2.siteid=$siteid$

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/热门展品.sql

@@ -1,3 +1,3 @@
 select t1.tactivity_agentproductsid,t2.tagents_productid,t1.tagentsid,t1.fintroduction,t2.fprodname,t2.fprodclassname from tactivity_agentproducts t1
 inner join tagents_product t2 on t1.siteid=t2.siteid and t1.tagentsid=t2.tagentsid and t1.tagents_productid=t2.tagents_productid
-where t1.tactivityid=$tactivityid$
+where t1.tactivityid=$tactivityid$ and t1.siteid=$siteid$

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/publicmethod/live/SQL/热门展商.sql

@@ -1,2 +1,2 @@
 select t1.tactivity_agentmsgid,t1.tagentsid,t1.flocationclass,t1.flocation,t1.fbrand,t1.fintroduction from tactivity_agentmsg t1
-where t1.tactivityid=$tactivityid$
+where t1.tactivityid=$tactivityid$ and t1.siteid=$siteid$

+ 8 - 3
src/dsb/com/cnd3b/restcontroller/publicmethod/live/live.java

@@ -25,17 +25,20 @@ public class live extends Controller {
         //参展商
         SQLFactory agentcountSql = new SQLFactory(this, "活动直播间总数查询");
         agentcountSql.addParameter("tactivityid", tactivityid);
+        agentcountSql.addParameter("siteid", siteid);
         Rows agentCountRows = agentcountSql.runSqlQuery();
         resultObject.put("fagentcount", agentCountRows.isEmpty() ? 0 : agentCountRows.get(0).getInteger("fcount"));
 
         //观众总人数
         SQLFactory custcountSql = new SQLFactory(this, "活动直播间观众总数查询");
         custcountSql.addParameter("tactivityid", tactivityid);
+        custcountSql.addParameter("siteid", siteid);
         Rows totalcustCountrows = custcountSql.runSqlQuery();
         resultObject.put("ftotalcustcount", totalcustCountrows.isEmpty() ? 0 : totalcustCountrows.get(0).getInteger("fcount"));
 
         SQLFactory livecustcount = new SQLFactory(this, "当前线上观众人数查询");
         livecustcount.addParameter("tactivityid", tactivityid);
+        livecustcount.addParameter("siteid", siteid);
         Rows liverows = dbConnect.runSqlQuery(livecustcount.getSQL());
         //正在直播数
         resultObject.put("flivecount", liverows.size());
@@ -57,6 +60,7 @@ public class live extends Controller {
         String tactivityid = content.getString("tactivityid");
         SQLFactory agentlistSql = new SQLFactory(this, "热门展商");
         agentlistSql.addParameter("tactivityid", tactivityid);
+        agentlistSql.addParameter("siteid", siteid);
         Rows rows = agentlistSql.runSqlQuery();
         RowsMap map = getAttachmentUrl("tactivity_agentmsg", rows.toArrayList("tactivity_agentmsgid"));
         for (Row row : rows) {
@@ -73,9 +77,10 @@ public class live extends Controller {
     public String prodList() {
         this.siteid = content.getString("siteid");
         String tactivityid = content.getString("tactivityid");
-        SQLFactory agentlistSql = new SQLFactory(this, "热门展品");
-        agentlistSql.addParameter("tactivityid", tactivityid);
-        Rows rows = agentlistSql.runSqlQuery();
+        SQLFactory prodlistSql = new SQLFactory(this, "热门展品");
+        prodlistSql.addParameter("tactivityid", tactivityid);
+        prodlistSql.addParameter("siteid", siteid);
+        Rows rows = prodlistSql.runSqlQuery();
         RowsMap map = getAttachmentUrl("tagents_product", rows.toArrayList("tagents_productid"));
         for (Row row : rows) {
             row.put("attinfos", map.get(row.getString("tagents_productid")));