linwei
2024-01-19 7bc12c8ae5f7793dd4b2d512e830b84739a3a089
街道身份,只查找该街道下面的业委会
3 files modified
90 ■■■■ changed files
src/main/java/org/springblade/modules/ownersCommittee/mapper/OwnersCommitteeMapper.xml 54 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/ownersCommittee/service/impl/OwnersCommitteeServiceImpl.java 28 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/ownersCommittee/vo/OwnersCommitteeVO.java 8 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/ownersCommittee/mapper/OwnersCommitteeMapper.xml
@@ -3,7 +3,8 @@
<mapper namespace="org.springblade.modules.ownersCommittee.mapper.OwnersCommitteeMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="ownersCommitteeResultMap" type="org.springblade.modules.ownersCommittee.entity.OwnersCommitteeEntity">
    <resultMap id="ownersCommitteeResultMap"
               type="org.springblade.modules.ownersCommittee.entity.OwnersCommitteeEntity">
    </resultMap>
@@ -12,18 +13,38 @@
        <where>
            <if test="ownersCommittee.id != null "> and id = #{ownersCommittee.id}</if>
            <if test="ownersCommittee.areaId != null "> and area_id = #{ownersCommittee.areaId}</if>
            <if test="ownersCommittee.areaName != null  and ownersCommittee.areaName != ''"> and area_name = #{ownersCommittee.areaName}</if>
            <if test="ownersCommittee.areaName != null  and ownersCommittee.areaName != ''">and area_name =
                #{ownersCommittee.areaName}
            </if>
            <if test="ownersCommittee.establishTime != null "> and establish_time = #{ownersCommittee.establishTime}</if>
            <if test="ownersCommittee.imageUrl != null  and ownersCommittee.imageUrl != ''"> and image_url = #{ownersCommittee.imageUrl}</if>
            <if test="ownersCommittee.latitude != null  and ownersCommittee.latitude != ''"> and latitude = #{ownersCommittee.latitude}</if>
            <if test="ownersCommittee.longitude != null  and ownersCommittee.longitude != ''"> and longitude = #{ownersCommittee.longitude}</if>
            <if test="ownersCommittee.location != null  and ownersCommittee.location != ''"> and location = #{ownersCommittee.location}</if>
            <if test="ownersCommittee.mobile != null  and ownersCommittee.mobile != ''"> and mobile = #{ownersCommittee.mobile}</if>
            <if test="ownersCommittee.name != null  and ownersCommittee.name != ''"> and name like concat('%',#{ownersCommittee.name},'%') </if>
            <if test="ownersCommittee.peopleTotal != null  and ownersCommittee.peopleTotal != ''"> and people_total = #{ownersCommittee.peopleTotal}</if>
            <if test="ownersCommittee.imageUrl != null  and ownersCommittee.imageUrl != ''">and image_url =
                #{ownersCommittee.imageUrl}
            </if>
            <if test="ownersCommittee.latitude != null  and ownersCommittee.latitude != ''">and latitude =
                #{ownersCommittee.latitude}
            </if>
            <if test="ownersCommittee.longitude != null  and ownersCommittee.longitude != ''">and longitude =
                #{ownersCommittee.longitude}
            </if>
            <if test="ownersCommittee.location != null  and ownersCommittee.location != ''">and location =
                #{ownersCommittee.location}
            </if>
            <if test="ownersCommittee.mobile != null  and ownersCommittee.mobile != ''">and mobile =
                #{ownersCommittee.mobile}
            </if>
            <if test="ownersCommittee.name != null  and ownersCommittee.name != ''">and name like
                concat('%',#{ownersCommittee.name},'%')
            </if>
            <if test="ownersCommittee.peopleTotal != null  and ownersCommittee.peopleTotal != ''">and people_total =
                #{ownersCommittee.peopleTotal}
            </if>
            <if test="ownersCommittee.principalId != null "> and principal_id = #{ownersCommittee.principalId}</if>
            <if test="ownersCommittee.principalName != null  and ownersCommittee.principalName != ''"> and principal_name = #{ownersCommittee.principalName}</if>
            <if test="ownersCommittee.profile != null  and ownersCommittee.profile != ''"> and profile = #{ownersCommittee.profile}</if>
            <if test="ownersCommittee.principalName != null  and ownersCommittee.principalName != ''">and principal_name
                = #{ownersCommittee.principalName}
            </if>
            <if test="ownersCommittee.profile != null  and ownersCommittee.profile != ''">and profile =
                #{ownersCommittee.profile}
            </if>
            <if test="ownersCommittee.session != null "> and session = #{ownersCommittee.session}</if>
            <if test="ownersCommittee.startTime != null "> and start_time = #{ownersCommittee.startTime}</if>
            <if test="ownersCommittee.endTime != null "> and end_time = #{ownersCommittee.endTime}</if>
@@ -35,6 +56,13 @@
            <if test="ownersCommittee.createTime != null "> and create_time = #{ownersCommittee.createTime}</if>
            <if test="ownersCommittee.updateTime != null "> and update_time = #{ownersCommittee.updateTime}</if>
            <if test="ownersCommittee.deleteFlag != null "> and delete_flag = #{ownersCommittee.deleteFlag}</if>
            <if test="ownersCommittee.areaIdList != null ">
                and area_id in
                <foreach collection="ownersCommittee.areaIdList" item="item" separator="," open="(" close=")">
                    #{item}
                </foreach>
            </if>
        </where>
    </select>
@@ -104,7 +132,9 @@
        id = #{id}
    </select>
    <select id="selectOwnersCommitteeList" parameterType="org.springblade.modules.ownersCommittee.dto.OwnersCommitteeDTO" resultMap="OwnersCommitteeDTOResult">
    <select id="selectOwnersCommitteeList"
            parameterType="org.springblade.modules.ownersCommittee.dto.OwnersCommitteeDTO"
            resultMap="OwnersCommitteeDTOResult">
        <include refid="selectOwnersCommittee"/>
        <where>
            <if test="id != null "> and id = #{id}</if>
src/main/java/org/springblade/modules/ownersCommittee/service/impl/OwnersCommitteeServiceImpl.java
@@ -16,17 +16,23 @@
 */
package org.springblade.modules.ownersCommittee.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.common.cache.SysCache;
import org.springblade.common.utils.SpringUtils;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.modules.district.entity.DistrictEntity;
import org.springblade.modules.district.service.IDistrictService;
import org.springblade.modules.ownersCommittee.dto.OwnersCommitteeDTO;
import org.springblade.modules.ownersCommittee.entity.OwnersCommitteeEntity;
import org.springblade.modules.ownersCommittee.vo.OwnersCommitteeVO;
import org.springblade.modules.ownersCommittee.mapper.OwnersCommitteeMapper;
import org.springblade.modules.ownersCommittee.service.IOwnersCommitteeService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.modules.ownersCommittee.vo.OwnersCommitteeVO;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
import java.util.stream.Collectors;
/**
 * 业委会表 服务实现类
@@ -39,6 +45,16 @@
    @Override
    public IPage<OwnersCommitteeVO> selectOwnersCommitteePage(IPage<OwnersCommitteeVO> page, OwnersCommitteeVO ownersCommittee) {
        String userRole = AuthUtil.getUserRole();
        // 街道身份,只查找该街道下面的业委会
        if (userRole.contains("jdgly")) {
            List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId());
            IDistrictService bean = SpringUtils.getBean(IDistrictService.class);
            List<DistrictEntity> list = bean.list(Wrappers.<DistrictEntity>lambdaQuery()
                .in(DistrictEntity::getCommunityCode, regionChildCodesList));
            List<String> fieldValues = list.stream().map(DistrictEntity::getId).collect(Collectors.toList());
            ownersCommittee.setAreaIdList(fieldValues);
        }
        return page.setRecords(baseMapper.selectOwnersCommitteePage(page, ownersCommittee));
    }
@@ -49,8 +65,7 @@
     * @return 业委会表
     */
    @Override
    public OwnersCommitteeDTO selectOwnersCommitteeById(Integer id)
    {
    public OwnersCommitteeDTO selectOwnersCommitteeById(Integer id) {
        return this.baseMapper.selectOwnersCommitteeById(id);
    }
@@ -61,8 +76,7 @@
     * @return 业委会表集合
     */
    @Override
    public List<OwnersCommitteeDTO> selectOwnersCommitteeList(OwnersCommitteeDTO ownersCommitteeDTO)
    {
    public List<OwnersCommitteeDTO> selectOwnersCommitteeList(OwnersCommitteeDTO ownersCommitteeDTO) {
        return this.baseMapper.selectOwnersCommitteeList(ownersCommitteeDTO);
    }
src/main/java/org/springblade/modules/ownersCommittee/vo/OwnersCommitteeVO.java
@@ -16,10 +16,11 @@
 */
package org.springblade.modules.ownersCommittee.vo;
import org.springblade.modules.ownersCommittee.entity.OwnersCommitteeEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.ownersCommittee.entity.OwnersCommitteeEntity;
import java.util.List;
/**
 * 业委会表 视图实体类
@@ -32,4 +33,7 @@
public class OwnersCommitteeVO extends OwnersCommitteeEntity {
    private static final long serialVersionUID = 1L;
    // 小区id
    private List<String> areaIdList;
}