Browse Source

查询分享电话浏览总数

吴志根 3 years ago
parent
commit
d9a5f02086

+ 4 - 0
src/dsb/com/cnd3b/restcontroller/customer/supplyanddemand/SQL/查询分享电话浏览总数.sql

@@ -0,0 +1,4 @@
+SELECT count(*) num
+FROM tsupplyanddemand_log t1
+WHERE t1.tsupplyanddemandid in (select tsupplyanddemandid from tsupplyanddemand where tenterprise_userid = $tenterprise_userid$)
+  AND t1.ftype = $ftype$

+ 4 - 2
src/dsb/com/cnd3b/restcontroller/customer/supplyanddemand/supplyanddemand.java

@@ -484,8 +484,10 @@ public class supplyanddemand extends Controller {
     }
 
     public int getTimesSQl(Long tenterprise_userid, int ftype) {
-        String sql = "SELECT COUNT (*) num FROM tsupplyanddemand_log t1 LEFT JOIN tsupplyanddemand t2 ON t1.tenterprise_userid =t2.tenterprise_userid WHERE t1.tenterprise_userid ='" + tenterprise_userid + "' AND t1.ftype ='" + ftype + "'";
-        Rows rows = dbConnect.runSqlQuery(sql);
+        SQLFactory sqlFactory = new SQLFactory(this,"²éѯ·ÖÏíµç»°ä¯ÀÀ×ÜÊý");
+        sqlFactory.addParameter("tenterprise_userid",tenterprise_userid);
+        sqlFactory.addParameter("ftype",ftype);
+        Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
         if (rows.isEmpty()) {
             return 0;
         }