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

+ 9 - 0
src/dsb/com/cnd3b/restcontroller/enterprise/supplyanddemand/SQL/供需列表查询.sql

@@ -0,0 +1,9 @@
+select t1.tsupplyanddemandid, t1.ftitle,t1.fissupply,
+       t1.ftype, t1.fstatus, t1.checkby, t1.checkdate,
+       t1.fenddate,t1.tcooperationagentsid,t2.fagentname,t3.fname,t3.fphonenumber,
+       t4.fagentname as fcooperationagentname,10 as fcommunicationtimes
+from tsupplyanddemand t1
+inner join tagents t2 on t1.siteid=t2.siteid and t1.tagentsid=t2.tagentsid
+inner join tenterprise_users t3 on t1.siteid=t3.siteid and t1.tenterprise_userid=t3.tenterprise_userid
+left join tagents t4 on t1.siteid=t4.siteid and t1.tcooperationagentsid=t4.tagentsid
+where t1.siteid=$siteid$ and $where$

+ 9 - 0
src/dsb/com/cnd3b/restcontroller/enterprise/supplyanddemand/SQL/供需详情查询.sql

@@ -0,0 +1,9 @@
+select t1.tsupplyanddemandid, t1.ftitle,t1.fissupply,
+       t1.ftype, t1.fstatus, t1.checkby, t1.checkdate,
+       t1.fenddate,t1.tcooperationagentsid,t2.fagentname,t3.fname,t3.fphonenumber,
+       t4.fagentname as fcooperationagentname,10 as fcommunicationtimes,t1.fcontent
+from tsupplyanddemand t1
+inner join tagents t2 on t1.siteid=t2.siteid and t1.tagentsid=t2.tagentsid
+inner join tenterprise_users t3 on t1.siteid=t3.siteid and t1.tenterprise_userid=t3.tenterprise_userid
+left join tagents t4 on t1.siteid=t4.siteid and t1.tcooperationagentsid=t4.tagentsid
+where t1.siteid=$siteid$ and t1.tagentsid=$tagentsid$ and tsupplyanddemandid=$tsupplyanddemandid$

+ 64 - 0
src/dsb/com/cnd3b/restcontroller/enterprise/supplyanddemand/supplyanddemand.java

@@ -0,0 +1,64 @@
+package com.cnd3b.restcontroller.enterprise.supplyanddemand;
+
+import com.alibaba.fastjson.JSONObject;
+import com.cnd3b.common.Controller;
+import com.cnd3b.common.data.Rows;
+import com.cnd3b.common.data.SQLFactory;
+
+public class supplyanddemand extends Controller {
+    public supplyanddemand(JSONObject content) {
+        super(content);
+    }
+
+    /**
+     * 供需列表查询
+     *
+     * @return
+     */
+    public String query_supplyanddemandList() {
+        /**
+         *排序条件设置
+         */
+        String[] sortfield = {"t1.tsupplyanddemandid desc"};
+        String sort = getSort(sortfield, "t1.tsupplyanddemandid desc");
+        /**
+         * 过滤条件设置
+         */
+        StringBuffer where = new StringBuffer(" 1=1 ");
+        if (content.containsKey("where")) {
+            JSONObject whereObject = content.getJSONObject("where");
+            if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
+                where.append(" and(");
+                where.append("t1.ftitle like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t2.fagentname like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t3.fphonenumber like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t1.ftype like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t1.fstatus like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append(")");
+            }
+        }
+        SQLFactory sqlFactory = new SQLFactory(this, "供需列表查询", pageSize, pageNumber, sort);
+        sqlFactory.addParameter("siteid", siteid);
+        sqlFactory.addParameter_SQL("where", where);
+
+        Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
+        return getSucReturnObject().setDataByPaging(rows).saveToDataPool().toString();
+    }
+
+    /**
+     * 供需详情查询
+     *
+     * @return
+     */
+    public String query_supplyanddemandMain() {
+        long tsupplyanddemandid = content.getLong("tsupplyanddemandid");
+        long tagentsid = content.getLong("tagentsid");
+
+        SQLFactory sqlFactory = new SQLFactory(this, "供需详情查询");
+        sqlFactory.addParameter("siteid", siteid);
+        sqlFactory.addParameter("tagentsid", tagentsid);
+        sqlFactory.addParameter("tsupplyanddemandid", tsupplyanddemandid);
+        Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
+        return getSucReturnObject().setData(rows).toString();
+    }
+}