linwei
2024-01-19 7bc12c8ae5f7793dd4b2d512e830b84739a3a089
街道身份,只查找该街道下面的业委会
3 files modified
220 ■■■■■ changed files
src/main/java/org/springblade/modules/ownersCommittee/mapper/OwnersCommitteeMapper.xml 184 ●●●●● 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,68 +3,96 @@
<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>
    <select id="selectOwnersCommitteePage" resultMap="ownersCommitteeResultMap">
        <include refid="selectOwnersCommittee"/>
        <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.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.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.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>
            <if test="ownersCommittee.sort != null "> and sort = #{ownersCommittee.sort}</if>
            <if test="ownersCommittee.status != null "> and status = #{ownersCommittee.status}</if>
            <if test="ownersCommittee.type != null "> and type = #{ownersCommittee.type}</if>
            <if test="ownersCommittee.createId != null "> and create_id = #{ownersCommittee.createId}</if>
            <if test="ownersCommittee.updateId != null "> and update_id = #{ownersCommittee.updateId}</if>
            <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.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.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.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.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>
            <if test="ownersCommittee.sort != null ">and sort = #{ownersCommittee.sort}</if>
            <if test="ownersCommittee.status != null ">and status = #{ownersCommittee.status}</if>
            <if test="ownersCommittee.type != null ">and type = #{ownersCommittee.type}</if>
            <if test="ownersCommittee.createId != null ">and create_id = #{ownersCommittee.createId}</if>
            <if test="ownersCommittee.updateId != null ">and update_id = #{ownersCommittee.updateId}</if>
            <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>
    <resultMap type="org.springblade.modules.ownersCommittee.dto.OwnersCommitteeDTO" id="OwnersCommitteeDTOResult">
        <result property="id"    column="id"    />
        <result property="areaId"    column="area_id"    />
        <result property="areaName"    column="area_name"    />
        <result property="establishTime"    column="establish_time"    />
        <result property="imageUrl"    column="image_url"    />
        <result property="latitude"    column="latitude"    />
        <result property="longitude"    column="longitude"    />
        <result property="location"    column="location"    />
        <result property="mobile"    column="mobile"    />
        <result property="name"    column="name"    />
        <result property="peopleTotal"    column="people_total"    />
        <result property="principalId"    column="principal_id"    />
        <result property="principalName"    column="principal_name"    />
        <result property="profile"    column="profile"    />
        <result property="session"    column="session"    />
        <result property="startTime"    column="start_time"    />
        <result property="endTime"    column="end_time"    />
        <result property="sort"    column="sort"    />
        <result property="status"    column="status"    />
        <result property="type"    column="type"    />
        <result property="createId"    column="create_id"    />
        <result property="updateId"    column="update_id"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="deleteFlag"    column="delete_flag"    />
        <result property="id" column="id"/>
        <result property="areaId" column="area_id"/>
        <result property="areaName" column="area_name"/>
        <result property="establishTime" column="establish_time"/>
        <result property="imageUrl" column="image_url"/>
        <result property="latitude" column="latitude"/>
        <result property="longitude" column="longitude"/>
        <result property="location" column="location"/>
        <result property="mobile" column="mobile"/>
        <result property="name" column="name"/>
        <result property="peopleTotal" column="people_total"/>
        <result property="principalId" column="principal_id"/>
        <result property="principalName" column="principal_name"/>
        <result property="profile" column="profile"/>
        <result property="session" column="session"/>
        <result property="startTime" column="start_time"/>
        <result property="endTime" column="end_time"/>
        <result property="sort" column="sort"/>
        <result property="status" column="status"/>
        <result property="type" column="type"/>
        <result property="createId" column="create_id"/>
        <result property="updateId" column="update_id"/>
        <result property="createTime" column="create_time"/>
        <result property="updateTime" column="update_time"/>
        <result property="deleteFlag" column="delete_flag"/>
    </resultMap>
    <sql id="selectOwnersCommittee">
@@ -104,34 +132,36 @@
        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>
            <if test="areaId != null "> and area_id = #{areaId}</if>
            <if test="areaName != null  and areaName != ''"> and area_name = #{areaName}</if>
            <if test="establishTime != null "> and establish_time = #{establishTime}</if>
            <if test="imageUrl != null  and imageUrl != ''"> and image_url = #{imageUrl}</if>
            <if test="latitude != null  and latitude != ''"> and latitude = #{latitude}</if>
            <if test="longitude != null  and longitude != ''"> and longitude = #{longitude}</if>
            <if test="location != null  and location != ''"> and location = #{location}</if>
            <if test="mobile != null  and mobile != ''"> and mobile = #{mobile}</if>
            <if test="name != null  and name != ''"> and name = #{name}</if>
            <if test="peopleTotal != null  and peopleTotal != ''"> and people_total = #{peopleTotal}</if>
            <if test="principalId != null "> and principal_id = #{principalId}</if>
            <if test="principalName != null  and principalName != ''"> and principal_name = #{principalName}</if>
            <if test="profile != null  and profile != ''"> and profile = #{profile}</if>
            <if test="session != null "> and session = #{session}</if>
            <if test="startTime != null "> and start_time = #{startTime}</if>
            <if test="endTime != null "> and end_time = #{endTime}</if>
            <if test="sort != null "> and sort = #{sort}</if>
            <if test="status != null "> and status = #{status}</if>
            <if test="type != null "> and type = #{type}</if>
            <if test="createId != null "> and create_id = #{createId}</if>
            <if test="updateId != null "> and update_id = #{updateId}</if>
            <if test="createTime != null "> and create_time = #{createTime}</if>
            <if test="updateTime != null "> and update_time = #{updateTime}</if>
            <if test="deleteFlag != null "> and delete_flag = #{deleteFlag}</if>
            <if test="id != null ">and id = #{id}</if>
            <if test="areaId != null ">and area_id = #{areaId}</if>
            <if test="areaName != null  and areaName != ''">and area_name = #{areaName}</if>
            <if test="establishTime != null ">and establish_time = #{establishTime}</if>
            <if test="imageUrl != null  and imageUrl != ''">and image_url = #{imageUrl}</if>
            <if test="latitude != null  and latitude != ''">and latitude = #{latitude}</if>
            <if test="longitude != null  and longitude != ''">and longitude = #{longitude}</if>
            <if test="location != null  and location != ''">and location = #{location}</if>
            <if test="mobile != null  and mobile != ''">and mobile = #{mobile}</if>
            <if test="name != null  and name != ''">and name = #{name}</if>
            <if test="peopleTotal != null  and peopleTotal != ''">and people_total = #{peopleTotal}</if>
            <if test="principalId != null ">and principal_id = #{principalId}</if>
            <if test="principalName != null  and principalName != ''">and principal_name = #{principalName}</if>
            <if test="profile != null  and profile != ''">and profile = #{profile}</if>
            <if test="session != null ">and session = #{session}</if>
            <if test="startTime != null ">and start_time = #{startTime}</if>
            <if test="endTime != null ">and end_time = #{endTime}</if>
            <if test="sort != null ">and sort = #{sort}</if>
            <if test="status != null ">and status = #{status}</if>
            <if test="type != null ">and type = #{type}</if>
            <if test="createId != null ">and create_id = #{createId}</if>
            <if test="updateId != null ">and update_id = #{updateId}</if>
            <if test="createTime != null ">and create_time = #{createTime}</if>
            <if test="updateTime != null ">and update_time = #{updateTime}</if>
            <if test="deleteFlag != null ">and delete_flag = #{deleteFlag}</if>
        </where>
    </select>
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;
}