添加地区查询部门列表接口
This commit is contained in:
parent
a8156ac3d3
commit
3da1d02e1e
@ -33,18 +33,34 @@ public interface IDepartmentBaseService {
|
|||||||
/**
|
/**
|
||||||
* 部门列表
|
* 部门列表
|
||||||
*
|
*
|
||||||
* @param areaCode
|
* @param departmentParentId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<DepartmentDTO> listByAreaCode(String areaCode);
|
List<DepartmentDTO> listByParentId(String departmentParentId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门列表
|
* 部门列表
|
||||||
*
|
*
|
||||||
* @param areaCode
|
* @param departmentAreaCode
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<DepartmentDTO> listAllByAreaCode(String areaCode);
|
List<DepartmentDTO> listByAreaCode(String departmentAreaCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门列表
|
||||||
|
*
|
||||||
|
* @param departmentAreaCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<DepartmentDTO> listAllByAreaCode(String departmentAreaCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门全部子列表
|
||||||
|
*
|
||||||
|
* @param departmentAreaCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<DepartmentDTO> listSubAllByAreaCode(String departmentAreaCode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过ID获取组织部门详情
|
* 通过ID获取组织部门详情
|
||||||
@ -74,20 +90,29 @@ public interface IDepartmentBaseService {
|
|||||||
/**
|
/**
|
||||||
* 组织部门列表
|
* 组织部门列表
|
||||||
*
|
*
|
||||||
* @param departmentParentId
|
* @param departmentAreaCode
|
||||||
* @param page
|
* @param page
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
SuccessResultList<List<DepartmentDTO>> listPageByAreaCode(String areaCode, ListPage page);
|
SuccessResultList<List<DepartmentDTO>> listPageByAreaCode(String departmentAreaCode, ListPage page);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组织部门列表
|
* 组织部门列表
|
||||||
*
|
*
|
||||||
* @param departmentParentId
|
* @param departmentAreaCode
|
||||||
* @param page
|
* @param page
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
SuccessResultList<List<DepartmentDTO>> listPageAllByAreaCode(String areaCode, ListPage page);
|
SuccessResultList<List<DepartmentDTO>> listPageAllByAreaCode(String departmentAreaCode, ListPage page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组织部门子列表
|
||||||
|
*
|
||||||
|
* @param departmentAreaCode
|
||||||
|
* @param page
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
SuccessResultList<List<DepartmentDTO>> listPageSubAllByAreaCode(String departmentAreaCode, ListPage page);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组织部门列表,递归获取全部内容
|
* 组织部门列表,递归获取全部内容
|
||||||
|
@ -44,16 +44,31 @@ public class DepartmentServiceImpl extends DefaultBaseService implements IDepart
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DepartmentDTO> listByAreaCode(String areaCode) {
|
public List<DepartmentDTO> listByParentId(String departmentParentId) {
|
||||||
Map<String, Object> params = getHashMap(2);
|
Map<String, Object> params = getHashMap(2);
|
||||||
params.put("departmentAreaCode", areaCode);
|
params.put("departmentParentId", departmentParentId);
|
||||||
return list(params);
|
return list(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DepartmentDTO> listAllByAreaCode(String areaCode) {
|
public List<DepartmentDTO> listByAreaCode(String departmentAreaCode) {
|
||||||
Map<String, Object> params = getHashMap(2);
|
Map<String, Object> params = getHashMap(2);
|
||||||
params.put("departmentAreaCodeLike", WStringUtil.cutContinuityRepeatCharDesc(areaCode, '0'));
|
params.put("departmentAreaCode", departmentAreaCode);
|
||||||
|
return list(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DepartmentDTO> listAllByAreaCode(String departmentAreaCode) {
|
||||||
|
Map<String, Object> params = getHashMap(2);
|
||||||
|
params.put("departmentAreaCodeLike", WStringUtil.cutContinuityRepeatCharDesc(departmentAreaCode, '0'));
|
||||||
|
return list(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DepartmentDTO> listSubAllByAreaCode(String departmentAreaCode) {
|
||||||
|
Map<String, Object> params = getHashMap(4);
|
||||||
|
params.put("departmentAreaCodeLike", WStringUtil.cutContinuityRepeatCharDesc(departmentAreaCode, '0'));
|
||||||
|
params.put("excludeDepartmentAreaCode", departmentAreaCode);
|
||||||
return list(params);
|
return list(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,8 +95,15 @@ public class DepartmentServiceImpl extends DefaultBaseService implements IDepart
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SuccessResultList<List<DepartmentDTO>> listPageAllByAreaCode(String areaCode, ListPage page) {
|
public SuccessResultList<List<DepartmentDTO>> listPageAllByAreaCode(String departmentAreaCode, ListPage page) {
|
||||||
page.getParams().put("departmentAreaCodeLike", WStringUtil.cutContinuityRepeatCharDesc(areaCode, '0'));
|
page.getParams().put("departmentAreaCodeLike", WStringUtil.cutContinuityRepeatCharDesc(departmentAreaCode, '0'));
|
||||||
|
return listPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SuccessResultList<List<DepartmentDTO>> listPageSubAllByAreaCode(String departmentAreaCode, ListPage page) {
|
||||||
|
page.getParams().put("departmentAreaCodeLike", WStringUtil.cutContinuityRepeatCharDesc(departmentAreaCode, '0'));
|
||||||
|
page.getParams().put("excludeDepartmentAreaCode", departmentAreaCode);
|
||||||
return listPage(page);
|
return listPage(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -42,7 +41,7 @@ public class DepartmentResourceController extends DefaultBaseController {
|
|||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@GetMapping("list")
|
@GetMapping("list")
|
||||||
public List<DepartmentDTO> list() {
|
public List<DepartmentDTO> list() {
|
||||||
Map<String, Object> params = new HashMap<>(0);
|
Map<String, Object> params = requestParams();
|
||||||
return departmentService.list(params);
|
return departmentService.list(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,7 +52,7 @@ public class DepartmentResourceController extends DefaultBaseController {
|
|||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@GetMapping("list/{departmentParentId}")
|
@GetMapping("list/{departmentParentId}")
|
||||||
public List<DepartmentDTO> list(@PathVariable("departmentParentId") String departmentParentId) {
|
public List<DepartmentDTO> list(@PathVariable("departmentParentId") String departmentParentId) {
|
||||||
Map<String, Object> params = new HashMap<>(0);
|
Map<String, Object> params = requestParams();
|
||||||
params.put("departmentParentId", departmentParentId);
|
params.put("departmentParentId", departmentParentId);
|
||||||
return departmentService.list(params);
|
return departmentService.list(params);
|
||||||
}
|
}
|
||||||
|
@ -190,16 +190,31 @@ public class DepartmentServiceImpl extends DefaultBaseService implements IDepart
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DepartmentDTO> listByAreaCode(String areaCode) {
|
public List<DepartmentDTO> listByParentId(String departmentParentId) {
|
||||||
Map<String, Object> params = getHashMap(2);
|
Map<String, Object> params = getHashMap(2);
|
||||||
params.put("departmentAreaCode", areaCode);
|
params.put("departmentParentId", departmentParentId);
|
||||||
return list(params);
|
return list(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DepartmentDTO> listAllByAreaCode(String areaCode) {
|
public List<DepartmentDTO> listByAreaCode(String departmentAreaCode) {
|
||||||
Map<String, Object> params = getHashMap(2);
|
Map<String, Object> params = getHashMap(2);
|
||||||
params.put("departmentAreaCodeLike", WStringUtil.cutContinuityRepeatCharDesc(areaCode, '0'));
|
params.put("departmentAreaCode", departmentAreaCode);
|
||||||
|
return list(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DepartmentDTO> listAllByAreaCode(String departmentAreaCode) {
|
||||||
|
Map<String, Object> params = getHashMap(2);
|
||||||
|
params.put("departmentAreaCodeLike", WStringUtil.cutContinuityRepeatCharDesc(departmentAreaCode, '0'));
|
||||||
|
return list(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DepartmentDTO> listSubAllByAreaCode(String departmentAreaCode) {
|
||||||
|
Map<String, Object> params = getHashMap(4);
|
||||||
|
params.put("departmentAreaCodeLike", WStringUtil.cutContinuityRepeatCharDesc(departmentAreaCode, '0'));
|
||||||
|
params.put("excludeDepartmentAreaCode", departmentAreaCode);
|
||||||
return list(params);
|
return list(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,6 +253,13 @@ public class DepartmentServiceImpl extends DefaultBaseService implements IDepart
|
|||||||
return listPage(page);
|
return listPage(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SuccessResultList<List<DepartmentDTO>> listPageSubAllByAreaCode(String departmentAreaCode, ListPage page) {
|
||||||
|
page.getParams().put("departmentAreaCodeLike", WStringUtil.cutContinuityRepeatCharDesc(departmentAreaCode, '0'));
|
||||||
|
page.getParams().put("excludeDepartmentAreaCode", departmentAreaCode);
|
||||||
|
return listPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DepartmentDTO get(String departmentId) {
|
public DepartmentDTO get(String departmentId) {
|
||||||
Map<String, Object> params = getHashMap(1);
|
Map<String, Object> params = getHashMap(1);
|
||||||
|
@ -414,7 +414,11 @@
|
|||||||
</if>
|
</if>
|
||||||
<if test="departmentAreaCodeLike != null and departmentAreaCodeLike != ''">
|
<if test="departmentAreaCodeLike != null and departmentAreaCodeLike != ''">
|
||||||
AND
|
AND
|
||||||
department_area_code LIKE CONCAT(#{departmentAreaCode}, '%')
|
department_area_code LIKE CONCAT(#{departmentAreaCodeLike}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="excludeDepartmentAreaCode != null and excludeDepartmentAreaCode != ''">
|
||||||
|
AND
|
||||||
|
department_area_code != #{excludeDepartmentAreaCode}
|
||||||
</if>
|
</if>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="sort != null and (sort == 'departmentName' or sort == 'departmentNameEn' or sort == 'departmentNameOther' or sort == 'departmentCode' or sort == 'departmentType' or sort == 'departmentState')">
|
<when test="sort != null and (sort == 'departmentName' or sort == 'departmentNameEn' or sort == 'departmentNameOther' or sort == 'departmentCode' or sort == 'departmentType' or sort == 'departmentState')">
|
||||||
@ -675,7 +679,11 @@
|
|||||||
</if>
|
</if>
|
||||||
<if test="departmentAreaCodeLike != null and departmentAreaCodeLike != ''">
|
<if test="departmentAreaCodeLike != null and departmentAreaCodeLike != ''">
|
||||||
AND
|
AND
|
||||||
department_area_code LIKE CONCAT(#{departmentAreaCode}, '%')
|
department_area_code LIKE CONCAT(#{departmentAreaCodeLike}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="excludeDepartmentAreaCode != null and excludeDepartmentAreaCode != ''">
|
||||||
|
AND
|
||||||
|
department_area_code != #{excludeDepartmentAreaCode}
|
||||||
</if>
|
</if>
|
||||||
<if test="departmentType != null and departmentType != ''">
|
<if test="departmentType != null and departmentType != ''">
|
||||||
AND
|
AND
|
||||||
|
Loading…
Reference in New Issue
Block a user