Commit bf007f76 authored by chang20170705's avatar chang20170705

brand

parent 5b865f75
...@@ -9,5 +9,7 @@ public interface BrandService { ...@@ -9,5 +9,7 @@ public interface BrandService {
public List<Map<String,Object>> listBanner(Map<String,Object> params, Page page); public List<Map<String,Object>> listBanner(Map<String,Object> params, Page page);
public List<Map<String,Object>> getBrandList(Map<String,Object> map);
public List <Map<String,Object>> getHotSaleBrands(Map<String,Object> map);
} }
package com.egolm.shop.service.impl; package com.egolm.shop.service.impl;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -8,7 +9,6 @@ import org.apache.commons.logging.LogFactory; ...@@ -8,7 +9,6 @@ import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.egolm.common.StringUtil;
import com.egolm.common.jdbc.JdbcTemplate; import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page; import com.egolm.common.jdbc.Page;
import com.egolm.shop.service.BrandService; import com.egolm.shop.service.BrandService;
...@@ -32,4 +32,38 @@ public class BrandServiceImpl implements BrandService { ...@@ -32,4 +32,38 @@ public class BrandServiceImpl implements BrandService {
//return jdbcTemplate.limit(sql, page); //return jdbcTemplate.limit(sql, page);
} }
@Override
public List<Map<String, Object>> getBrandList(Map<String, Object> map) {
List<Map<String,Object>> listMap = new ArrayList<Map<String,Object>>();
String sql=" SELECT PinyinCode = b.sPinyinCode,BrandNO = acg.sBrandID, "
+ "BrandName = b.sBrandName,ImgPath = b.sLogoUrl "
+ "FROM tAgentContractGoods acg, tBrand b "
+ "WHERE acg.sBrandID = b.sBrandID and acg.sOrgNO = ? "
+ "group by b.sPinyinCode, acg.sBrandID, b.sBrandName, b.sLogoUrl "
+ "ORDER BY b.sPinyinCode ";
String OrgNO=(String) map.get("OrgNO");
listMap=jdbcTemplate.queryForList(sql, OrgNO);
return listMap;
}
@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 "
+ "BrandNO = b.sBrandID, "
+ "BrandName = b.sBrandName, "
+ "ImgPath = b.sLogoUrl, "
+ "SaleQty = sum(a.nSaleQty) "
+ "FROM tAgentGoodsDailyOnline a "
+ "JOIN tGoods g ON a.nGoodsID = g.nGoodsID "
+ "JOIN tBrand b ON g.sBrandID = b.sBrandID "
+ "JOIN tAgentContractGoods acg ON a.sAgentContractNO = acg.sAgentContractNO "
+ "and a.nGoodsID = acg.nGoodsID "
+ "WHERE acg.sOrgNO = ? "
+ "GROUP BY b.sBrandID, b.sBrandName, b.sLogoUrl "
+ "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