|
@@ -5,22 +5,16 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
5
|
5
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
6
|
6
|
import com.huiju.estateagents.base.BaseController;
|
7
|
7
|
import com.huiju.estateagents.base.ResponseBean;
|
|
8
|
+import com.huiju.estateagents.common.CommConstant;
|
8
|
9
|
import com.huiju.estateagents.common.DBUtils;
|
9
|
10
|
import com.huiju.estateagents.common.DateUtils;
|
10
|
11
|
import com.huiju.estateagents.common.StringUtils;
|
11
|
|
-import org.checkerframework.checker.units.qual.A;
|
|
12
|
+import com.huiju.estateagents.entity.TaOfficeContact;
|
|
13
|
+import com.huiju.estateagents.service.ITaOfficeContactService;
|
12
|
14
|
import org.slf4j.Logger;
|
13
|
15
|
import org.slf4j.LoggerFactory;
|
14
|
16
|
import org.springframework.beans.factory.annotation.Autowired;
|
15
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
16
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
17
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
18
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
19
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
20
|
|
-import org.springframework.web.bind.annotation.ResponseBody;
|
21
|
|
-import com.huiju.estateagents.service.ITaOfficeContactService;
|
22
|
|
-import com.huiju.estateagents.entity.TaOfficeContact;
|
23
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
17
|
+import org.springframework.web.bind.annotation.*;
|
24
|
18
|
|
25
|
19
|
/**
|
26
|
20
|
* <p>
|
|
@@ -31,7 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
|
31
|
25
|
* @since 2020-06-11
|
32
|
26
|
*/
|
33
|
27
|
@RestController
|
34
|
|
-@RequestMapping("/")
|
|
28
|
+@RequestMapping("/api")
|
35
|
29
|
public class TaOfficeContactController extends BaseController {
|
36
|
30
|
|
37
|
31
|
private final Logger logger = LoggerFactory.getLogger(TaOfficeContactController.class);
|
|
@@ -51,14 +45,24 @@ public class TaOfficeContactController extends BaseController {
|
51
|
45
|
* @param pageSize
|
52
|
46
|
* @return
|
53
|
47
|
*/
|
54
|
|
- @RequestMapping(value="/taOfficeContact",method= RequestMethod.GET)
|
|
48
|
+ @RequestMapping(value="/channel/taOfficeContact",method= RequestMethod.GET)
|
55
|
49
|
public ResponseBean taOfficeContactList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
56
|
|
- @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
|
|
50
|
+ @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
|
|
51
|
+ @RequestParam(value ="company",required = false) String company,
|
|
52
|
+ @RequestParam(value ="name",required = false) String name,
|
|
53
|
+ @RequestParam(value ="phone",required = false) String phone,
|
|
54
|
+ @RequestParam(value ="status",required = false) Integer status
|
|
55
|
+ ){
|
57
|
56
|
ResponseBean responseBean = new ResponseBean();
|
58
|
57
|
try {
|
59
|
58
|
//使用分页插件
|
60
|
59
|
IPage<TaOfficeContact> pg = new Page<>(pageNum, pageSize);
|
61
|
60
|
QueryWrapper<TaOfficeContact> queryWrapper = new QueryWrapper<>();
|
|
61
|
+ queryWrapper.like(!StringUtils.isEmpty(company),"company",company);
|
|
62
|
+ queryWrapper.like(!StringUtils.isEmpty(name),"name",name);
|
|
63
|
+ queryWrapper.like(!StringUtils.isEmpty(phone),"phone",phone);
|
|
64
|
+ queryWrapper.eq(null != status,"status",status);
|
|
65
|
+ queryWrapper.gt("status", CommConstant.STATUS_DELETE);
|
62
|
66
|
queryWrapper.orderByDesc("create_date");
|
63
|
67
|
|
64
|
68
|
IPage<TaOfficeContact> result = iTaOfficeContactService.page(pg, queryWrapper);
|