Commit 2aaf756e authored by 张永's avatar 张永

1

parent df07f7f4
......@@ -169,6 +169,9 @@ public class BrandController {
@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 = "comId", dataType = "String", required = true, value = "类型", defaultValue = "0为全部"),
@ApiImplicitParam(paramType = "query", name = "index", dataType = "String", required = false, value = "第几页", defaultValue = "1"),
@ApiImplicitParam(paramType = "query", name = "limit", dataType = "String", required = false, value = "每页数量", defaultValue = "20"),
})
@RequestMapping(value = "/hotIPList",method=RequestMethod.GET)
public String hotIPList(HttpServletRequest request) {
......@@ -181,8 +184,12 @@ public class BrandController {
params.put("orgNO", orgNO);
params.put("comId", comId);
Page page=new Page();
page.setIndex(Long.valueOf(request.getParameter("index")==null?"1":request.getParameter("index")));
page.setLimit(Long.valueOf(request.getParameter("limit")==null?"20":request.getParameter("limit")));
page.setLimitKey(" Sort desc");
List<Map<String,Object>> hotIPList = brandService.hotIPList(params);
List<Map<String,Object>> hotIPList = brandService.hotIPList(params,page);
if(hotIPList != null && hotIPList.size() >0) {
return Rjx.jsonOk().set("list", hotIPList).toString();
}else {
......
......@@ -13,7 +13,7 @@ public interface BrandService {
public List<Map<String, Object>> queryBrandList(String orgNo);
public List<Map<String, Object>> hotIPList(Map<String, Object> params);
public List<Map<String, Object>> hotIPList(Map<String, Object> params,Page page);
public Map<String, Object> hotIPDetail(Map<String, Object> params);
......
......@@ -105,7 +105,7 @@ public class BrandServiceImpl implements BrandService {
* @param page
* @return
*/
public List<Map<String, Object>> hotIPList(Map<String, Object> params) {
public List<Map<String, Object>> hotIPList(Map<String, Object> params,Page page) {
String orgNO = params.get("orgNO")+"";
String comId = params.get("comId")+"";
jdbcTemplate.setDialect(new SqlServerDialect());
......@@ -116,9 +116,9 @@ public class BrandServiceImpl implements BrandService {
if(!comId.equals("0")) {
sql += " and a.sIPBrandTypeID = '"+comId+"' ";
}
sql+= " ORDER BY a.nSort DESC " ;
//sql+= " ORDER BY a.nSort DESC " ;
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql, orgNO);
List<Map<String, Object>> list = jdbcTemplate.limit(sql,page, orgNO);
if(list != null && list.size() >0) {
for(Map<String,Object> map:list) {
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