java110-db/src/main/resources/mapper/user/RoleCommunityV1ServiceDaoImplMapper.xml
@@ -107,4 +107,67 @@ </select> <select id="queryRoleCommunitysNameCount" parameterType="Map" resultType="Map"> select count(distinct(t.community_id)) count from u_role_community t <if test="staffId != null and staffId != ''"> left join p_privilege_group pg on t.role_id = pg.pg_id and pg.status_cd = '0' left join p_privilege_user pu on pu.p_id = pg.pg_id and pu.privilege_flag = '1' and pu.status_cd = '0' </if> where 1 =1 <if test="staffId != null and staffId != ''"> and pu.user_id = #{staffId} </if> <if test="roleId !=null and roleId != ''"> and t.role_id= #{roleId} </if> <if test="rcId !=null and rcId != ''"> and t.rc_id= #{rcId} </if> <if test="statusCd !=null and statusCd != ''"> and t.status_cd= #{statusCd} </if> <if test="communityId !=null and communityId != ''"> and t.community_id= #{communityId} </if> <if test="storeId !=null and storeId != ''"> and t.store_id= #{storeId} </if> </select> <select id="queryRoleCommunitysName" parameterType="Map" resultType="Map"> select distinct t.community_id,t.community_id communityId,t.community_name communityName from u_role_community t <if test="staffId != null and staffId != ''"> left join p_privilege_group pg on t.role_id = pg.pg_id and pg.status_cd = '0' left join p_privilege_user pu on pu.p_id = pg.pg_id and pu.privilege_flag = '1' and pu.status_cd = '0' </if> where 1 =1 <if test="staffId != null and staffId != ''"> and pu.user_id = #{staffId} </if> <if test="roleId !=null and roleId != ''"> and t.role_id= #{roleId} </if> <if test="rcId !=null and rcId != ''"> and t.rc_id= #{rcId} </if> <if test="statusCd !=null and statusCd != ''"> and t.status_cd= #{statusCd} </if> <if test="communityId !=null and communityId != ''"> and t.community_id= #{communityId} </if> <if test="storeId !=null and storeId != ''"> and t.store_id= #{storeId} </if> order by t.create_time desc <if test="page != -1 and page != null "> limit #{page}, #{row} </if> </select> </mapper> java110-interface/src/main/java/com/java110/intf/user/IRoleCommunityV1InnerServiceSMO.java
@@ -65,4 +65,8 @@ */ @RequestMapping(value = "/queryRoleCommunitysCount", method = RequestMethod.POST) int queryRoleCommunitysCount(@RequestBody RoleCommunityDto roleCommunityDto); @RequestMapping(value = "/queryRoleCommunitysNameCount", method = RequestMethod.POST) int queryRoleCommunitysNameCount(@RequestBody RoleCommunityDto orgCommunityDto); @RequestMapping(value = "/queryRoleCommunitysName", method = RequestMethod.POST) List<RoleCommunityDto> queryRoleCommunitysName(@RequestBody RoleCommunityDto orgCommunityDto); } service-community/src/main/java/com/java110/community/cmd/community/ListMyEnteredCommunitysCmd.java
@@ -103,9 +103,9 @@ }else{ RoleCommunityDto orgCommunityDto = BeanConvertUtil.covertBean(reqJson, RoleCommunityDto.class); orgCommunityDto.setStaffId(userDtos.get(0).getUserId()); count = roleCommunityV1InnerServiceSMOImpl.queryRoleCommunitysCount(orgCommunityDto); count = roleCommunityV1InnerServiceSMOImpl.queryRoleCommunitysNameCount(orgCommunityDto); if (count > 0) { List<RoleCommunityDto> roleCommunityDtos = roleCommunityV1InnerServiceSMOImpl.queryRoleCommunitys(orgCommunityDto); List<RoleCommunityDto> roleCommunityDtos = roleCommunityV1InnerServiceSMOImpl.queryRoleCommunitysName(orgCommunityDto); communitys = BeanConvertUtil.covertBeanList(roleCommunityDtos, ApiCommunityDataVo.class); for (RoleCommunityDto tmpOrgCommunityDto : roleCommunityDtos) { for (ApiCommunityDataVo tmpApiCommunityDataVo : communitys) { service-user/src/main/java/com/java110/user/dao/IRoleCommunityV1ServiceDao.java
@@ -74,4 +74,7 @@ */ int queryRoleCommunitysCount(Map info); int queryRoleCommunitysNameCount(Map info); List<Map> queryRoleCommunitysName(Map info); } service-user/src/main/java/com/java110/user/dao/impl/RoleCommunityV1ServiceDaoImpl.java
@@ -106,5 +106,25 @@ return Integer.parseInt(businessRoleCommunityInfos.get(0).get("count").toString()); } @Override public int queryRoleCommunitysNameCount(Map info) { logger.debug("查询 queryRoleCommunitysNameCount 入参 info : {}", info); List<Map> businessRoleCommunityInfos = sqlSessionTemplate.selectList("roleCommunityV1ServiceDaoImpl.queryRoleCommunitysNameCount", info); if (businessRoleCommunityInfos.size() < 1) { return 0; } return Integer.parseInt(businessRoleCommunityInfos.get(0).get("count").toString()); } @Override public List<Map> queryRoleCommunitysName(Map info) { logger.debug("查询 getRoleCommunityInfo 入参 info : {}", info); List<Map> businessRoleCommunityInfos = sqlSessionTemplate.selectList("roleCommunityV1ServiceDaoImpl.queryRoleCommunitysName", info); return businessRoleCommunityInfos; } } service-user/src/main/java/com/java110/user/smo/impl/RoleCommunityV1InnerServiceSMOImpl.java
@@ -86,4 +86,22 @@ public int queryRoleCommunitysCount(@RequestBody RoleCommunityDto roleCommunityDto) { return roleCommunityV1ServiceDaoImpl.queryRoleCommunitysCount(BeanConvertUtil.beanCovertMap(roleCommunityDto)); } @Override public int queryRoleCommunitysNameCount(@RequestBody RoleCommunityDto roleCommunityDto) { return roleCommunityV1ServiceDaoImpl.queryRoleCommunitysNameCount(BeanConvertUtil.beanCovertMap(roleCommunityDto)); } @Override public List<RoleCommunityDto> queryRoleCommunitysName(@RequestBody RoleCommunityDto roleCommunityDto) { int page = roleCommunityDto.getPage(); if (page != PageDto.DEFAULT_PAGE) { roleCommunityDto.setPage((page - 1) * roleCommunityDto.getRow()); } List<RoleCommunityDto> roleCommunitys = BeanConvertUtil.covertBeanList(roleCommunityV1ServiceDaoImpl.queryRoleCommunitysName(BeanConvertUtil.beanCovertMap(roleCommunityDto)), RoleCommunityDto.class); return roleCommunitys; } }