linwei
2024-01-19 494aeb58eb885b40ab2fdb083aaa79007bb79ae2
src/main/java/org/springblade/modules/community/mapper/CommunityMapper.xml
@@ -24,7 +24,8 @@
    <!--自定义分页列表查询-->
    <select id="selectCommunityPage" resultType="org.springblade.modules.community.vo.CommunityVO">
        select
        jc.*
        jc.*,
        br.town_name townName
        from jczz_community jc
        left join blade_region br on br.code = jc.code
        where jc.is_deleted = 0
@@ -37,8 +38,21 @@
        <if test="community.streetCode !=null and community.streetCode!=''">
            and jc.street_code like concat('%',#{community.streetCode},'%')
        </if>
        <if test="community.regionCode !=null and community.regionCode !=''">
            and jc.code like concat('%',#{community.regionCode},'%')
        <if test="community.townName !=null and community.townName !=''">
            and br.town_name like concat('%',#{community.townName},'%')
        </if>
        <if test="isAdministrator==2">
            <choose>
                <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
                    and jc.code in
                    <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
                        #{code}
                    </foreach>
                </when>
                <otherwise>
                    and jc.code in ('')
                </otherwise>
            </choose>
        </if>
    </select>