Commit ac44a8f9 authored by chang20170705's avatar chang20170705

limit

parent 0871a41f
......@@ -51,7 +51,7 @@ public class BrandServiceImpl implements BrandService {
@Override
public List<Map<String, Object>> getHotSaleBrands(Map<String, Object> map) {
List<Map<String,Object>> listMap = new ArrayList<Map<String,Object>>();
String sql="SELECT TOP 20 "//
String sql="SELECT TOP 20 "
+ "BrandNO = b.sBrandID, "
+ "BrandName = b.sBrandName, "
+ "ImgPath = b.sLogoUrl, "
......@@ -63,7 +63,7 @@ public class BrandServiceImpl implements BrandService {
+ "and a.nGoodsID = acg.nGoodsID "
+ "WHERE acg.sOrgNO = ? "
+ "GROUP BY b.sBrandID, b.sBrandName, b.sLogoUrl "
+ "ORDER BY sum(a.nSaleQty) DESC ";//limit 0,20
+ "ORDER BY sum(a.nSaleQty) DESC ";
String OrgNO=(String) map.get("OrgNO");
listMap=jdbcTemplate.queryForList(sql, OrgNO);
return listMap;
......
......@@ -53,7 +53,7 @@ public class GoodsServiceImpl implements GoodsService {
@Override
public List<Map<String, Object>> getHotSaleGoods(Map<String, Object> map) {
List<Map<String,Object>> listMap = new ArrayList<Map<String,Object>>();
String sql="SELECT TOP 20" //
String sql="SELECT TOP 20"
+"GoodsID = a.nGoodsID, "
+"GoodsNO = g.sGoodsNO, "
+"GoodsName = g.sGoodsDesc, "
......@@ -71,7 +71,7 @@ public class GoodsServiceImpl implements GoodsService {
+"WHERE acg.sOrgNO = ? "
+"GROUP BY a.nGoodsID, g.sGoodsNO, g.sGoodsDesc, "
+"acg.nSalePrice, acg.nMinSaleQty, acg.nSaleUnits,acg.sUnit, acg.nMarketPrice, acg.sMarketUnit "
+"ORDER BY sum(a.nSaleQty) DESC ";//limit 0,20
+"ORDER BY sum(a.nSaleQty) DESC ";
String OrgNO=(String) map.get("OrgNO");
listMap=jdbcTemplate.queryForList(sql, OrgNO);
return listMap;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment