Browse Source

党组织列表调整为只看显示本组织及下级党组织,不展示同级及上级;一级组织选项规则调整

feature/teamB_zz_wgh
Jackwang 3 years ago
parent
commit
49791964ff
  1. 33
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/GetParentOrgFormDTO.java
  2. 16
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java
  3. 20
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java
  4. 10
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java
  5. 131
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java
  6. 56
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml

33
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/GetParentOrgFormDTO.java

@ -0,0 +1,33 @@
package com.epmet.resi.partymember.dto.partyOrg.form;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @program: epmet-cloud
* @description:
* @author: wangtong
* @create: 2022-06-10 16:02
**/
@Data
public class GetParentOrgFormDTO implements Serializable {
/**
* 党组织类型
*/
@NotNull(message = "党组织类型不可为空")
private String partyOrgType;
/**
* 行政组织 机关ID
*/
@NotNull(message = "行政组织id不可为空")
private String agencyId;
/**
* 客户Id (customer.id)
*/
private String customerId;
}

16
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java

@ -14,6 +14,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.modules.partyOrg.excel.IcPartyOrgExcel;
import com.epmet.modules.partyOrg.service.IcPartyOrgService;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.GetParentOrgFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
@ -121,6 +122,19 @@ public class IcPartyOrgController {
return icPartyOrgService.branchlist(tokenDto);
}
/**
* @describe: 上级党组织列表
* @author wangtong
* @date 2022/6/10 15:59
* @params [tokenDto, formDTO]
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO>>
*/
@GetMapping("getParentOrgList")
public Result<List<IcPartyOrgTreeDTO>> getParentOrgList(@LoginUser TokenDto tokenDto, GetParentOrgFormDTO formDTO){
//效验数据
ValidatorUtils.validateEntity(formDTO);
formDTO.setCustomerId(tokenDto.getCustomerId());
return icPartyOrgService.getParentOrgList(formDTO);
}
}

20
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java

@ -83,4 +83,24 @@ public interface IcPartyOrgDao extends BaseDao<IcPartyOrgEntity> {
* @return java.util.List<com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO>
*/
List<IcPartyOrgTreeDTO> getSearchTreelist(PartyOrgTreeListDTO formDTO);
/**
* @describe: 获取上级党组织
* @author wangtong
* @date 2022/6/10 16:48
* @params [agencyPid, customerId, code]
* @return java.util.List<com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO>
*/
List<IcPartyOrgTreeDTO> selectParentOrgByAgencyPid(@Param("agencyPid") String agencyPid,
@Param("customerId") String customerId,
@Param("partyOrgType") String partyOrgType);
/**
* @describe: 查询该客户下的一级组织
* @author wangtong
* @date 2022/6/10 17:29
* @params [customerId]
* @return com.epmet.modules.partyOrg.entity.IcPartyOrgEntity
*/
IcPartyOrgEntity selectByCustomerIdAndFirstOrg(@Param("customerId") String customerId);
}

10
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java

@ -6,6 +6,7 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.GetParentOrgFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
@ -107,4 +108,13 @@ public interface IcPartyOrgService extends BaseService<IcPartyOrgEntity> {
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO>>
*/
Result<List<IcPartyOrgTreeDTO>> getSearchTreelist(PartyOrgTreeListDTO formDTO);
/**
* @describe: 上级党组织列表
* @author wangtong
* @date 2022/6/10 16:01
* @params [formDTO]
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO>>
*/
Result<List<IcPartyOrgTreeDTO>> getParentOrgList(GetParentOrgFormDTO formDTO);
}

131
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java

@ -6,6 +6,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.PartyOrgTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
@ -14,13 +15,16 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.enums.OrgLevelEnums;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.modules.partyOrg.dao.IcPartyOrgDao;
import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity;
import com.epmet.modules.partyOrg.service.IcPartyOrgService;
import com.epmet.modules.partymember.dao.IcPartyMemberDao;
import com.epmet.modules.partymember.entity.IcPartyMemberEntity;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.GetParentOrgFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeSubDTO;
@ -48,6 +52,9 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
@Autowired
private IcPartyMemberDao icPartyMemberDao;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Override
public PageData<IcPartyOrgDTO> page(Map<String, Object> params) {
@ -65,8 +72,8 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
return ConvertUtils.sourceToTarget(entityList, IcPartyOrgDTO.class);
}
private QueryWrapper<IcPartyOrgEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
private QueryWrapper<IcPartyOrgEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcPartyOrgEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
@ -84,47 +91,47 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
@Transactional(rollbackFor = Exception.class)
public Result save(IcPartyOrgDTO dto) {
//同一个客户下,名称和编码不可重复
IcPartyOrgEntity repeatName = baseDao.selectByCuIdAndNameOrCode(dto.getPartyOrgName(),null,dto.getCustomerId());
if(null != repeatName){
IcPartyOrgEntity repeatName = baseDao.selectByCuIdAndNameOrCode(dto.getPartyOrgName(), null, dto.getCustomerId());
if (null != repeatName) {
throw new EpmetException("行政组织名称不可重复!");
}
if(StringUtils.isNotBlank(dto.getPartyOrgCode())){
IcPartyOrgEntity repeatCode = baseDao.selectByCuIdAndNameOrCode(null,dto.getPartyOrgCode(),dto.getCustomerId());
if(null != repeatCode){
if (StringUtils.isNotBlank(dto.getPartyOrgCode())) {
IcPartyOrgEntity repeatCode = baseDao.selectByCuIdAndNameOrCode(null, dto.getPartyOrgCode(), dto.getCustomerId());
if (null != repeatCode) {
throw new EpmetException("行政组织编码不可重复!");
}
}
IcPartyOrgEntity parentOrg = baseDao.selectById(dto.getOrgPid());
//判断当前党组织的类型是否是所选上级党组织类型的直接下级
if("0".equals(dto.getOrgPid())){
if(PartyOrgTypeEnum.BRANCH.getCode().equals(dto.getPartyOrgType())){
if ("0".equals(dto.getOrgPid())) {
if (PartyOrgTypeEnum.BRANCH.getCode().equals(dto.getPartyOrgType())) {
throw new EpmetException("支部不可设为一级组织!");
}
//一个客户下只能有一个一级组织
IcPartyOrgEntity levelOneOrg = baseDao.selectLevelOneOrgByCustomerId(dto.getCustomerId());
if(null != levelOneOrg){
if (null != levelOneOrg) {
throw new EpmetException("当前客户下已存在一级组织,不可重复添加!");
}
}else{
checkOrgType(parentOrg.getPartyOrgType(),dto.getPartyOrgType());
} else {
checkOrgType(parentOrg.getPartyOrgType(), dto.getPartyOrgType());
}
//如果不是支部,需要判断行政组织是否重复
if(!PartyOrgTypeEnum.BRANCH.getCode().equals(dto.getPartyOrgType())){
IcPartyOrgEntity isAgency = baseDao.selectByAgencyId(dto.getAgencyId(),PartyOrgTypeEnum.BRANCH.getCode());
if(null != isAgency){
if (!PartyOrgTypeEnum.BRANCH.getCode().equals(dto.getPartyOrgType())) {
IcPartyOrgEntity isAgency = baseDao.selectByAgencyId(dto.getAgencyId(), PartyOrgTypeEnum.BRANCH.getCode());
if (null != isAgency) {
throw new EpmetException("该行政组织已被关联!");
}
AgencyInfoCache agency = CustomerOrgRedis.getAgencyInfo(dto.getAgencyId());
//判断该所选的行政组织类型是否与当前党组织的类型一致
checnAgencyLevel(agency.getLevel(),dto.getPartyOrgType());
checnAgencyLevel(agency.getLevel(), dto.getPartyOrgType());
dto.setAgencyPids(agency.getPids());
}else{
} else {
//类型为支部时,行政组织信息与上级党组织一致
dto.setAgencyId(parentOrg.getAgencyId());
dto.setAgencyPids(parentOrg.getAgencyPids());
}
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(dto.getAgencyId());
if (null == agencyInfo){
if (null == agencyInfo) {
throw new EpmetException("组织信息获取失败");
}
IcPartyOrgEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyOrgEntity.class);
@ -133,43 +140,43 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
}
/**
* @describe: 判断当前党组织的类型是否是所选上级党组织类型的直接下级
* @author wangtong
* @date 2022/5/25 10:09
* @params [parentOrg, partyOrgType]
* @return void
*/
* @return void
* @describe: 判断当前党组织的类型是否是所选上级党组织类型的直接下级
* @author wangtong
* @date 2022/5/25 10:09
* @params [parentOrg, partyOrgType]
*/
private void checkOrgType(String parentOrgType, String partyOrgType) {
if(PartyOrgTypeEnum.BRANCH.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.PARTY.getCode().equals(parentOrgType)){
if (PartyOrgTypeEnum.BRANCH.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.PARTY.getCode().equals(parentOrgType)) {
throw new EpmetException("请保持上级党组织的类型与当前党组织类型为直接的上下级关系,选择党委作为上级组织!");
}else if(PartyOrgTypeEnum.PARTY.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.WORKING.getCode().equals(parentOrgType)){
} else if (PartyOrgTypeEnum.PARTY.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.WORKING.getCode().equals(parentOrgType)) {
throw new EpmetException("请保持上级党组织的类型与当前党组织类型为直接的上下级关系,选择党工委作为上级组织!");
}else if(PartyOrgTypeEnum.WORKING.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.DISTRICT.getCode().equals(parentOrgType)){
} else if (PartyOrgTypeEnum.WORKING.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.DISTRICT.getCode().equals(parentOrgType)) {
throw new EpmetException("请保持上级党组织的类型与当前党组织类型为直接的上下级关系,选择区委作为上级组织!");
}else if(PartyOrgTypeEnum.DISTRICT.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.MUNICIPAL.getCode().equals(parentOrgType)){
} else if (PartyOrgTypeEnum.DISTRICT.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.MUNICIPAL.getCode().equals(parentOrgType)) {
throw new EpmetException("请保持上级党组织的类型与当前党组织类型为直接的上下级关系,选择市委作为上级组织!");
}else if(PartyOrgTypeEnum.MUNICIPAL.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.PROVINCIAL.getCode().equals(parentOrgType)){
} else if (PartyOrgTypeEnum.MUNICIPAL.getCode().equals(partyOrgType) && !PartyOrgTypeEnum.PROVINCIAL.getCode().equals(parentOrgType)) {
throw new EpmetException("请保持上级党组织的类型与当前党组织类型为直接的上下级关系,选择省委作为上级组织!");
}
}
/**
* @describe: 判断该所选的行政组织类型是否与当前党组织的类型一致
* @author wangtong
* @date 2022/5/25 9:45
* @params [agencyLevel, partyOrgType]
* @return void
*/
* @return void
* @describe: 判断该所选的行政组织类型是否与当前党组织的类型一致
* @author wangtong
* @date 2022/5/25 9:45
* @params [agencyLevel, partyOrgType]
*/
private void checnAgencyLevel(String agencyLevel, String partyOrgType) {
if(PartyOrgTypeEnum.PROVINCIAL.getCode().equals(partyOrgType) && !OrgLevelEnums.PROVINCE.getLevel().equals(agencyLevel)){
if (PartyOrgTypeEnum.PROVINCIAL.getCode().equals(partyOrgType) && !OrgLevelEnums.PROVINCE.getLevel().equals(agencyLevel)) {
throw new EpmetException("请保持党组织类型与行政组织类型一致,选择省级的行政组织!");
}else if(PartyOrgTypeEnum.MUNICIPAL.getCode().equals(partyOrgType) && !OrgLevelEnums.CITY.getLevel().equals(agencyLevel)){
} else if (PartyOrgTypeEnum.MUNICIPAL.getCode().equals(partyOrgType) && !OrgLevelEnums.CITY.getLevel().equals(agencyLevel)) {
throw new EpmetException("请保持党组织类型与行政组织类型一致,选择市级的行政组织!");
}else if(PartyOrgTypeEnum.DISTRICT.getCode().equals(partyOrgType) && !OrgLevelEnums.DISTRICT.getLevel().equals(agencyLevel)){
} else if (PartyOrgTypeEnum.DISTRICT.getCode().equals(partyOrgType) && !OrgLevelEnums.DISTRICT.getLevel().equals(agencyLevel)) {
throw new EpmetException("请保持党组织类型与行政组织类型一致,选择区级的行政组织!");
}else if(PartyOrgTypeEnum.WORKING.getCode().equals(partyOrgType) && !OrgLevelEnums.STREET.getLevel().equals(agencyLevel)){
} else if (PartyOrgTypeEnum.WORKING.getCode().equals(partyOrgType) && !OrgLevelEnums.STREET.getLevel().equals(agencyLevel)) {
throw new EpmetException("请保持党组织类型与行政组织类型一致,选择街道级的行政组织!");
}else if(PartyOrgTypeEnum.PARTY.getCode().equals(partyOrgType) && !OrgLevelEnums.COMMUNITY.getLevel().equals(agencyLevel)){
} else if (PartyOrgTypeEnum.PARTY.getCode().equals(partyOrgType) && !OrgLevelEnums.COMMUNITY.getLevel().equals(agencyLevel)) {
throw new EpmetException("请保持党组织类型与行政组织类型一致,选择社区级的行政组织!");
}
}
@ -192,15 +199,15 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
// baseDao.deleteBatchIds(Arrays.asList(ids));
for(String id : ids){
for (String id : ids) {
//判断该组织是否有下级党组织
List<IcPartyOrgEntity> orgList = baseDao.selectAllByOrgId(id);
if(!CollectionUtils.isEmpty(orgList)){
if (!CollectionUtils.isEmpty(orgList)) {
throw new EpmetException("请先删除下级党组织!");
}
//判断该组织下是否有党员
List<IcPartyMemberEntity> memberList = icPartyMemberDao.selectAllByOrgId(id);
if(!CollectionUtils.isEmpty(memberList)){
if (!CollectionUtils.isEmpty(memberList)) {
throw new EpmetException("该组织下有党员信息暂时不可删除!");
}
baseDao.deleteById(id);
@ -215,15 +222,15 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
@Override
public Result<List<BranchlistTreeDTO>> branchlist(TokenDto tokenDto) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(),tokenDto.getUserId());
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
List<BranchlistTreeDTO> resultList = new ArrayList<>();
BranchlistTreeDTO result = new BranchlistTreeDTO();
result.setValue(staffInfo.getAgencyId());
// result.setOrgPids(staffInfo.getAgencyPIds());
result.setLabel(staffInfo.getAgencyName());
//该行政组织下的所有类型为支部的党组织
List<BranchlistTreeSubDTO> orgList = baseDao.selectAllBranchByAgencyId(staffInfo.getAgencyId(),tokenDto.getCustomerId());
if(CollectionUtils.isEmpty(orgList)){
List<BranchlistTreeSubDTO> orgList = baseDao.selectAllBranchByAgencyId(staffInfo.getAgencyId(), tokenDto.getCustomerId());
if (CollectionUtils.isEmpty(orgList)) {
return new Result<List<BranchlistTreeDTO>>().ok(resultList);
}
result.setChildren(orgList);
@ -237,6 +244,32 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
return new Result<List<IcPartyOrgTreeDTO>>().ok(build(list));
}
@Override
public Result<List<IcPartyOrgTreeDTO>> getParentOrgList(GetParentOrgFormDTO formDTO) {
Result<CustomerAgencyDTO> agencyDTOResult = govOrgOpenFeignClient.getAgencyById(formDTO.getAgencyId());
if (!agencyDTOResult.success() || null == agencyDTOResult || null == agencyDTOResult.getData()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询行政组织信息错误", "查询行政组织信息错误");
}
String agencyPid = agencyDTOResult.getData().getPid();
List<IcPartyOrgTreeDTO> list = new ArrayList<>();
//如果本工作人员的级别是该客户下的最高级别,并且没有一级组织时,添加一级组织选项
IcPartyOrgEntity entity = baseDao.selectByCustomerIdAndFirstOrg(formDTO.getCustomerId());
if("0".equals(agencyPid) && null == entity){
IcPartyOrgTreeDTO firstOrg = new IcPartyOrgTreeDTO();
firstOrg.setId("0");
firstOrg.setPartyOrgName("一级组织");
list.add(firstOrg);
}
//如果类型为支部,则查询该行政组织下的所有党委(列表)
if(PartyOrgTypeEnum.BRANCH.getCode().equals(formDTO.getPartyOrgType())){
list.addAll(baseDao.selectParentOrgByAgencyPid(agencyPid,formDTO.getCustomerId(),PartyOrgTypeEnum.PARTY.getCode()));
}else{
//查询该行政组织对应上级所关联的党组织(单个实体类)
list.addAll(baseDao.selectParentOrgByAgencyPid(agencyPid,formDTO.getCustomerId(),null));
}
return new Result<List<IcPartyOrgTreeDTO>>().ok(list);
}
/**
* 构建树节点
*/
@ -245,13 +278,13 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
//list转map
Map<String, IcPartyOrgTreeDTO> nodeMap = new LinkedHashMap<>(treeNodes.size());
for(IcPartyOrgTreeDTO treeNode : treeNodes){
for (IcPartyOrgTreeDTO treeNode : treeNodes) {
nodeMap.put(treeNode.getId(), treeNode);
}
for(IcPartyOrgTreeDTO node : nodeMap.values()) {
for (IcPartyOrgTreeDTO node : nodeMap.values()) {
IcPartyOrgTreeDTO parent = nodeMap.get(node.getPid());
if(parent != null && !(node.getId().equals(parent.getId()))){
if (parent != null && !(node.getId().equals(parent.getId()))) {
parent.getChildren().add(node);
continue;
}

56
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml

@ -98,31 +98,47 @@
</select>
<select id="getSearchTreelist"
resultType="com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO">
select ID,
CUSTOMER_ID,
ORG_PID as pid,
ORG_PIDS,
AGENCY_ID,
AGENCY_PIDS,
PARTY_ORG_TYPE,
PARTY_ORG_NAME
CUSTOMER_ID,
ORG_PID as pid,
ORG_PIDS,
AGENCY_ID,
AGENCY_PIDS,
PARTY_ORG_TYPE,
PARTY_ORG_NAME
from ic_party_org
where DEL_FLAG=0
and CUSTOMER_ID=#{customerId}
<choose>
<when test="orgPid != '' and orgPid != null and agencyId != null and agencyId != ''">
AND (AGENCY_PIDS LIKE concat('%',#{agencyId}, '%' )
or
id =#{orgPid})
</when>
<otherwise>
and CUSTOMER_ID=#{customerId}
<if test="agencyId != null and agencyId != ''">
AND AGENCY_PIDS LIKE concat('%',#{agencyId}, '%' )
AND( AGENCY_PIDS LIKE concat('%',#{agencyId}, '%' )
or
(PARTY_ORG_TYPE = '5' and AGENCY_ID=#{agencyId}))
</if>
</otherwise>
</choose>
</select>
<select id="selectParentOrgByAgencyPid"
resultType="com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO">
select ID,
CUSTOMER_ID,
ORG_PID as pid,
ORG_PIDS,
AGENCY_ID,
AGENCY_PIDS,
PARTY_ORG_TYPE,
PARTY_ORG_NAME
from ic_party_org
where DEL_FLAG = 0
and CUSTOMER_ID=#{customerId}
and AGENCY_ID=#{agencyPid}
<if test="partyOrgType != null and partyOrgType != ''">
and PARTY_ORG_TYPE = #{partyOrgType}
</if>
</select>
<select id="selectByCustomerIdAndFirstOrg" resultType="com.epmet.modules.partyOrg.entity.IcPartyOrgEntity">
select *
from ic_party_org
where DEL_FLAG = 0
and CUSTOMER_ID=#{customerId}
and ORG_PID = '0'
</select>

Loading…
Cancel
Save