bannermag.java 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package com.cnd3b.restcontroller.publicmethod.bannermag;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.cnd3b.common.Controller;
  4. import com.cnd3b.common.D3bException;
  5. import com.cnd3b.common.data.Row;
  6. import com.cnd3b.common.data.Rows;
  7. import com.cnd3b.common.data.RowsMap;
  8. import com.cnd3b.common.data.SQLFactory;
  9. import p2.pao.PaoRemote;
  10. import p2.pao.PaoSetRemote;
  11. import p2.util.P2Exception;
  12. public class bannermag extends Controller {
  13. public bannermag(JSONObject content) {
  14. super(content);
  15. }
  16. /**
  17. * ÂÖ²¥Î»²éѯ
  18. *
  19. * @return
  20. */
  21. public String query_bannerlocationlist() {
  22. this.siteid = content.getString("siteid");
  23. String fclienttype = content.getString("fclienttype");
  24. SQLFactory locationSQL = new SQLFactory(this, "ÂÖ²¥¹ã¸æÎ»²éѯ");
  25. locationSQL.addParameter("siteid", siteid);
  26. locationSQL.addParameter("fclienttype", fclienttype);
  27. Rows locationrows = dbConnect.runSqlQuery(locationSQL.getSQL());
  28. SQLFactory bannerSQl = new SQLFactory(this, "ÂÖ²¥¹ã¸æ²éѯ");
  29. bannerSQl.addParameter("siteid", siteid);
  30. bannerSQl.addParameter_in("tbannerlocationid", locationrows.toArrayList("tbannerlocationid"));
  31. RowsMap bannermap = dbConnect.runSqlQuery(bannerSQl.getSQL()).toRowsMap("tbannerlocationid");
  32. for (Row locationrow : locationrows) {
  33. Rows bannerRows = bannermap.get(locationrow.getString("tbannerlocationid"));
  34. for (Row bannerrow : bannerRows) {
  35. bannerrow.put("attinfos", getAttachmentUrl("tbannermag", bannerrow.getString("tbannermagid")));
  36. }
  37. locationrow.put("banner", bannerRows);
  38. }
  39. return getSucReturnObject().setData(locationrows).toString();
  40. }
  41. }