|
@@ -13,6 +13,7 @@ import common.data.Row;
|
|
|
import common.data.Rows;
|
|
import common.data.Rows;
|
|
|
import common.data.RowsMap;
|
|
import common.data.RowsMap;
|
|
|
import common.data.SQLFactory;
|
|
import common.data.SQLFactory;
|
|
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import restcontroller.R;
|
|
import restcontroller.R;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
@@ -31,6 +32,7 @@ public class promotionItems extends Controller {
|
|
|
* 过滤条件设置
|
|
* 过滤条件设置
|
|
|
*/
|
|
*/
|
|
|
String where = " 1=1 ";
|
|
String where = " 1=1 ";
|
|
|
|
|
+ String where1 = " 1=1 ";
|
|
|
if (content.containsKey("where")) {
|
|
if (content.containsKey("where")) {
|
|
|
JSONObject whereObject = content.getJSONObject("where");
|
|
JSONObject whereObject = content.getJSONObject("where");
|
|
|
if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
|
|
if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
|
|
@@ -41,11 +43,27 @@ public class promotionItems extends Controller {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
Long sa_promotionid = content.getLong("sa_promotionid");
|
|
Long sa_promotionid = content.getLong("sa_promotionid");
|
|
|
|
|
+ Rows tradefieldrows =dbConnect.runSqlQuery("select tradefield from sa_promotion where siteid='"+siteid+"' and sa_promotionid="+sa_promotionid);
|
|
|
|
|
+ JSONArray tradefield=new JSONArray();
|
|
|
|
|
+ if(!tradefieldrows.isEmpty()){
|
|
|
|
|
+ if (!StringUtils.isBlank(tradefieldrows.get(0).getString("tradefield"))) {
|
|
|
|
|
+ tradefield=JSONArray.parseArray(tradefieldrows.get(0).getString("tradefield"));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(tradefield!=null && !tradefield.isEmpty()){
|
|
|
|
|
+ for (Object object:tradefield) {
|
|
|
|
|
+ String str = String.valueOf(object);
|
|
|
|
|
+ where1=where1 +" or tradefield =+'"+str+"' ";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// String hrid = content.getString("hrid");
|
|
// String hrid = content.getString("hrid");
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "商品查询", pageSize, pageNumber, pageSorting);
|
|
SQLFactory sqlFactory = new SQLFactory(this, "商品查询", pageSize, pageNumber, pageSorting);
|
|
|
sqlFactory.addParameter_SQL("where", where);
|
|
sqlFactory.addParameter_SQL("where", where);
|
|
|
|
|
+ sqlFactory.addParameter_SQL("where1", where1);
|
|
|
sqlFactory.addParameter("sa_promotionid", sa_promotionid);
|
|
sqlFactory.addParameter("sa_promotionid", sa_promotionid);
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
|
|
+ System.out.println(sqlFactory.getSQL());
|
|
|
Rows rows = dbConnect.runSqlQuery(sqlFactory);
|
|
Rows rows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
|
|
|
|
|
// 附件
|
|
// 附件
|