|
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
4
|
4
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
5
|
5
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
6
|
6
|
import com.huiju.estateagents.base.ResponseBean;
|
|
7
|
+import com.huiju.estateagents.common.StringUtils;
|
7
|
8
|
import com.huiju.estateagents.entity.TaEventProperties;
|
8
|
9
|
import com.huiju.estateagents.service.ITaEventPropertiesService;
|
9
|
10
|
import org.slf4j.Logger;
|
|
@@ -27,7 +28,7 @@ import com.huiju.estateagents.base.BaseController;
|
27
|
28
|
* @since 2019-08-06
|
28
|
29
|
*/
|
29
|
30
|
@RestController
|
30
|
|
-@RequestMapping("/")
|
|
31
|
+@RequestMapping("/api")
|
31
|
32
|
public class TaEventPropertiesController extends BaseController {
|
32
|
33
|
|
33
|
34
|
private final Logger logger = LoggerFactory.getLogger(TaEventPropertiesController.class);
|
|
@@ -42,14 +43,19 @@ public class TaEventPropertiesController extends BaseController {
|
42
|
43
|
* @param pageSize
|
43
|
44
|
* @return
|
44
|
45
|
*/
|
45
|
|
- @RequestMapping(value="/taEventProperties",method= RequestMethod.GET)
|
|
46
|
+ @RequestMapping(value="/admin/taEventProperties",method= RequestMethod.GET)
|
46
|
47
|
public ResponseBean taEventPropertiesList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
47
|
|
- @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
|
|
48
|
+ @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
|
|
49
|
+ @RequestParam(value ="eventType", required = false) String eventType,
|
|
50
|
+ @RequestParam(value ="buildingId",required = false) String buildingId
|
|
51
|
+ ){
|
48
|
52
|
ResponseBean responseBean = new ResponseBean();
|
49
|
53
|
try {
|
50
|
54
|
//使用分页插件
|
51
|
55
|
IPage<TaEventProperties> pg = new Page<>(pageNum, pageSize);
|
52
|
56
|
QueryWrapper<TaEventProperties> queryWrapper = new QueryWrapper<>();
|
|
57
|
+ queryWrapper.eq(!StringUtils.isEmpty(eventType), "event_type", eventType);
|
|
58
|
+ queryWrapper.eq(!StringUtils.isEmpty(buildingId), "building_id", buildingId);
|
53
|
59
|
queryWrapper.orderByDesc("create_date");
|
54
|
60
|
|
55
|
61
|
IPage<TaEventProperties> result = iTaEventPropertiesService.page(pg, queryWrapper);
|