linwei
2024-01-08 ad2ec97fe0c60eee4bb7c8cdacff7c876f280ea7
src/main/java/org/springblade/modules/community/mapper/CommunityMapper.xml
@@ -23,16 +23,26 @@
    <!--自定义分页列表查询-->
    <select id="selectCommunityPage" resultType="org.springblade.modules.community.vo.CommunityVO">
        select * from jczz_community
        where is_deleted = 0
        select
        jc.*,
        br.town_name townName
        from jczz_community jc
        left join blade_region br on br.code = jc.code
        where jc.is_deleted = 0
        <if test="community.name !=null and community.name!=''">
            and name like concat('%',#{community.name},'%')
            and jc.name like concat('%',#{community.name},'%')
        </if>
        <if test="community.code !=null and community.code!=''">
            and code like concat('%',#{community.code},'%')
            and jc.code like concat('%',#{community.code},'%')
        </if>
        <if test="community.streetCode !=null and community.streetCode!=''">
            and street_code like concat('%',#{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>
        <if test="community.townName !=null and community.townName !=''">
            and br.town_name like concat('%',#{community.townName},'%')
        </if>
    </select>