|
|
@@ -18,6 +18,7 @@ import p2.util.P2Exception;
|
|
|
import titem.icinvbalMsg;
|
|
|
import titem.titem;
|
|
|
|
|
|
+import java.sql.SQLData;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
@@ -229,7 +230,8 @@ public class Titem extends Controller {
|
|
|
JSONObject whereObject = content.getJSONObject("where");
|
|
|
|
|
|
if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
|
|
|
- where = where + " and(t1.fitemname like'%" + whereObject.getString("condition") + "%' or t1.fspec like '%" + whereObject.getString("condition") + "%' or t1.fmodel like'%" + whereObject.getString("condition") + "%')";
|
|
|
+ //where = where + " and(t1.fitemname like'%" + whereObject.getString("condition") + "%' or t1.fspec like '%" + whereObject.getString("condition") + "%' or t1.fmodel like'%" + whereObject.getString("condition") + "%')";
|
|
|
+ where = where + " and(t1.fitemname like'%" + whereObject.getString("condition") + "%' or t1.fitemno='" + whereObject.getString("condition") + "' or t1.fspec like '%" + whereObject.getString("condition") + "%' or t1.fmodel like'%" + whereObject.getString("condition") + "%')";
|
|
|
}
|
|
|
if (whereObject.containsKey("fspec") && !"".equals(whereObject.getString("fspec"))) {
|
|
|
where = where + " and t1.fspec ='" + whereObject.getString("fspec") + "'";
|
|
|
@@ -369,7 +371,8 @@ public class Titem extends Controller {
|
|
|
JSONObject whereObject = content.getJSONObject("where");
|
|
|
|
|
|
if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
|
|
|
- where = where + " and(t1.fitemname like'%" + whereObject.getString("condition") + "%' or t1.fspec like '%" + whereObject.getString("condition") + "%' or t1.fmodel like'%" + whereObject.getString("condition") + "%')";
|
|
|
+ // where = where + " and(t1.fitemname like'%" + whereObject.getString("condition") + "%' or t1.fspec like '%" + whereObject.getString("condition") + "%' or t1.fmodel like'%" + whereObject.getString("condition") + "%')";
|
|
|
+ where = where + " and(t1.fitemname like'%" + whereObject.getString("condition") + "%' or t1.fitemno='" + whereObject.getString("condition") + "' or t1.fspec like '%" + whereObject.getString("condition") + "%' or t1.fmodel like'%" + whereObject.getString("condition") + "%')";
|
|
|
}
|
|
|
if (whereObject.containsKey("fspec") && !"".equals(whereObject.getString("fspec"))) {
|
|
|
where = where + " and t1.fspec ='" + whereObject.getString("fspec") + "'";
|
|
|
@@ -1335,13 +1338,15 @@ public class Titem extends Controller {
|
|
|
}
|
|
|
|
|
|
public String query_itemvalueclass() {
|
|
|
- String[] fieldlist = new String[]{"fvalue1", "fvalue2", "fvalue3", "fvalue4", "fvalue5", "fvalue6", "fvalue7"};
|
|
|
+ SQLFactory sqlFactory = new SQLFactory(this, "ÉÌÆ·µµ°¸Ñ¡Ïî²éѯ");
|
|
|
+ sqlFactory.addParameter("siteid", siteid);
|
|
|
|
|
|
- JSONObject object = new JSONObject();
|
|
|
DBConnect dbConnect = new DBConnect();
|
|
|
- for (String field : fieldlist) {
|
|
|
- Rows rows = dbConnect.runSqlQuery("select value from ps_databind_list where databindid='ITEM_" + field + "' and siteid='" + siteid + "'");
|
|
|
- object.put(field, rows.toJsonArray("value"));
|
|
|
+ RowsMap rowsMap = dbConnect.runSqlQuery(sqlFactory.getSQL()).toRowsMap("field");
|
|
|
+
|
|
|
+ JSONObject object = new JSONObject();
|
|
|
+ for (String field : rowsMap.keySet()) {
|
|
|
+ object.put(field, rowsMap.get(field).toJsonArray("value"));
|
|
|
}
|
|
|
return getReturnObject_suc(object, true).toString();
|
|
|
}
|