Commit 8dad2129 authored by chenzai's avatar chenzai

分页查询修改方法参数,sql语句适配国产数据库

parent bd8fb147
......@@ -28,10 +28,11 @@ public class IdxBizSyncController {
@RequestMapping(value = "/page/{tableName}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "列表分页查询", notes = "列表分页查询")
@ResponseBody
public List listPage(@PathVariable String tableName,
@RequestParam(value = "current",defaultValue = "1") int current,
@RequestParam(value = "size",defaultValue = "10") int size,
@RequestBody Map params) throws Exception{
public List listPage(@PathVariable String tableName, @RequestParam Map params) throws Exception{
int current = Integer.parseInt((String) params.get("current"));
int size = Integer.parseInt((String) params.get("size"));
params.remove("current");
params.remove("size");
List list = idxBizSyncService.selectAllPageQuery(tableName, params, current, size);
return list;
}
......
......@@ -34,7 +34,7 @@ public class IdxBizSyncServiceImpl extends BaseService<IdxBizXnzsDto, IdxBizXnzs
Iterator<Map.Entry<String, Object>> it = params.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, Object> entry = it.next();
sql = sql + entry.getKey() + " = " + "'" + entry.getValue() + "'" + " AND ";
sql = sql + "\"" + entry.getKey() + "\"" + " = " + "'" + entry.getValue() + "'" + " AND ";
}
sql += "1 = 1 ";
sql += " limit " + (current - 1) * size + "," + size;
......
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