Selaa lähdekoodia

广告轮播图新增修改接口返回结果新增结果查询

沈静伟 4 vuotta sitten
vanhempi
commit
2e95524e7f

+ 4 - 0
src/dsb/com/cnd3b/restcontroller/enterprise/bannermag/SQL/轮播广告列表查询.sql

@@ -0,0 +1,4 @@
+select tbannermagid,tbannerlocationid, changeby,
+       changedate, fisused, fhyperlink, flinktype,
+       fdatatable, fdataid from tbannermag
+       where siteid=$siteid$ and tbannerlocationid in $tbannerlocationid$

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/enterprise/bannermag/SQL/轮播广告查询.sql

@@ -1,4 +1,4 @@
 select tbannermagid,tbannerlocationid, changeby,
        changedate, fisused, fhyperlink, flinktype,
        fdatatable, fdataid from tbannermag
-       where siteid=$siteid$ and tbannerlocationid in $tbannerlocationid$
+       where siteid=$siteid$ and tbannerlocationid = $tbannerlocationid$ and tbannermagid=$tbannermagid$

+ 9 - 2
src/dsb/com/cnd3b/restcontroller/enterprise/bannermag/bannermag.java

@@ -26,7 +26,7 @@ public class bannermag extends Controller {
         locationSQL.addParameter("siteid", siteid);
         Rows locationrows = dbConnect.runSqlQuery(locationSQL.getSQL());
 
-        SQLFactory bannerSQl = new SQLFactory(this, "轮播广告查询");
+        SQLFactory bannerSQl = new SQLFactory(this, "轮播广告列表查询");
         bannerSQl.addParameter("siteid", siteid);
         bannerSQl.addParameter_in("tbannerlocationid", locationrows.toArrayList("tbannerlocationid"));
         RowsMap bannermap = dbConnect.runSqlQuery(bannerSQl.getSQL()).toRowsMap("tbannerlocationid");
@@ -63,6 +63,7 @@ public class bannermag extends Controller {
             tbannermag.setValue("siteid", siteid, 11L);//企业ID
             tbannermag.setValue("createby", username, 11L);//录入人
             tbannermag.setValue("createdate", sysdate, 11L);//录入时间
+            tbannermagid = tbannermag.getUniqueIDValue();
         } else {
             tbannermag = tbannermagSet.getPao(0);
         }
@@ -77,7 +78,13 @@ public class bannermag extends Controller {
         tbannermag.setValue("changeby", username, 11L);//修改人
         tbannermag.setValue("changedate", sysdate, 11L);//修改时间
         tbannermagSet.save();
-        return getSucReturnObject().toString();
+
+        SQLFactory bannerSQl = new SQLFactory(this, "轮播广告列表查询");
+        bannerSQl.addParameter("siteid", siteid);
+        bannerSQl.addParameter("tbannerlocationid", tbannerlocationid);
+        bannerSQl.addParameter("tbannermagid", tbannermagid);
+        Row row = dbConnect.runSqlQuery(0, bannerSQl.getSQL());
+        return getSucReturnObject().setData(row).toString();
     }
 
     public String delete_bannermag() throws P2Exception {