Commit 09dfbb07 authored by zhangch's avatar zhangch

列表查询条件机构的查询

parent d0eae670
...@@ -22,7 +22,7 @@ public interface DisableApplyMapper extends BaseMapper<ChDisableApply> { ...@@ -22,7 +22,7 @@ public interface DisableApplyMapper extends BaseMapper<ChDisableApply> {
/** /**
* 查询待遇申请管理列表 * 查询待遇申请管理列表
* *
* @param organId 机构代码 * @param organIds 机构代码集合
* @param isIncludeSubsidiaries 是否包含子机构 0包含,1不包含 * @param isIncludeSubsidiaries 是否包含子机构 0包含,1不包含
* @param provincial 省 * @param provincial 省
* @param city 市 * @param city 市
...@@ -32,7 +32,7 @@ public interface DisableApplyMapper extends BaseMapper<ChDisableApply> { ...@@ -32,7 +32,7 @@ public interface DisableApplyMapper extends BaseMapper<ChDisableApply> {
* @param dataFrom 申请来源 * @param dataFrom 申请来源
* @param srvOrganId 护理机构 * @param srvOrganId 护理机构
*/ */
Page<DisableVO> disableList(Page<DisableVO> page, String organId, String isIncludeSubsidiaries, String provincial, Page<DisableVO> disableList(Page<DisableVO> page, List<String> organIds, String isIncludeSubsidiaries, String provincial,
String city, String area, String name, String certiCode, String city, String area, String name, String certiCode,
String dataFrom, String srvOrganId); String dataFrom, String srvOrganId);
......
package com.hungraim.ism.service.impl; package com.hungraim.ism.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ism.dao.DisableApplyMapper; import com.hungraim.ism.dao.DisableApplyMapper;
...@@ -32,31 +33,62 @@ public class DisableServiceImpl implements DisableService { ...@@ -32,31 +33,62 @@ public class DisableServiceImpl implements DisableService {
@Autowired @Autowired
private FndStreetMapper fndStreetMapper; private FndStreetMapper fndStreetMapper;
/**
* 获取机构ids
*
* @param organId 父机构id
* @param organIds 机构list
*/
private void getOrganList(String organId, List<String> organIds) {
QueryWrapper<ChFndOrgan> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("STATUS", "1");
queryWrapper.eq("PARENT_ID", organId);
List<ChFndOrgan> organs = fndOrganMapper.selectList(queryWrapper);
if (organs != null && organs.size() != 0) {
for (ChFndOrgan chFndOrgan : organs) {
String childOrganId = chFndOrgan.getOrganId();
organIds.add(childOrganId);
if ("1".equals(chFndOrgan.getIsLeaf())) {
getOrganList(childOrganId, organIds);
}
}
}
}
@Override @Override
public Page<DisableVO> disableList(String organId, String isIncludeSubsidiaries, String districtProvincial, String districtCity, public Page<DisableVO> disableList(String organId, String isIncludeSubsidiaries, String districtProvincial, String districtCity,
String districtArea, String realName, String certiCode, String dataFrom, String districtArea, String realName, String certiCode, String dataFrom,
String srvOrganId, int page, int pageSize) { String srvOrganId, int page, int pageSize) {
//拼接子机构id // 没有organId参数的时候,这个集合就为null
if ("0".equals(isIncludeSubsidiaries)) { List<String> organIds = null;
boolean flag = true; if (StrUtil.isNotBlank(organId)) {
while (flag) { organIds = new ArrayList<>();
QueryWrapper<ChFndOrgan> queryWrapper = new QueryWrapper<>(); // 先把最顶层id添加到集合
queryWrapper.eq("STATUS", "1"); organIds.add(organId);
queryWrapper.eq("PARENT_ID", organId); // 获取子孙机构集合
List<ChFndOrgan> organs = fndOrganMapper.selectList(queryWrapper); if ("0".equals(isIncludeSubsidiaries)) {
if (organs != null && organs.size() != 0) { this.getOrganList(organId, organIds);
for (ChFndOrgan chFndOrgan : organs) { // boolean flag = true;
organId = organId + "," + chFndOrgan.getOrganId(); // while (flag) {
if ("2".equals(chFndOrgan.getIsLeaf())) { // QueryWrapper<ChFndOrgan> queryWrapper = new QueryWrapper<>();
flag = false; // queryWrapper.eq("STATUS", "1");
} // queryWrapper.eq("PARENT_ID", organId);
} // List<ChFndOrgan> organs = fndOrganMapper.selectList(queryWrapper);
} else { // if (organs != null && organs.size() != 0) {
flag = false; // for (ChFndOrgan chFndOrgan : organs) {
} // organId = organId + "," + chFndOrgan.getOrganId();
// if ("2".equals(chFndOrgan.getIsLeaf())) {
// flag = false;
// }
// }
// } else {
// flag = false;
// }
// }
} }
} }
return disableApplyMapper.disableList(new Page<>(page, pageSize), organId, isIncludeSubsidiaries, districtProvincial, return disableApplyMapper.disableList(new Page<>(page, pageSize), organIds, isIncludeSubsidiaries, districtProvincial,
districtCity, districtArea, realName, certiCode, dataFrom, srvOrganId); districtCity, districtArea, realName, certiCode, dataFrom, srvOrganId);
} }
......
...@@ -27,13 +27,11 @@ ...@@ -27,13 +27,11 @@
LEFT JOIN CH_FND_ORGAN o ON a.organ_id = o.ORGAN_ID LEFT JOIN CH_FND_ORGAN o ON a.organ_id = o.ORGAN_ID
LEFT JOIN CH_FND_SRV_MODE m ON a.srv_mode_id = m.SRV_MODE_ID LEFT JOIN CH_FND_SRV_MODE m ON a.srv_mode_id = m.SRV_MODE_ID
<where> <where>
<if test="organId != null and organId != ''"> <if test="organIds != null">
<if test="isIncludeSubsidiaries == '0'"> and a.organ_id in
and a.organ_id in (#{organId}) <foreach collection="organIds" item="organId" open="(" close=")" separator=",">
</if> #{organId}
<if test="isIncludeSubsidiaries != '0'"> </foreach>
and a.organ_id = #{organId}
</if>
</if> </if>
<if test="provincial != null and provincial != ''"> <if test="provincial != null and provincial != ''">
and a.DISTRICT_PROVINCIAL = #{provincial} and a.DISTRICT_PROVINCIAL = #{provincial}
......
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