|
|
@@ -122,5 +122,33 @@ public class adspace extends Controller {
|
|
|
return getSucReturnObject().setData(rows).toString();
|
|
|
}
|
|
|
|
|
|
+ @API(title = "广告位详细", apiversion = R.ID20240328152502.v1.class)
|
|
|
+ public String detail() throws YosException {
|
|
|
+
|
|
|
+ Long sys_adspaceid = content.getLongValue("sys_adspaceid");
|
|
|
+
|
|
|
+ QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sys_adspace")
|
|
|
+ .setTableAlias("t1");
|
|
|
+ querySQL.setWhere("sys_adspaceid", sys_adspaceid);
|
|
|
+ Rows rows = querySQL.query();
|
|
|
+
|
|
|
+ RowsMap countRowsMap = dbConnect.runSqlQuery("SELECT count(0) count,sys_adspaceid from sys_ad WHERE siteid='" + siteid + "' GROUP BY sys_adspaceid").toRowsMap("sys_adspaceid");
|
|
|
+ for (Row row : rows) {
|
|
|
+ row.putIfAbsent("createdate", "");
|
|
|
+ row.putIfAbsent("changedate", "");
|
|
|
+ Rows sysAdspaceRows = countRowsMap.getOrDefault(row.getString("sys_adspaceid"), new Rows());
|
|
|
+ if (sysAdspaceRows.isEmpty()) {
|
|
|
+ row.putIfAbsent("count", 0);
|
|
|
+ } else {
|
|
|
+ row.putIfAbsent("count", sysAdspaceRows.get(0).getLong("count"));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return getSucReturnObject().setData(rows.isNotEmpty() ? rows.get(0) : new Row()).toString();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|