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

1

parent ad4b8f45
......@@ -168,29 +168,21 @@ 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 = ""),
@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 = "int", required = true, value = "页码", defaultValue = "1"),
@ApiImplicitParam(paramType = "query", name = "limit", dataType = "int", required = true, value = "每页显示数", defaultValue = "10"),
@ApiImplicitParam(paramType = "query", name = "comId", dataType = "String", required = true, value = "类型", defaultValue = "0为全部"),
})
@RequestMapping(value = "/hotIPList",method=RequestMethod.GET)
public String hotIPList(HttpServletRequest request) {
String orgNO = request.getParameter("orgNo");
String comId = request.getParameter("comId");
String index = request.getParameter("index");
String limit = request.getParameter("limit");
if(!StringUtil.isNotEmpty(orgNO,comId,index,limit)) {
String comId = request.getParameter("comId");
if(!StringUtil.isNotEmpty(orgNO,comId)) {
return Rjx.json().setCode(-1).setMessage(I18NUtils.getMessage(orgNO,comId, "Msg_Parameter_empty")).toJson();
}
Map<String,Object> params = new HashMap<String,Object>();
params.put("orgNO", orgNO);
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) {
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, Page page);
public List<Map<String, Object>> hotIPList(Map<String, Object> params);
public Map<String, Object> hotIPDetail(Map<String, Object> params);
......
......@@ -105,19 +105,20 @@ public class BrandServiceImpl implements BrandService {
* @param page
* @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 comId = params.get("comId")+"";
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 "
+ " WHERE a.nTag&1=0 and a.sOrgNO = ? and a.nTag=2 ";
if(!comId.equals("0")) {
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) {
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