lin
2024-04-16 2b1a74f4faa5a00a294bdc6a6d956c2e009cf467
src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml
@@ -29,7 +29,7 @@
        left join blade_user bu on bu.id = jp.principal_user_id and bu.is_deleted = 0
        left join jczz_place_ext jpe on jpe.place_id=jp.id and jpe.is_deleted = 0
        left join jczz_grid jg on jg.grid_code = jp.grid_code and jg.is_deleted = 0
        LEFT JOIN jczz_police_affairs_grid jpag on jp.jw_grid_code= jpag.jw_grid_code
        LEFT JOIN jczz_police_affairs_grid jpag on jp.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0
        left join blade_region br on br.code = jpag.community_code
        LEFT JOIN blade_user bus on bus.id = jpag.police_user_id
        left join (
@@ -266,7 +266,7 @@
                        <otherwise>
                            and
                            (
                            jg.grid_code in ('') or jpag.community_code in in ('')
                            jg.grid_code in ('') or jpag.community_code in ('')
                            )
                        </otherwise>
                    </choose>
@@ -283,7 +283,9 @@
               jp.place_name AS   NAME,
               jp.is_nine AS isNine,
               jp.is_front AS isFront,
               jp.no_explosion_category AS noExplosionCategory,
               br.name neiName,
               jg.community_code neiCode,
               FALSE         AS   hasChildren
        FROM jczz_place jp
                 LEFT JOIN jczz_grid jg on jp.grid_code = jg.grid_code and jg.is_deleted = 0
@@ -344,6 +346,7 @@
        jp.is_front,
        jp.front_type,
        jp.remark,
        jp.three_fire_protection,
        bu.real_name as username,bu.phone as phone,
        jppl.id as plid,
        jppl.place_id,
@@ -643,7 +646,7 @@
                        <otherwise>
                            and
                            (
                            jg.grid_code in ('') or jpag.community_code in in ('')
                            jg.grid_code in ('') or jpag.community_code in ('')
                            )
                        </otherwise>
                    </choose>
@@ -685,39 +688,44 @@
        <result property="remark"    column="remark"    />
        <result property="isDeleted"    column="is_deleted"    />
        <result property="aoiCode"    column="aoi_code"    />
        <result property="threeFireProtection"    column="three_fire_protection"    />
    </resultMap>
    <sql id="selectPlace">
       select
           id,
           house_code,
           building_code,
           principal_user_id,
           principal,
           principal_id_card,
           principal_phone,
           place_name,
           lng,
           lat,
           location,
           image_urls,
           grid_code,
           source,
           status,
           is_scene,
           is_nine,
           nine_type,
           is_front,
           front_type,
           create_user,
           create_time,
           update_user,
           update_time,
           remark,
           is_deleted,
      from
           jczz_place
        select
            id,
            house_code,
            house_code_binds,
            building_code,
            principal_user_id,
            principal,
            principal_phone,
            principal_id_card,
            place_name,
            lng,
            lat,
            location,
            image_urls,
            grid_id,
            grid_code,
            jw_grid_code,
            source,
            status,
            is_scene,
            is_nine,
            nine_type,
            is_front,
            front_type,
            create_user,
            create_time,
            update_user,
            update_time,
            remark,
            is_deleted,
            aoi_code,
            three_fire_protection
        from
            jczz_place
    </sql>
@@ -904,4 +912,33 @@
        order by jp.create_time desc,jp.id desc
    </select>
    <!--查询所有场所数据-->
    <select id="getAllList" resultType="org.springblade.modules.place.vo.PlaceVO">
        select
        jp.*,
        jpag.community_code
        from jczz_place jp
        left join jczz_police_affairs_grid jpag on jp.jw_grid_code = jpag.jw_grid_code and jpag.is_deleted =0
        where jp.is_deleted = 0
        limit #{i},#{size}
    </select>
    <!--查询所有场所数据-->
    <select id="getAllListTotal" resultType="java.lang.Integer">
        select
        count(*)
        from jczz_place jp
        where jp.is_deleted = 0
    </select>
    <!--查询对应的社区编号-->
    <select id="getCommunityCode" resultType="java.lang.String">
        select
        jpag.community_code
        from jczz_place jp
        left join jczz_police_affairs_grid jpag on jp.jw_grid_code = jpag.jw_grid_code and jpag.is_deleted =0
        where jp.is_deleted = 0
        and jp.id = #{id}
    </select>
</mapper>