|
@@ -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();
|
|
|
|
|
+ }
|
|
|
|
|
+}
|