linwe
2024-08-09 8b7258c9427882bb1798f1502eaa35184c6e374e
src/main/java/org/springblade/modules/place/mapper/PlaceExtMapper.xml
@@ -71,7 +71,7 @@
                        <otherwise>
                            and
                            (
                            jg.grid_code in ('') or jpag.community_code in in ('')
                            jg.grid_code in ('') or jpag.community_code in ('')
                            )
                        </otherwise>
                    </choose>
@@ -99,12 +99,6 @@
        <if test="placeExt.startTime != null and placeExt.startTime != '' and placeExt.endTime != null and placeExt.endTime != '' ">
            AND jpe.create_time BETWEEN #{placeExt.startTime} and #{placeExt.endTime}
        </if>
        <if test="houseCodeList != null and houseCodeList.size()>0">
            and jp.house_code in
            <foreach collection="houseCodeList" item="houseCode" separator="," open="(" close=")">
                #{houseCode}
            </foreach>
        </if>
        order by jpe.create_time desc,jpe.id desc
    </select>
@@ -114,26 +108,74 @@
        count( 1 )
        FROM
        jczz_place_ext jpe
        LEFT JOIN jczz_place jp ON jp.id = jpe.place_id and jp.is_deleted = 0
        LEFT JOIN jczz_doorplate_address jda ON locate(jda.address_code,jp.house_code)>0
        LEFT JOIN jczz_place jp ON jpe.place_id = jp.id AND jp.is_deleted = 0 and jp.place_name != ''
        LEFT JOIN jczz_grid jg ON jp.grid_code = jg.grid_code AND jg.is_deleted = 0
        LEFT JOIN jczz_police_affairs_grid jpag ON jp.jw_grid_code = jpag.jw_grid_code AND jpag.is_deleted = 0
        LEFT JOIN jczz_doorplate_address jda ON jp.house_code = jda.address_code
        <where>
            <if test="confirmFlag != null">
                and jpe.confirm_flag = #{confirmFlag}
            <if test="placeExt.neiCode != null and placeExt.neiCode != ''">
               and jpag.community_code like concat('%',#{placeExt.neiCode},'%')
            </if>
            <if test="userId != null">
                AND jp.house_code IN (
                SELECT
                jgr.house_code
                FROM
                jczz_grid_range jgr
                LEFT JOIN jczz_grid jg ON jg.id = jgr.grid_id
                LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id
                WHERE
                jg.is_deleted = 0
                <if test="neiCode != null and neiCode != ''">
                    and jg.community_code = #{neiCode}
                </if>
                AND jgm.user_id = #{userId} )
            <if test="placeExt.confirmFlag != null">
                and jpe.confirm_flag = #{placeExt.confirmFlag}
            </if>
            <if test="isAdministrator==2">
                <choose>
                    <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>
                        <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 ('')
                                )
                            </otherwise>
                        </choose>
                    </otherwise>
                </choose>
            </if>
            and jpe.is_deleted = 0
        </where>
@@ -143,14 +185,56 @@
    <select id="getDetail" resultType="org.springblade.modules.place.vo.PlaceExtVO">
        select jpe.*,
        jp.place_name as placeName,
        jp.lng,
        jp.lat,
        jp.location
               jp.place_name as placeName,
               jp.lng,
               jp.lat,
               jp.location,
               jppl.poi_code
        from jczz_place_ext jpe
        left join jczz_place jp on jpe.place_id = jp.id and jp.is_deleted = 0
        where jpe.is_deleted = 0 and jpe.place_id = #{placeExt.placeId}
                 left join jczz_place jp on jpe.place_id = jp.id and jp.is_deleted = 0
        left join  jczz_place_poi_label jppl on jppl.place_id = jp.id and jppl.type = 3
        where jpe.is_deleted = 0
          and jpe.place_id = #{placeExt.placeId}
    </select>
    <resultMap type="org.springblade.modules.place.dto.PlaceExtDTO" id="JczzPlaceExtDTOResult">
        <result property="id"    column="id"    />
        <result property="placeId"    column="place_id"    />
        <result property="imageUrls"    column="image_urls"    />
        <result property="legalPerson"    column="legal_person"    />
        <result property="legalTel"    column="legal_tel"    />
        <result property="planImageUrls"    column="plan_image_urls"    />
        <result property="confirmUserId"    column="confirm_user_id"    />
        <result property="confirmFlag"    column="confirm_flag"    />
        <result property="confirmTime"    column="confirm_time"    />
        <result property="confirmNotion"    column="confirm_notion"    />
        <result property="createUser"    column="create_user"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateUser"    column="update_user"    />
        <result property="updateTime"    column="update_time"    />
        <result property="isDeleted"    column="is_deleted"    />
    </resultMap>
    <sql id="selectJczzPlaceExt">
        select
            id,
            place_id,
            image_urls,
            legal_person,
            legal_tel,
            plan_image_urls,
            confirm_user_id,
            confirm_flag,
            confirm_time,
            confirm_notion,
            create_user,
            create_time,
            update_user,
            update_time,
            is_deleted
        from
            jczz_place_ext
    </sql>
</mapper>