zhongrj
2024-01-06 ad0bc4e763fa988a2ec4dd8dfab7381ea7726021
src/main/java/org/springblade/modules/system/mapper/RegionMapper.xml
@@ -104,16 +104,27 @@
    <!--根据父编号查询所有的下级-->
    <select id="getTreeList" resultType="org.springblade.common.node.TreeStringNode">
        <if test="region.cityCode!=null and region.cityCode!=''">
            SELECT
            code as id,
            parent_code as parentId,
            name
            FROM blade_region
            where code = #{region.cityCode}
            union all
        </if>
        SELECT
        code as id,
        parent_code as parentId,
        name
        FROM blade_region where district_code = '361102'
        <if test="parentCode!=null">
            and parent_code = #{parentCode}
        FROM blade_region
        where 1=1
        and district_code = '361102'
        <if test="region.parentCode!=null and region.parentCode!=''">
            and parent_code = #{region.parentCode}
        </if>
        <if test="regionCode!=null and regionCode!=''">
            and code like concat('%',#{regionCode},'%')
        <if test="region.regionCode!=null and region.regionCode!=''">
            and code like concat('%',#{region.regionCode},'%')
        </if>
    </select>