package com.cnd3b.restcontroller.publicmethod.bannermag; import com.alibaba.fastjson.JSONObject; import com.cnd3b.common.Controller; import com.cnd3b.common.D3bException; import com.cnd3b.common.data.Row; import com.cnd3b.common.data.Rows; import com.cnd3b.common.data.RowsMap; import com.cnd3b.common.data.SQLFactory; import p2.pao.PaoRemote; import p2.pao.PaoSetRemote; import p2.util.P2Exception; public class bannermag extends Controller { public bannermag(JSONObject content) { super(content); } /** * 轮播位查询 * * @return */ public String query_bannerlocationlist() { this.siteid = content.getString("siteid"); String fclienttype = content.getString("fclienttype"); SQLFactory locationSQL = new SQLFactory(this, "轮播广告位查询"); locationSQL.addParameter("siteid", siteid); locationSQL.addParameter("fclienttype", fclienttype); Rows locationrows = dbConnect.runSqlQuery(locationSQL.getSQL()); SQLFactory bannerSQl = new SQLFactory(this, "轮播广告查询"); bannerSQl.addParameter("siteid", siteid); bannerSQl.addParameter_in("tbannerlocationid", locationrows.toArrayList("tbannerlocationid")); RowsMap bannermap = dbConnect.runSqlQuery(bannerSQl.getSQL()).toRowsMap("tbannerlocationid"); for (Row locationrow : locationrows) { Rows bannerRows = bannermap.get(locationrow.getString("tbannerlocationid")); for (Row bannerrow : bannerRows) { bannerrow.put("attinfos", getAttachmentUrl("tbannermag", bannerrow.getString("tbannermagid"))); } locationrow.put("banner", bannerRows); } return getSucReturnObject().setData(locationrows).toString(); } }