xieb
2024-05-21 ba8f60437c8f3747bbfa69563388d8eb925a0bee
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/mapper/AttAdBaseMapper.xml
@@ -85,12 +85,15 @@
        ( SELECT CASE WHEN count( 1 ) > 0 THEN 1 ELSE 0 END FROM "SJZT_MD"."att_ad_base" WHERE "p_ad_code" = region."ad_code" ) AS "has_children"
        FROM
        "SJZT_MD"."att_ad_base" region
        left join sjzt_md."att_ad_base" a2 on (region."p_ad_code" = a2."ad_code")
        left join sjzt_md."att_ad_base" a3 on (a2."p_ad_code" = a3."ad_code")
        left join sjzt_md."att_ad_base" a4 on (a3."p_ad_code" = a4."ad_code")
        <where>
            <if test="param1!=null">
                and region."p_ad_code" = #{param1}
            </if>
            <if test="param2.code!=null and param2.code!=''">
                and region."ad_code" like concat(concat('%', #{param2.code}),'%')
                and concat(region."ad_code",a2."ad_code",a3."ad_code",a4."ad_code") like concat(concat('%', #{param2.code}),'%')
            </if>
            <if test="param2.name!=null and param2.name!=''">
                and region."ad_name" like concat(concat('%', #{param2.name}),'%')
@@ -98,7 +101,9 @@
            <if test="param2.level!=null and param2.level!=''">
                and region."ad_grad" &lt; #{param2.level}
            </if>
            and region."ad_grad" != 4
            <if test="param2.isTowns==null or param2.isTowns==''">
                and region."ad_grad" != 4
            </if>
        </where>
        ORDER BY region."order_id"
    </select>