Commit a11d1fba authored by 黄毅's avatar 黄毅

Merge branch 'master' of http://gitlab.egolm.com/key/shop.git

parents 5cbd5147 78f845d7
...@@ -49,7 +49,7 @@ public class BrandServiceImpl implements BrandService { ...@@ -49,7 +49,7 @@ public class BrandServiceImpl implements BrandService {
@Override @Override
public List<Map<String, Object>> getHotSaleBrands(Map<String, Object> map) { public List<Map<String, Object>> getHotSaleBrands(Map<String, Object> map) {
List<Map<String,Object>> listMap = new ArrayList<Map<String,Object>>(); List<Map<String,Object>> listMap = new ArrayList<Map<String,Object>>();
String sql="SELECT TOP 20 " String sql="SELECT "// TOP 20
+ "BrandNO = b.sBrandID, " + "BrandNO = b.sBrandID, "
+ "BrandName = b.sBrandName, " + "BrandName = b.sBrandName, "
+ "ImgPath = b.sLogoUrl, " + "ImgPath = b.sLogoUrl, "
...@@ -61,7 +61,7 @@ public class BrandServiceImpl implements BrandService { ...@@ -61,7 +61,7 @@ public class BrandServiceImpl implements BrandService {
+ "and a.nGoodsID = acg.nGoodsID " + "and a.nGoodsID = acg.nGoodsID "
+ "WHERE acg.sOrgNO = ? " + "WHERE acg.sOrgNO = ? "
+ "GROUP BY b.sBrandID, b.sBrandName, b.sLogoUrl " + "GROUP BY b.sBrandID, b.sBrandName, b.sLogoUrl "
+ "ORDER BY sum(a.nSaleQty) DESC "; + "ORDER BY sum(a.nSaleQty) DESC limit 0,20 ";
String OrgNO=(String) map.get("OrgNO"); String OrgNO=(String) map.get("OrgNO");
listMap=jdbcTemplate.queryForList(sql, OrgNO); listMap=jdbcTemplate.queryForList(sql, OrgNO);
return listMap; return listMap;
......
...@@ -51,13 +51,14 @@ public class GoodsServiceImpl implements GoodsService { ...@@ -51,13 +51,14 @@ public class GoodsServiceImpl implements GoodsService {
@Override @Override
public List<Map<String, Object>> getHotSaleGoods(Map<String, Object> map) { public List<Map<String, Object>> getHotSaleGoods(Map<String, Object> map) {
List<Map<String,Object>> listMap = new ArrayList<Map<String,Object>>(); List<Map<String,Object>> listMap = new ArrayList<Map<String,Object>>();
String sql="SELECT TOP 20 " String sql="SELECT " // TOP 20
+"GoodsID = a.nGoodsID, " +"GoodsID = a.nGoodsID, "
+"GoodsNO = g.sGoodsNO, " +"GoodsNO = g.sGoodsNO, "
+"GoodsName = g.sGoodsDesc, " +"GoodsName = g.sGoodsDesc, "
+"Price = acg.nSalePrice, " +"Price = acg.nSalePrice, "
+"MinQty = acg.nMinSaleQty, " +"MinQty = acg.nMinSaleQty, "
+"SaleUnit = acg.nSaleUnits, " +"SaleUnit = acg.nSaleUnits, "
+"Unit = acg.sUnit, "
+"MarketPrice = acg.nMarketPrice, " +"MarketPrice = acg.nMarketPrice, "
+"MarketUnit = acg.sMarketUnit, " +"MarketUnit = acg.sMarketUnit, "
+"SaleQty = sum(a.nSaleQty) " +"SaleQty = sum(a.nSaleQty) "
...@@ -67,8 +68,8 @@ public class GoodsServiceImpl implements GoodsService { ...@@ -67,8 +68,8 @@ public class GoodsServiceImpl implements GoodsService {
+"and a.nGoodsID = acg.nGoodsID " +"and a.nGoodsID = acg.nGoodsID "
+"WHERE acg.sOrgNO = ? " +"WHERE acg.sOrgNO = ? "
+"GROUP BY a.nGoodsID, g.sGoodsNO, g.sGoodsDesc, " +"GROUP BY a.nGoodsID, g.sGoodsNO, g.sGoodsDesc, "
+"acg.nSalePrice, acg.nMinSaleQty, acg.nSaleUnits, acg.nMarketPrice, acg.sMarketUnit " +"acg.nSalePrice, acg.nMinSaleQty, acg.nSaleUnits,acg.sUnit, acg.nMarketPrice, acg.sMarketUnit "
+"ORDER BY sum(a.nSaleQty) DESC "; +"ORDER BY sum(a.nSaleQty) DESC limit 0,20";
String OrgNO=(String) map.get("OrgNO"); String OrgNO=(String) map.get("OrgNO");
listMap=jdbcTemplate.queryForList(sql, OrgNO); listMap=jdbcTemplate.queryForList(sql, OrgNO);
return listMap; 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