修改模糊查询字段

parent 85856ccb
...@@ -60,7 +60,9 @@ public class DqPersonelController { ...@@ -60,7 +60,9 @@ public class DqPersonelController {
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String"), @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "idcard", value = "身份证号", paramType = "query", dataType="String"), @ApiImplicitParam(name = "idcard", value = "身份证号", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "name", value = "身份证号", paramType = "query", dataType="String"), @ApiImplicitParam(name = "name", value = "身份证号", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "dqRegionId", value = "社区id", paramType = "query", dataType="int") @ApiImplicitParam(name = "dqRegionId", value = "社区id", paramType = "query", dataType="int"),
@ApiImplicitParam(name = "community", value = "社区地址", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "address", value = "详细地址", paramType = "query", dataType="String")
}) })
@RequiresPermissions("dq:dqpersonel:page") @RequiresPermissions("dq:dqpersonel:page")
@DataFilter() @DataFilter()
......
...@@ -50,7 +50,9 @@ public class DqRegionController { ...@@ -50,7 +50,9 @@ public class DqRegionController {
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "community", value = "社区地址", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "address", value = "详细地址", paramType = "query", dataType="String")
}) })
@RequiresPermissions("dq:dqregion:page") @RequiresPermissions("dq:dqregion:page")
public Result<PageData<DqRegionDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){ public Result<PageData<DqRegionDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
......
...@@ -54,6 +54,14 @@ public class DqPersonelServiceImpl extends CrudServiceImpl<DqPersonelDao, DqPers ...@@ -54,6 +54,14 @@ public class DqPersonelServiceImpl extends CrudServiceImpl<DqPersonelDao, DqPers
String name = (String)params.get("name"); String name = (String)params.get("name");
wrapper.like("name",name); wrapper.like("name",name);
} }
if(params.get("community") !=null){
String community = (String)params.get("community");
wrapper.like("community",community);
}
if(params.get("address") !=null){
String address = (String)params.get("address");
wrapper.like("address",address);
}
wrapper.eq(StringUtils.isNotBlank(id), "id", id).orderByDesc("dq_region_id"); wrapper.eq(StringUtils.isNotBlank(id), "id", id).orderByDesc("dq_region_id");
if(params.get(Constant.SQL_FILTER)!=null){ if(params.get(Constant.SQL_FILTER)!=null){
wrapper.apply(params.get(Constant.SQL_FILTER) != null, params.get(Constant.SQL_FILTER).toString()); wrapper.apply(params.get(Constant.SQL_FILTER) != null, params.get(Constant.SQL_FILTER).toString());
......
...@@ -27,6 +27,14 @@ public class DqRegionServiceImpl extends CrudServiceImpl<DqRegionDao, DqRegionEn ...@@ -27,6 +27,14 @@ public class DqRegionServiceImpl extends CrudServiceImpl<DqRegionDao, DqRegionEn
String id = (String)params.get("id"); String id = (String)params.get("id");
QueryWrapper<DqRegionEntity> wrapper = new QueryWrapper<>(); QueryWrapper<DqRegionEntity> wrapper = new QueryWrapper<>();
if(params.get("community") !=null){
String community = (String)params.get("community");
wrapper.like("community",community);
}
if(params.get("address") !=null){
String address = (String)params.get("address");
wrapper.like("address",address);
}
wrapper.eq(StringUtils.isNotBlank(id), "id", id); wrapper.eq(StringUtils.isNotBlank(id), "id", id);
return wrapper; return wrapper;
......
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