|
@@ -8,6 +8,7 @@ import com.huiju.estateagents.base.ResponseBean;
|
8
|
8
|
import com.huiju.estateagents.common.CommConstant;
|
9
|
9
|
import com.huiju.estateagents.entity.TdPointsRules;
|
10
|
10
|
import com.huiju.estateagents.service.ITdPointsRulesService;
|
|
11
|
+import org.apache.commons.lang3.StringUtils;
|
11
|
12
|
import org.slf4j.Logger;
|
12
|
13
|
import org.slf4j.LoggerFactory;
|
13
|
14
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -45,13 +46,21 @@ public class TdPointsRulesController extends BaseController {
|
45
|
46
|
*/
|
46
|
47
|
@RequestMapping(value="/admin/tdPointsRules",method= RequestMethod.GET)
|
47
|
48
|
public ResponseBean tdPointsRulesList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
|
48
|
|
- @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
|
|
49
|
+ @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
|
|
50
|
+ @RequestParam(value ="buildingId", required = false) String buildingId,
|
|
51
|
+ @RequestParam(value = "type", required = false) String type){
|
49
|
52
|
ResponseBean responseBean = new ResponseBean();
|
50
|
53
|
try {
|
51
|
54
|
//使用分页插件
|
52
|
55
|
IPage<TdPointsRules> pg = new Page<>(pageNum, pageSize);
|
53
|
56
|
QueryWrapper<TdPointsRules> queryWrapper = new QueryWrapper<>();
|
54
|
57
|
queryWrapper.orderByDesc("create_date");
|
|
58
|
+ queryWrapper.eq(StringUtils.isNotBlank(buildingId),"building_id", buildingId);
|
|
59
|
+ if (CommConstant.POINTS_RULE_PLATFORM.equals(type)) {
|
|
60
|
+ queryWrapper.isNull("building_id");
|
|
61
|
+ } else if (CommConstant.POINTS_RULE_PROJECT.equals(type)) {
|
|
62
|
+ queryWrapper.isNotNull("building_id");
|
|
63
|
+ }
|
55
|
64
|
|
56
|
65
|
IPage<TdPointsRules> result = iTdPointsRulesService.page(pg, queryWrapper);
|
57
|
66
|
responseBean.addSuccess(result);
|