zhongrj
2024-02-07 48c2fece0e18e43fec9e661f852df70f8765abc1
src/main/java/org/springblade/modules/place/mapper/PlaceExtMapper.xml
@@ -19,25 +19,71 @@
        jczz_place_ext jpe
        LEFT JOIN jczz_place jp ON jpe.place_id = jp.id AND jp.is_deleted = 0
        LEFT JOIN jczz_grid jg ON jp.grid_code = jg.grid_code AND jg.is_deleted = 0
        WHERE
        jpe.is_deleted = 0
        LEFT JOIN jczz_police_affairs_grid jpag ON jp.jw_grid_code = jpag.jw_grid_code AND jpag.is_deleted = 0
        WHERE jpe.is_deleted = 0
        and jp.place_name != ''
        <if test="isAdministrator==2">
            <choose>
                <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
                    and jg.community_code in
                    <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
                        #{code}
                    </foreach>
                <when test="placeExt.roleName != null and placeExt.roleName != ''">
                    <if test="placeExt.roleName=='wgy'">
                        <choose>
                            <when test="gridCodeList !=null and gridCodeList.size()>0">
                                and jp.grid_code in
                                <foreach collection="gridCodeList" item="code" open="(" close=")" separator=",">
                                    #{code}
                                </foreach>
                            </when>
                            <otherwise>
                                and jp.grid_code in ('')
                            </otherwise>
                        </choose>
                    </if>
                    <if test="placeExt.roleName=='mj'">
                        <choose>
                            <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
                                and jpag.community_code in
                                <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
                                    #{code}
                                </foreach>
                            </when>
                            <otherwise>
                                and jpag.community_code in ('')
                            </otherwise>
                        </choose>
                    </if>
                </when>
                <otherwise>
                    and jg.community_code in ('')
                    <choose>
                        <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
                            and
                            (
                            jg.grid_code in
                            <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
                                #{code}
                            </foreach>
                            or
                            jpag.community_code in
                            <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
                                #{code}
                            </foreach>
                            )
                        </when>
                        <otherwise>
                            and
                            (
                            jg.grid_code in ('') or jpag.community_code in in ('')
                            )
                        </otherwise>
                    </choose>
                </otherwise>
            </choose>
        </if>
        <if test="placeExt.placeName != null and placeExt.placeName != ''">
            and jp.place_name like concat('%',#{placeExt.placeName},'%')
        </if>
        <if test="placeExt.communityCode != null and placeExt.communityCode != ''">
            and jpag.community_code like concat('%',#{placeExt.communityCode},'%')
        </if>
        <if test="placeExt.placeId != null">
            and jp.id = #{placeExt.placeId}
        </if>