Browse Source

增加查询条件

feature/yujt_vim
zhangyuan 5 years ago
parent
commit
aae491042b
  1. 4
      epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java
  2. 3
      epdc-cloud-admin/src/main/resources/mapper/SysDeptDao.xml

4
epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java

@ -50,8 +50,8 @@ public class SysDeptController {
@GetMapping("list")
@ApiOperation("列表")
public Result<List<SysDeptDTO>> list() {
List<SysDeptDTO> list = sysDeptService.list(new HashMap<>(1));
public Result<List<SysDeptDTO>> list(@RequestParam Map<String, Object> params) {
List<SysDeptDTO> list = sysDeptService.list(params);
return new Result<List<SysDeptDTO>>().ok(list);
}

3
epdc-cloud-admin/src/main/resources/mapper/SysDeptDao.xml

@ -6,6 +6,9 @@
<select id="getList" resultType="com.elink.esua.epdc.entity.SysDeptEntity">
select t1.*,(select t2.name from sys_dept t2 where t2.id=t1.pid)parentName from sys_dept t1
where t1.del_flag = 0
<if test="areaCode != null and areaCode.trim() != ''">
and t1.area_code LIKE CONCAT( '%', #{areaCode}, '%' )
</if>
<if test="deptIdList != null">
and t1.id in
<foreach item="id" collection="deptIdList" open="(" separator="," close=")">

Loading…
Cancel
Save