KzyUserController.java
2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package com.server.web.controller;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.server.web.common.model.PageModel;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 用户管理
*/
@RestController
@RequestMapping(BaseController.OSS_NAMESPACE + "/kzyUser")
public class KzyUserController extends BaseController {
/**
* 用户列表
* @param fullName
* @param duty
* @param phone
* @param pageNo
* @param pageSize
* @return
*/
@ResponseBody
@RequestMapping(path = "/list", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map list(@RequestParam(defaultValue = "") String fullName,
@RequestParam(defaultValue = "") String duty,@RequestParam(defaultValue = "") String phone
,@RequestParam(defaultValue = "1") Integer pageNo, @RequestParam(defaultValue = "1") Integer pageSize) {
try {
Map paramMap = new HashMap<>();
if(!("").equals(fullName)){
paramMap.put("fullName","%"+fullName+"%");
}
if(!("").equals(duty)){
paramMap.put("duty","%"+duty+"%");
}
if(!("").equals(phone)){
paramMap.put("phone",phone);
}
PageHelper.startPage(pageNo,pageSize,true,false);
List list = openSqlRingsService.selectList_Rings("com.mapping.queryModel.queryUser",paramMap);
PageInfo pageInfo = new PageInfo(list);
PageModel model = new PageModel();
model.setTotal(pageInfo.getTotal());
model.setList(list);
return success(model);
} catch (Exception e) {
e.printStackTrace();
return error("0","系统异常",null);
}
}
/**
* 积分列表
* @param id
* @param pageNo
* @param pageSize
* @return
*/
@ResponseBody
@RequestMapping(path = "/integralList", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map integralList(@RequestParam(defaultValue = "") Long id,@RequestParam(defaultValue = "1") Integer pageNo, @RequestParam(defaultValue = "1") Integer pageSize) {
try {
Map paramMap = new HashMap<>();
paramMap.put("id",id);
PageHelper.startPage(pageNo,pageSize,true,false);
List list = openSqlRingsService.selectList_Rings("com.mapping.queryModel.queryUserIntegral",paramMap);
PageInfo pageInfo = new PageInfo(list);
PageModel model = new PageModel();
model.setTotal(pageInfo.getTotal());
model.setList(list);
return success(model);
} catch (Exception e) {
e.printStackTrace();
return error("0","系统异常",null);
}
}
}