Commit 54f4426e authored by 张永's avatar 张永

1

parent ad4b8f45
...@@ -169,28 +169,20 @@ public class BrandController { ...@@ -169,28 +169,20 @@ public class BrandController {
@ApiImplicitParam(paramType = "query", name = "timestamp", dataType = "String", required = true, value = "时间戳", defaultValue = ""), @ApiImplicitParam(paramType = "query", name = "timestamp", dataType = "String", required = true, value = "时间戳", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "orgNo", dataType = "String", required = true, value = "组织机构", defaultValue = ""), @ApiImplicitParam(paramType = "query", name = "orgNo", dataType = "String", required = true, value = "组织机构", defaultValue = ""),
@ApiImplicitParam(paramType = "query", name = "comId", dataType = "String", required = true, value = "类型", defaultValue = "0为全部"), @ApiImplicitParam(paramType = "query", name = "comId", dataType = "String", required = true, value = "类型", defaultValue = "0为全部"),
@ApiImplicitParam(paramType = "query", name = "index", dataType = "int", required = true, value = "页码", defaultValue = "1"),
@ApiImplicitParam(paramType = "query", name = "limit", dataType = "int", required = true, value = "每页显示数", defaultValue = "10"),
}) })
@RequestMapping(value = "/hotIPList",method=RequestMethod.GET) @RequestMapping(value = "/hotIPList",method=RequestMethod.GET)
public String hotIPList(HttpServletRequest request) { public String hotIPList(HttpServletRequest request) {
String orgNO = request.getParameter("orgNo"); String orgNO = request.getParameter("orgNo");
String comId = request.getParameter("comId"); String comId = request.getParameter("comId");
String index = request.getParameter("index"); if(!StringUtil.isNotEmpty(orgNO,comId)) {
String limit = request.getParameter("limit");
if(!StringUtil.isNotEmpty(orgNO,comId,index,limit)) {
return Rjx.json().setCode(-1).setMessage(I18NUtils.getMessage(orgNO,comId, "Msg_Parameter_empty")).toJson(); return Rjx.json().setCode(-1).setMessage(I18NUtils.getMessage(orgNO,comId, "Msg_Parameter_empty")).toJson();
} }
Map<String,Object> params = new HashMap<String,Object>(); Map<String,Object> params = new HashMap<String,Object>();
params.put("orgNO", orgNO); params.put("orgNO", orgNO);
params.put("comId", comId); params.put("comId", comId);
Page page = new Page();
page.setIndex(Long.valueOf(index));
page.setLimit(Long.valueOf(limit));
page.setLimitKey(" Sort asc ");
List<Map<String,Object>> hotIPList = brandService.hotIPList(params,page); List<Map<String,Object>> hotIPList = brandService.hotIPList(params);
if(hotIPList != null && hotIPList.size() >0) { if(hotIPList != null && hotIPList.size() >0) {
return Rjx.jsonOk().set("list", hotIPList).toString(); return Rjx.jsonOk().set("list", hotIPList).toString();
}else { }else {
......
...@@ -13,7 +13,7 @@ public interface BrandService { ...@@ -13,7 +13,7 @@ public interface BrandService {
public List<Map<String, Object>> queryBrandList(String orgNo); public List<Map<String, Object>> queryBrandList(String orgNo);
public List<Map<String, Object>> hotIPList(Map<String, Object> params, Page page); public List<Map<String, Object>> hotIPList(Map<String, Object> params);
public Map<String, Object> hotIPDetail(Map<String, Object> params); public Map<String, Object> hotIPDetail(Map<String, Object> params);
......
...@@ -105,19 +105,20 @@ public class BrandServiceImpl implements BrandService { ...@@ -105,19 +105,20 @@ public class BrandServiceImpl implements BrandService {
* @param page * @param page
* @return * @return
*/ */
public List<Map<String, Object>> hotIPList(Map<String, Object> params, Page page) { public List<Map<String, Object>> hotIPList(Map<String, Object> params) {
String orgNO = params.get("orgNO")+""; String orgNO = params.get("orgNO")+"";
String comId = params.get("comId")+""; String comId = params.get("comId")+"";
jdbcTemplate.setDialect(new SqlServerDialect()); jdbcTemplate.setDialect(new SqlServerDialect());
String sql = "SELECT IPID = a.sIPID, OrgNO = a.sOrgNO,OrgName = o.sOrgDesc,BrandName = b.sBrandName,IPBrandTypeID = sIPBrandTypeID, IPBrandType = a.sIPBrandType,Sort = a.nSort " String sql = "SELECT IPID = a.sIPID, OrgNO = a.sOrgNO,OrgName = o.sOrgDesc,BrandName = b.sBrandName,IPBrandTypeID = sIPBrandTypeID, IPBrandType = a.sIPBrandType,Sort = isnull(a.nSort,0) "
+ " FROM tIPBrand a join tOrg o on a.sOrgNO = o.sOrgNO join tBrand b on a.sBrandID = b.sBrandID " + " FROM tIPBrand a join tOrg o on a.sOrgNO = o.sOrgNO join tBrand b on a.sBrandID = b.sBrandID "
+ " WHERE a.nTag&1=0 and a.sOrgNO = ? and a.nTag=2 "; + " WHERE a.nTag&1=0 and a.sOrgNO = ? and a.nTag=2 ";
if(!comId.equals("0")) { if(!comId.equals("0")) {
sql += " and a.sIPBrandTypeID = '"+comId+"' "; sql += " and a.sIPBrandTypeID = '"+comId+"' ";
} }
sql+= " ORDER BY a.nSort DESC " ;
List<Map<String, Object>> list = jdbcTemplate.limit(sql, page, orgNO); List<Map<String, Object>> list = jdbcTemplate.queryForList(sql, orgNO);
if(list != null && list.size() >0) { if(list != null && list.size() >0) {
for(Map<String,Object> map:list) { for(Map<String,Object> map:list) {
String IPID = map.get("IPID")+""; String IPID = map.get("IPID")+"";
......
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