Commit e637d3cc authored by Quxl's avatar Quxl

x

parent 36190a6c
......@@ -81,13 +81,10 @@ public class BrandController {
@ApiImplicitParam(paramType = "query", name = "sign", dataType = "String", required = true, value = "签名", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "timestamp", dataType = "String", required = true, value = "时间戳", defaultValue = "")
})
@RequestMapping(value = "/getBrandList",method=RequestMethod.GET)
public String getBrandList(HttpServletRequest request, HttpServletResponse response) {
@RequestMapping(value = "/getGroupBrandList",method=RequestMethod.GET)
public String getGroupBrandList(HttpServletRequest request, HttpServletResponse response) {
List<Map<String,Object>> listMap;
Map<String,Object> params=new HashMap<>();
params.put("orgNo", request.getParameter("orgNo"));
params.put("shopNo", request.getParameter("shopNo"));
listMap=brandService.getBrandList(params);
listMap=brandService.queryBrandList(request.getParameter("orgNo"));
String reg = "[A-Z]";
//用map把相同首字母放到同一个list中
Map<String,List> pinMap=new HashMap<>();
......@@ -123,6 +120,20 @@ public class BrandController {
return Rjx.jsonOk().set("list", returnList).toJson();
}
@ApiOperation("获取品牌列表")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "orgNo", dataType = "String", required = true, value = "区域编号", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "terminal", dataType = "String", required = true, value = "终端标识", defaultValue = "wechat"),
@ApiImplicitParam(paramType = "query", name = "langID", dataType = "String", required = true, value = "语言", defaultValue = "936"),
@ApiImplicitParam(paramType = "query", name = "sign", dataType = "String", required = true, value = "签名", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "timestamp", dataType = "String", required = true, value = "时间戳", defaultValue = "")
})
@RequestMapping(value = "/getBrandList",method=RequestMethod.GET)
public String getBrandList(String orgNo, HttpServletRequest request, HttpServletResponse response) {
List<Map<String, Object>> returnList = brandService.queryBrandList(orgNo);
return Rjx.jsonOk().set("list", returnList).toJson();
}
@ApiOperation("热销品牌列表")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "orgNo", dataType = "String", required = true, value = "区域编号", defaultValue = ""),
......
......@@ -9,7 +9,7 @@ public interface BrandService {
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, Page page);
public List<Map<String, Object>> queryBrandList(String orgNo);
}
......@@ -41,31 +41,6 @@ public class BrandServiceImpl implements BrandService {
return jdbcTemplate.limit(sql, page);
}
@Override
public List<Map<String, Object>> getBrandList(Map<String, Object> map) {
String sql="SELECT "
+ "b.sPinyinCode,"
+ "acg.sBrandID, "
+ "b.sBrandName,"
+ "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");
jdbcTemplate.setDialect(new SqlServerDialect());
return jdbcTemplate.queryForList(sql, orgNo);
}
@Override
public List<Map<String, Object>> getHotSaleBrands(Map<String, Object> map, Page page) {
String sql="SELECT "
......@@ -88,4 +63,27 @@ public class BrandServiceImpl implements BrandService {
jdbcTemplate.setDialect(new SqlServerDialect());
return jdbcTemplate.limit(sql, page,orgNo);
}
@Override
public List<Map<String, Object>> queryBrandList(String orgNo) {
String sql="SELECT "
+ "b.sPinyinCode,"
+ "acg.sBrandID, "
+ "b.sBrandName,"
+ "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 ";
return jdbcTemplate.queryForList(sql, orgNo);
}
}
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