springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/partybuilding/PageComDataStatisticsMemberDto.java
@@ -21,6 +21,6 @@ @ApiModelProperty(value = "关键词") private String keyWord; @ApiModelProperty(value = "1.本年 2.") private Integer type; @ApiModelProperty(value = "年份") private Integer month; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/ComDataStatisticsMemberVo.java
New file @@ -0,0 +1,32 @@ package com.panzhihua.common.model.vos.partybuilding; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @author lyq * 分页查询党建数据统计返回参数 */ @Data @ApiModel("分页查询党建数据统计返回参数") public class ComDataStatisticsMemberVo { @ApiModelProperty(value = "党员id") private Long id; @ApiModelProperty(value = "党员姓名") private String name; @ApiModelProperty(value = "党员头像url") private String photoPath; @ApiModelProperty(value = "是否是党委(1.是 2.否)") private Integer isRole; @ApiModelProperty(value = "党员类型(1.预备党员 2.正式党员)") private Integer type; @ApiModelProperty(value = "性别(1.是 2.否)") private Integer sex; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/PartyOrganizationVO.java
@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.List; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 党组织 @@ -27,4 +29,43 @@ private Long pageNum = 1L; @ApiModelProperty(value = "分页-每页记录数", example = "10") private Long pageSize = 10L; @ApiModelProperty(value = "关键词") private String keyWord; @ApiModelProperty(value = "上级id") private Long parentId; @ApiModelProperty(value = "组织类别(1.基层党委 2.二级基层党委 3.党总支 4.党支部 5.党小组)") private Integer type; @ApiModelProperty(value = "组织隶属(1.乡镇 2.机关 3.域市街道 3.域市社区(居委会) 4.农村社区居委会 5.建制村 6.国有经济控制 7.集体经济控制 8.非公有经济控制 9.事业单位 10.社会组织 11.其他)") private Integer subjection; @ApiModelProperty(value = "小区id") private Long areaId; @ApiModelProperty(value = "楼栋id") private Long buildId; @ApiModelProperty(value = "所属小区名字") private Long areaName; @ApiModelProperty(value = "组织地址") private String address; @ApiModelProperty(value = "经度") private String longitude; @ApiModelProperty(value = "纬度") private String latitude; @ApiModelProperty(value = "一级id") private Long oneId; @ApiModelProperty(value = "二级id") private Long twoId; @ApiModelProperty(value = "三级id") private Long thirdId; @ApiModelProperty(value = "四级id") private Long fourId; @ApiModelProperty(value = "五级id") private Long fiveId; @ApiModelProperty(value = "党组织负责人名称") private String userName; @ApiModelProperty(value = "党组织负责人联系电话") private String phone; @ApiModelProperty(value = "党组织下子组织") private List<PartyOrganizationVO> childList; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/partybuilding/PartyBuildingService.java
@@ -39,7 +39,7 @@ R listPartyOrganization(@RequestParam("communityId") Long communityId); /** * 社区所有的党组织列表 * 分页查询所有的党组织列表 * * @return 党组织集合 */ @@ -47,6 +47,14 @@ R listPartyOrganizationAll(@RequestBody PartyOrganizationVO partyOrganizationVO); /** * 查询所有党组织列表 * @param partyOrganizationVO 请求参数 * @return 党组织列表 */ @PostMapping("/partybuildIng/getPbOrgAllList") R getPbOrgAllList(@RequestBody PartyOrganizationVO partyOrganizationVO); /** * 新增党支部 * * @param partyOrganizationVO springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityPartyBuildingApi.java
@@ -11,6 +11,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.panzhihua.common.model.dtos.partybuilding.PageComDataStatisticsMemberDto; import com.panzhihua.common.model.vos.user.SysTemplateConfigVO; import com.panzhihua.common.service.partybuilding.ComDataStatisticsFeign; import com.panzhihua.community_backstage.config.MinioUtil; @@ -107,13 +108,22 @@ return partyBuildingService.listPartyOrganization(communityId); } @ApiOperation(value = "社区所有党组织列表", response = PartyOrganizationVO.class) @ApiOperation(value = "分页查询社区所有党组织列表", response = PartyOrganizationVO.class) @PostMapping("listpartyorganizationAll") public R listPartyOrganizationAll(@RequestBody PartyOrganizationVO partyOrganizationVO) { Long communityId = this.getCommunityId(); partyOrganizationVO.setCommunityId(communityId); log.info("社区所有党组织社区id【{}】", communityId); return partyBuildingService.listPartyOrganizationAll(partyOrganizationVO); } @ApiOperation(value = "查询社区所有党组织列表", response = PartyOrganizationVO.class) @PostMapping("getPbOrgAllList") public R getPbOrgAllList(@RequestBody PartyOrganizationVO partyOrganizationVO) { Long communityId = this.getCommunityId(); partyOrganizationVO.setCommunityId(communityId); log.info("社区所有党组织社区id【{}】", communityId); return partyBuildingService.getPbOrgAllList(partyOrganizationVO); } @OperLog(operModul = "党支部管理", operType = 1) @@ -778,7 +788,7 @@ @ApiOperation(value = "党员数据统计-分页查询党员数据") @PostMapping("/dataStatistics/member/page") public R pageDataStatisticsMember(@RequestParam("id") Long id) { public R pageDataStatisticsMember(@RequestBody PageComDataStatisticsMemberDto statisticsMemberDto) { return null; } } springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/api/PartyBuildIngApi.java
@@ -57,7 +57,7 @@ } /** * 社区所有党组织列表 * 分页查询社区所有党组织列表 * * @return 党组织集合 */ @@ -67,6 +67,16 @@ } /** * 查询所有党组织列表 * @param partyOrganizationVO 请求参数 * @return 党组织列表 */ @PostMapping("getPbOrgAllList") public R getPbOrgAllList(@RequestBody PartyOrganizationVO partyOrganizationVO) { return partyOrganizationService.getPbOrgAllList(partyOrganizationVO); } /** * 新增党支部 * * @param partyOrganizationVO springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/dao/ComPbOrgDAO.java
@@ -10,6 +10,8 @@ import com.panzhihua.common.model.vos.partybuilding.PartyOrganizationVO; import com.panzhihua.service_dangjian.model.dos.ComPbOrgDO; import java.util.List; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 党组织 @@ -19,8 +21,27 @@ @Mapper public interface ComPbOrgDAO extends BaseMapper<ComPbOrgDO> { @Select("select id,`name`,`status` from com_pb_org where community_id = ${partyOrganizationVO.communityId}") /** * 分页查询党组织列表 * @param page 分页参数 * @param partyOrganizationVO 请求参数 * @return 党组织列表 */ IPage<PartyOrganizationVO> listPartyOrganizationAll(Page page, @Param("partyOrganizationVO") PartyOrganizationVO partyOrganizationVO); /** * 查询党组织下子组织列表 * @param partyOrganizationVO 请求参数 * @return 党组织下子组织列表 */ List<PartyOrganizationVO> getChildOrgList(@Param("partyOrganizationVO") PartyOrganizationVO partyOrganizationVO); /** * 查询1级党组织列表 * @param partyOrganizationVO 请求参数 * @return 1级党组织列表 */ List<PartyOrganizationVO> getPbOrgAllList(@Param("partyOrganizationVO") PartyOrganizationVO partyOrganizationVO); } springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/model/dos/ComPbOrgDO.java
@@ -47,4 +47,83 @@ * 状态 1 启用 2 禁用 */ private Integer status; /** * 组织类别(1.基层党委 2.二级基层党委 3.党总支 4.党支部 5.党小组) */ private Integer type; /** * 组织隶属(1.乡镇 2.机关 3.域市街道 3.域市社区(居委会) 4.农村社区居委会 5.建制村 6.国有经济控制 7.集体经济控制 8.非公有经济控制 9.事业单位 10.社会组织 11.其他) */ private Integer subjection; /** * 小区id */ private Long areaId; /** * 楼栋id */ private Long buildId; /** * 组织地址 */ private String address; /** * 经度 */ private String longitude; /** * 纬度 */ private String latitude; /** * 一级id */ private Long oneId; /** * 二级id */ private Long twoId; /** * 三级id */ private Long thirdId; /** * 四级id */ private Long fourId; /** * 五级id */ private Long fiveId; /** * 组织类别(1.基层党委 2.二级基层党委 3.党总支 4.党支部 5.党小组) */ public interface Type{ int JCDW = 1; int EJJCDW = 2; int DZZ = 3; int DZB = 4; int DXZ = 5; } /** * 组织隶属(1.乡镇 2.机关 3.域市街道 4.域市社区(居委会) 5.农村社区居委会 6.建制村 7.国有经济控制 8.集体经济控制 * 9.非公有经济控制 10.事业单位 11.社会组织 12.其他) */ public interface Subjection{ int XZ = 1; int JG = 2; int YSJD = 3; int YSSQ = 4; int NCSQJWH = 5; int JZC = 6; int GYJJKZ = 7; int JTJJKZ = 8; int FGYJJKZ = 9; int SYDW = 10; int SHZZ = 11; int QT = 12; } } springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/PartyOrganizationService.java
@@ -69,4 +69,11 @@ * @return 党组织集合 */ List<PartyOrganizationVO> listPartyOrganizationByApp(ComListPartyDTO comListPartyDTO); /** * 查询所有党组织 * @param partyOrganizationVO 请求参数 * @return 党组织列表 */ R getPbOrgAllList(PartyOrganizationVO partyOrganizationVO); } springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/PartyOrganizationServiceImpl.java
@@ -2,9 +2,11 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; import javax.annotation.Resource; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -49,9 +51,7 @@ if (!ObjectUtils.isEmpty(comPbOrgDOS)) { comPbOrgDOS.forEach(comPbOrgDO -> { PartyOrganizationVO partyOrganizationVO = new PartyOrganizationVO(); partyOrganizationVO.setId(comPbOrgDO.getId()); partyOrganizationVO.setName(comPbOrgDO.getName()); partyOrganizationVO.setStatus(comPbOrgDO.getStatus()); BeanUtils.copyProperties(comPbOrgDO,partyOrganizationVO); partyOrganizationVOS.add(partyOrganizationVO); }); } @@ -65,16 +65,44 @@ */ @Override public R listPartyOrganizationAll(PartyOrganizationVO partyOrganizationVO) { IPage<PartyOrganizationVO> orgPgaeList = this.comPbOrgDAO.listPartyOrganizationAll( IPage<PartyOrganizationVO> orgPage = this.comPbOrgDAO.listPartyOrganizationAll( new Page(partyOrganizationVO.getPageNum(), partyOrganizationVO.getPageSize()), partyOrganizationVO); if (!ObjectUtils.isEmpty(orgPgaeList.getRecords())) { orgPgaeList.getRecords().forEach(comPbOrgDO -> { List<ComPbMemberDO> comPbMemberDOs = comPbMemberDAO.selectList( new QueryWrapper<ComPbMemberDO>().lambda().eq(ComPbMemberDO::getOrgId, comPbOrgDO.getId())); comPbOrgDO.setCountPerson(comPbMemberDOs.size()); if (!ObjectUtils.isEmpty(orgPage.getRecords()) && StringUtils.isEmpty(partyOrganizationVO.getKeyWord())) { //遍历第一级党组织列表 orgPage.getRecords().forEach(org -> { partyOrganizationVO.setParentId(org.getId()); List<PartyOrganizationVO> twoChildList = comPbOrgDAO.getChildOrgList(partyOrganizationVO); if(!ObjectUtils.isEmpty(twoChildList)){ //遍历第二级党组织列表 twoChildList.forEach(twoChild -> { partyOrganizationVO.setParentId(twoChild.getId()); List<PartyOrganizationVO> thirdChildList = comPbOrgDAO.getChildOrgList(partyOrganizationVO); if(!ObjectUtils.isEmpty(thirdChildList)){ //遍历第三级党组织列表 thirdChildList.forEach(thirdChild -> { partyOrganizationVO.setParentId(thirdChild.getId()); List<PartyOrganizationVO> fourChildList = comPbOrgDAO.getChildOrgList(partyOrganizationVO); if(!ObjectUtils.isEmpty(fourChildList)){ fourChildList.forEach(fourChild -> { partyOrganizationVO.setParentId(fourChild.getId()); List<PartyOrganizationVO> fiveChildList = comPbOrgDAO.getChildOrgList(partyOrganizationVO); fourChild.setCountPerson(fourChild.getCountPerson() + fiveChildList.stream().mapToInt(five -> five.getCountPerson()).sum()); fourChild.setChildList(fiveChildList); }); } return R.ok(orgPgaeList); thirdChild.setCountPerson(thirdChild.getCountPerson() + fourChildList.stream().mapToInt(four -> four.getCountPerson()).sum()); thirdChild.setChildList(fourChildList); }); } twoChild.setCountPerson(twoChild.getCountPerson() + thirdChildList.stream().mapToInt(third -> third.getCountPerson()).sum()); twoChild.setChildList(thirdChildList); }); } org.setCountPerson(org.getCountPerson() + twoChildList.stream().mapToInt(two -> two.getCountPerson()).sum()); org.setChildList(twoChildList); }); } return R.ok(orgPage); } /** @@ -88,10 +116,50 @@ public R addPartyOrganization(PartyOrganizationVO partyOrganizationVO) { ComPbOrgDO comPbOrgDO = new ComPbOrgDO(); BeanUtils.copyProperties(partyOrganizationVO, comPbOrgDO); comPbOrgDO.setLevel(1); comPbOrgDO.setParentId(0L); comPbOrgDO.setLevel(partyOrganizationVO.getType()); ComPbOrgDO oldComPbOrgDO = null; int insert = comPbOrgDAO.insert(comPbOrgDO); if (insert > 0) { switch (partyOrganizationVO.getType()){ case ComPbOrgDO.Type.JCDW: comPbOrgDO.setParentId(0L); comPbOrgDO.setOneId(comPbOrgDO.getId()); break; case ComPbOrgDO.Type.EJJCDW: comPbOrgDO.setOneId(partyOrganizationVO.getParentId()); comPbOrgDO.setTwoId(comPbOrgDO.getId()); break; case ComPbOrgDO.Type.DZZ: oldComPbOrgDO = this.comPbOrgDAO.selectById(partyOrganizationVO.getParentId()); if(oldComPbOrgDO != null){ comPbOrgDO.setOneId(oldComPbOrgDO.getOneId()); comPbOrgDO.setTwoId(oldComPbOrgDO.getTwoId()); } comPbOrgDO.setThirdId(comPbOrgDO.getId()); break; case ComPbOrgDO.Type.DZB: oldComPbOrgDO = this.comPbOrgDAO.selectById(partyOrganizationVO.getParentId()); if(oldComPbOrgDO != null){ comPbOrgDO.setOneId(oldComPbOrgDO.getOneId()); comPbOrgDO.setTwoId(oldComPbOrgDO.getTwoId()); comPbOrgDO.setThirdId(oldComPbOrgDO.getThirdId()); } comPbOrgDO.setFourId(comPbOrgDO.getId()); break; case ComPbOrgDO.Type.DXZ: oldComPbOrgDO = this.comPbOrgDAO.selectById(partyOrganizationVO.getParentId()); if(oldComPbOrgDO != null){ comPbOrgDO.setOneId(oldComPbOrgDO.getOneId()); comPbOrgDO.setTwoId(oldComPbOrgDO.getTwoId()); comPbOrgDO.setThirdId(oldComPbOrgDO.getThirdId()); comPbOrgDO.setFourId(oldComPbOrgDO.getFourId()); } comPbOrgDO.setFiveId(comPbOrgDO.getId()); break; default: break; } this.comPbOrgDAO.updateById(comPbOrgDO); return R.ok(); } return R.fail(); @@ -108,10 +176,49 @@ public R updatePartyOrganization(PartyOrganizationVO partyOrganizationVO) { ComPbOrgDO comPbOrgDO = new ComPbOrgDO(); BeanUtils.copyProperties(partyOrganizationVO, comPbOrgDO); comPbOrgDO.setLevel(1); comPbOrgDO.setParentId(0L); comPbOrgDO.setLevel(partyOrganizationVO.getType()); ComPbOrgDO oldComPbOrgDO = null; int insert = comPbOrgDAO.updateById(comPbOrgDO); if (insert > 0) { switch (partyOrganizationVO.getType()){ case ComPbOrgDO.Type.JCDW: comPbOrgDO.setParentId(0L); comPbOrgDO.setOneId(comPbOrgDO.getId()); break; case ComPbOrgDO.Type.EJJCDW: comPbOrgDO.setOneId(partyOrganizationVO.getParentId()); comPbOrgDO.setTwoId(comPbOrgDO.getId()); break; case ComPbOrgDO.Type.DZZ: oldComPbOrgDO = this.comPbOrgDAO.selectById(partyOrganizationVO.getParentId()); if(oldComPbOrgDO != null){ comPbOrgDO.setOneId(oldComPbOrgDO.getOneId()); comPbOrgDO.setTwoId(oldComPbOrgDO.getTwoId()); } comPbOrgDO.setThirdId(comPbOrgDO.getId()); break; case ComPbOrgDO.Type.DZB: oldComPbOrgDO = this.comPbOrgDAO.selectById(partyOrganizationVO.getParentId()); if(oldComPbOrgDO != null){ comPbOrgDO.setOneId(oldComPbOrgDO.getOneId()); comPbOrgDO.setTwoId(oldComPbOrgDO.getTwoId()); comPbOrgDO.setThirdId(oldComPbOrgDO.getThirdId()); } comPbOrgDO.setFourId(comPbOrgDO.getId()); break; case ComPbOrgDO.Type.DXZ: oldComPbOrgDO = this.comPbOrgDAO.selectById(partyOrganizationVO.getParentId()); if(oldComPbOrgDO != null){ comPbOrgDO.setOneId(oldComPbOrgDO.getOneId()); comPbOrgDO.setTwoId(oldComPbOrgDO.getTwoId()); comPbOrgDO.setThirdId(oldComPbOrgDO.getThirdId()); comPbOrgDO.setFourId(oldComPbOrgDO.getFourId()); } comPbOrgDO.setFiveId(comPbOrgDO.getId()); break; default: break; } return R.ok(); } return R.fail(); @@ -147,9 +254,13 @@ */ @Override public R deletePartyOrganization(PartyOrganizationVO partyOrganizationVO) { List<ComPbMemberDO> comPbMemberDOs = comPbMemberDAO.selectList( Integer count = comPbOrgDAO.selectCount(new QueryWrapper<ComPbOrgDO>().lambda().eq(ComPbOrgDO::getParentId,partyOrganizationVO.getId())); if(count > 0){ return R.fail("该组织下已有子组织,不能删除!"); } List<ComPbMemberDO> comPbMemberList = comPbMemberDAO.selectList( new QueryWrapper<ComPbMemberDO>().lambda().eq(ComPbMemberDO::getOrgId, partyOrganizationVO.getId())); if (!CollectionUtils.isEmpty(comPbMemberDOs) && comPbMemberDOs.size() > 0) { if (!CollectionUtils.isEmpty(comPbMemberList) && comPbMemberList.size() > 0) { return R.fail("该党组织下已有党员,不能删除!"); } int insert = comPbOrgDAO.deleteById(partyOrganizationVO.getId()); @@ -159,6 +270,7 @@ return R.fail(); } @Override public List<PartyOrganizationVO> listPartyOrganizationByApp(ComListPartyDTO comListPartyDTO) { List<PartyOrganizationVO> partyOrganizationVOS = new ArrayList<>(); QueryWrapper<ComPbOrgDO> queryWrapper = new QueryWrapper<>(); @@ -181,4 +293,50 @@ } return partyOrganizationVOS; } /** * 查询所有党组织列表 * @param partyOrganizationVO 请求参数 * @return 党组织列表 */ @Override public R getPbOrgAllList(PartyOrganizationVO partyOrganizationVO){ List<PartyOrganizationVO> orgList = this.comPbOrgDAO.getPbOrgAllList(partyOrganizationVO); if (!ObjectUtils.isEmpty(orgList) && StringUtils.isEmpty(partyOrganizationVO.getKeyWord())) { //遍历第一级党组织列表 orgList.forEach(org -> { partyOrganizationVO.setParentId(org.getId()); List<PartyOrganizationVO> twoChildList = comPbOrgDAO.getChildOrgList(partyOrganizationVO); if(!ObjectUtils.isEmpty(twoChildList)){ //遍历第二级党组织列表 twoChildList.forEach(twoChild -> { partyOrganizationVO.setParentId(twoChild.getId()); List<PartyOrganizationVO> thirdChildList = comPbOrgDAO.getChildOrgList(partyOrganizationVO); if(!ObjectUtils.isEmpty(thirdChildList)){ //遍历第三级党组织列表 thirdChildList.forEach(thirdChild -> { partyOrganizationVO.setParentId(thirdChild.getId()); List<PartyOrganizationVO> fourChildList = comPbOrgDAO.getChildOrgList(partyOrganizationVO); if(!ObjectUtils.isEmpty(fourChildList)){ fourChildList.forEach(fourChild -> { partyOrganizationVO.setParentId(fourChild.getId()); List<PartyOrganizationVO> fiveChildList = comPbOrgDAO.getChildOrgList(partyOrganizationVO); fourChild.setCountPerson(fourChild.getCountPerson() + fiveChildList.stream().mapToInt(five -> five.getCountPerson()).sum()); fourChild.setChildList(fiveChildList); }); } thirdChild.setCountPerson(thirdChild.getCountPerson() + fourChildList.stream().mapToInt(four -> four.getCountPerson()).sum()); thirdChild.setChildList(fourChildList); }); } twoChild.setCountPerson(twoChild.getCountPerson() + thirdChildList.stream().mapToInt(third -> third.getCountPerson()).sum()); twoChild.setChildList(thirdChildList); }); } org.setCountPerson(org.getCountPerson() + twoChildList.stream().mapToInt(two -> two.getCountPerson()).sum()); org.setChildList(twoChildList); }); } return R.ok(orgList); } } springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/mapper/ComPbOrgMapper.xml
New file @@ -0,0 +1,157 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.panzhihua.service_dangjian.dao.ComPbOrgDAO"> <resultMap type="com.panzhihua.service_dangjian.model.dos.ComPbOrgDO" id="ComPbOrgMap"> <result property="id" column="id" jdbcType="INTEGER"/> <result property="level" column="level" jdbcType="INTEGER"/> <result property="parentId" column="parent_id" jdbcType="INTEGER"/> <result property="name" column="name" jdbcType="VARCHAR"/> <result property="communityId" column="community_id" jdbcType="INTEGER"/> <result property="status" column="status" jdbcType="INTEGER"/> <result property="type" column="type" jdbcType="INTEGER"/> <result property="subjection" column="subjection" jdbcType="INTEGER"/> <result property="areaId" column="area_id" jdbcType="INTEGER"/> <result property="address" column="address" jdbcType="VARCHAR"/> <result property="longitude" column="longitude" jdbcType="VARCHAR"/> <result property="latitude" column="latitude" jdbcType="VARCHAR"/> <result property="oneId" column="one_id" jdbcType="INTEGER"/> <result property="twoId" column="two_id" jdbcType="INTEGER"/> <result property="thirdId" column="third_id" jdbcType="INTEGER"/> <result property="fourId" column="four_id" jdbcType="INTEGER"/> <result property="fiveId" column="five_id" jdbcType="INTEGER"/> <result property="buildId" column="build_id" jdbcType="INTEGER"/> </resultMap> <select id="listPartyOrganizationAll" resultType="com.panzhihua.common.model.vos.partybuilding.PartyOrganizationVO"> SELECT cpo.id, cpo.`name`, cpo.`status`, cpo.parent_id, cpo.subjection, cpo.area_id, cpo.build_id, cpo.address, cpo.longitude, cpo.latitude, cmr.`name` AS areaName, cmb.`name` AS buildName, cpmr.`name` AS userName, cpmr.phone AS phone FROM com_pb_org AS cpo LEFT JOIN com_mng_residential AS cmr ON cmr.id = cpo.area_id LEFT JOIN com_pb_member_role AS cpmr ON cpmr.org_id = cpo.id left join com_mng_building as cmb on cmb.id = cpo.build_id <where> <if test="partyOrganizationVO.communityId != null"> and cpo.community_id = ${partyOrganizationVO.communityId} </if> <if test="partyOrganizationVO.keyWord == null or partyOrganizationVO.keyWord == ''"> AND cpo.parent_id = 0 </if> <if test="partyOrganizationVO.keyWord != null and partyOrganizationVO.keyWord != ''"> and cpo.`name` like CONCAT(#{partyOrganizationVO.keyword}, '%') </if> <if test="partyOrganizationVO.subjection != null"> and cpo.subjection = #{partyOrganizationVO.subjection} </if> <if test="partyOrganizationVO.areaId != null"> and cpo.area_id = #{partyOrganizationVO.areaId} </if> <if test="partyOrganizationVO.buildId != null"> and cpo.build_id = #{partyOrganizationVO.buildId} </if> </where> ORDER BY cpo.id desc </select> <select id="getChildOrgList" resultType="com.panzhihua.common.model.vos.partybuilding.PartyOrganizationVO"> SELECT cpo.id, cpo.`name`, cpo.`status`, cpo.parent_id, cpo.subjection, cpo.area_id, cpo.build_id, cpo.address, cpo.longitude, cpo.latitude, cmr.`name` AS areaName, cmb.`name` AS buildName, cpmr.`name` AS userName, cpmr.phone AS phone, (select count(id) from com_pb_member where org_id = cpo.id and audit_result = 1) as countPerson FROM com_pb_org AS cpo LEFT JOIN com_mng_residential AS cmr ON cmr.id = cpo.area_id LEFT JOIN com_pb_member_role AS cpmr ON cpmr.org_id = cpo.id left join com_mng_building as cmb on cmb.id = cpo.build_id <where> <if test="partyOrganizationVO.parentId != null"> AND cpo.parent_id = ${partyOrganizationVO.parentId} </if> <if test="partyOrganizationVO.communityId != null"> and cpo.community_id = ${partyOrganizationVO.communityId} </if> <if test="partyOrganizationVO.subjection != null"> and cpo.subjection = #{partyOrganizationVO.subjection} </if> <if test="partyOrganizationVO.areaId != null"> and cpo.area_id = #{partyOrganizationVO.areaId} </if> <if test="partyOrganizationVO.buildId != null"> and cpo.build_id = #{partyOrganizationVO.buildId} </if> </where> ORDER BY cpo.id desc </select> <select id="getPbOrgAllList" resultType="com.panzhihua.common.model.vos.partybuilding.PartyOrganizationVO"> SELECT cpo.id, cpo.`name`, cpo.`status`, cpo.parent_id, cpo.subjection, cpo.area_id, cpo.build_id, cpo.address, cpo.longitude, cpo.latitude, cmr.`name` AS areaName, cmb.`name` AS buildName, cpmr.`name` AS userName, cpmr.phone AS phone FROM com_pb_org AS cpo LEFT JOIN com_mng_residential AS cmr ON cmr.id = cpo.area_id LEFT JOIN com_pb_member_role AS cpmr ON cpmr.org_id = cpo.id left join com_mng_building as cmb on cmb.id = cpo.build_id <where> <if test="partyOrganizationVO.communityId != null"> and cpo.community_id = ${partyOrganizationVO.communityId} </if> <if test="partyOrganizationVO.keyWord == null or partyOrganizationVO.keyWord == ''"> AND cpo.parent_id = 0 </if> <if test="partyOrganizationVO.keyWord != null and partyOrganizationVO.keyWord != ''"> and cpo.`name` like CONCAT(#{partyOrganizationVO.keyword}, '%') </if> <if test="partyOrganizationVO.subjection != null"> and cpo.subjection = #{partyOrganizationVO.subjection} </if> <if test="partyOrganizationVO.areaId != null"> and cpo.area_id = #{partyOrganizationVO.areaId} </if> <if test="partyOrganizationVO.buildId != null"> and cpo.build_id = #{partyOrganizationVO.buildId} </if> </where> ORDER BY cpo.id desc </select> </mapper>