Commit 7e99f0b2 authored by zhangyong's avatar zhangyong

1

parent 9e0d1cfb
......@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.egolm.common.StringUtil;
import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.Page;
import com.egolm.shop.service.PageService;
import com.egolm.shop.util.I18NUtils;
......@@ -48,7 +49,43 @@ public class PageController {
}else {
return Rjx.jsonOk().set("detail", new HashMap<String,Object>()).toString();
}
}
@ApiOperation("查询图标")
@ApiImplicitParams({
@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 = ""),
@ApiImplicitParam(paramType = "query", name = "iconGroupNO", dataType = "String", required = true, value = "图标组编号", defaultValue = ""),
@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 = "/queryIcon",method=RequestMethod.GET)
public String queryIcon(HttpServletRequest request) {
String iconGroupNO = request.getParameter("iconGroupNO");
String index = request.getParameter("index");
String limit = request.getParameter("limit");
if(!StringUtil.isNotEmpty(iconGroupNO,index,limit)) {
return Rjx.json().setCode(-1).setMessage(I18NUtils.getMessage(iconGroupNO, "Msg_Parameter_empty")).toJson();
}
Map<String,Object> params = new HashMap<String,Object>();
params.put("iconGroupNO", iconGroupNO);
Page page = new Page();
page.setIndex(Long.valueOf(index));
page.setLimit(Long.valueOf(limit));
page.setLimitKey(" IconNO asc");
}
List<Map<String,Object>> iconList = pageService.queryIcon(params,page);
if(iconList != null && iconList.size() >0) {
return Rjx.jsonOk().set("list", iconList.get(0)).toString();
}else {
return Rjx.jsonOk().set("list", new HashMap<String,Object>()).toString();
}
}
}
......@@ -3,6 +3,10 @@ package com.egolm.shop.service;
import java.util.List;
import java.util.Map;
import com.egolm.common.jdbc.Page;
public interface PageService {
public List<Map<String, Object>> query(Map<String, Object> params);
public List<Map<String, Object>> query(Map<String, Object> params);
public List<Map<String, Object>> queryIcon(Map<String, Object> params,Page page);
}
......@@ -7,6 +7,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.common.jdbc.Page;
import com.egolm.common.jdbc.dialect.SqlServerDialect;
import com.egolm.shop.service.PageService;
@Service
......@@ -14,10 +16,40 @@ public class PageServiceImpl implements PageService {
@Autowired
private JdbcTemplate jdbcTemplate;
/**
* 查询首页配置
* <p>Title: query</p>
* <p>Description: </p>
* @param params
* @return
* @see com.egolm.shop.service.PageService#query(java.util.Map)
*/
@Override
public List<Map<String, Object>> query(Map<String, Object> params) {
String sql = "SELECT sPlatformNO platformNO,sPlatformName platformName,sLogoPath1 logoPath1 ,sLogoPath2 logoPath2,sLogoPath3 logoPath3,sThemeNO themeNO,sThemeJson themeJson,sMemo memo,dLastUpdateTime lastUpdateTime "
+ " FROM tPlatformLayout " + "WHERE nTag &1=0 ORDER BY dLastUpdateTime DESC ";
jdbcTemplate.setDialect(new SqlServerDialect());
return jdbcTemplate.queryForList(sql);
}
/**
* 查询图标
* <p>Title: queryIcon</p>
* <p>Description: </p>
* @param params
* @param page
* @return
* @see com.egolm.shop.service.PageService#queryIcon(java.util.Map, com.egolm.common.jdbc.Page)
*/
@Override
public List<Map<String, Object>> queryIcon(Map<String, Object> params, Page page) {
String iconGroupNO = params.get("iconGroupNO")+"";
jdbcTemplate.setDialect(new SqlServerDialect());
String sql = " SELECT IconNO = i.sIconNO ,IconPath=i.sIconPath,DefaultTxt=i.sDefaultTxt,DefaultLinkType=i.sDefaultLinkType,DefaultLink=i.sDefaultLink "
+ " FROM tIcon i ,tIconGroup ig"
+ " WHERE i.sGroupNO = ig.sGroupNO AND ig.nTag&1=0 and ig.sGroupNO = ? ";
return jdbcTemplate.limit(sql, page, iconGroupNO);
}
}
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