From b3b566ebdfed4005aaa513da3d5d2fd3924903cc Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Wed, 31 Jan 2024 16:17:54 +0800
Subject: [PATCH] 拿不到地址总表数据,不设置网格信息
---
src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.xml | 92 ++++++++++++++++++++++++++++++---------------
1 files changed, 61 insertions(+), 31 deletions(-)
diff --git a/src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.xml b/src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.xml
index 6e7b128..7cf6ed3 100644
--- a/src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.xml
+++ b/src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.xml
@@ -20,29 +20,75 @@
<result column="town_name" property="streetName"/>
<result column="village_name" property="communityName"/>
- <collection property="patrolRecordVOList" column="id"
+ <collection property="placePoiLabelVOList" column="jpid" javaType="java.util.List" select="selectPlacePoiLabelList"
+ ofType="org.springblade.modules.place.vo.PlacePoiLabelVO"
+ autoMapping="true">
+ </collection>
+
+ <collection property="patrolRecordVOList" column="id" select="selectPatrolRecordList"
javaType="java.util.List" ofType="org.springblade.modules.patrol.entity.PatrolRecord"
autoMapping="true">
- <id property="placeCheckId" column="id"/>
</collection>
</resultMap>
+
+ <select id="selectPlacePoiLabelList" parameterType="Long"
+ resultType="org.springblade.modules.place.vo.PlacePoiLabelVO">
+ SELECT
+ jppl.id,
+ jppl.place_id,
+ jppl.poi_code,
+ jppl.type,
+ jppl.color,
+ jppl.remark,
+ jc.category_name labelName
+ FROM
+ jczz_place_poi_label jppl
+ LEFT JOIN jczz_category jc ON jppl.poi_code = jc.category_no
+ WHERE
+ jppl.type = '3'
+ and place_id = #{jpid}
+ </select>
+
+
+ <select id="selectPatrolRecordList" parameterType="Long"
+ resultType="org.springblade.modules.patrol.entity.PatrolRecord">
+ select
+ id,
+ item_id,
+ place_check_id,
+ state,
+ remark,
+ image_urls,
+ create_user,
+ create_time,
+ is_deleted
+ from
+ jczz_patrol_record where place_check_id = #{id}
+ </select>
+
<!--自定义分页查询-->
<select id="selectPlaceCheckPage" resultMap="placeCheckResultMap">
SELECT
jpc.*,
+ jp.id jpid,
jp.place_name,
jp.location,
jg.grid_name,
jp.principal,
jp.principal_phone,
- br.town_name ,
- br.village_name
+ br.town_name,
+ br.village_name,
+ bu.`name`,
+ jpe.legal_tel,
+ jpe.legal_person
FROM
jczz_place_check jpc
LEFT JOIN jczz_place jp ON jpc.house_code = jp.house_code
LEFT JOIN jczz_grid jg ON jg.grid_code = jp.grid_code
LEFT JOIN blade_region br ON br.`code` = jg.community_code
+ LEFT JOIN jczz_place_ext jpe ON jpe.place_id = jp.id
+ LEFT JOIN blade_user bu ON bu.id = jpc.create_user
where jpc.is_deleted = 0
<if test="placeCheck.houseCode!=null and placeCheck.houseCode!=''">
and jpc.house_code = #{placeCheck.houseCode}
@@ -78,31 +124,9 @@
<if test="placeCheck.endTime!=null and placeCheck.endTime!=''">
and date_format(jpc.create_time,'%Y-%m-%d') <= #{placeCheck.endTime}
</if>
+ order by jpc.create_time desc
</select>
-
- <resultMap type="org.springblade.modules.place.dto.PlaceCheckDTO" id="PlaceCheckDTOResult">
- <result property="id" column="id"/>
- <result property="houseCode" column="house_code"/>
- <result property="remark" column="remark"/>
- <result property="signaturePath" column="signature_path"/>
- <result property="createUser" column="create_user"/>
- <result property="createTime" column="create_time"/>
- <result property="isDeleted" column="is_deleted"/>
- <result column="place_name" property="placeName"/>
- <result column="location" property="location"/>
- <result column="grid_name" property="gridName"/>
- <result column="principal" property="principal"/>
- <result column="principal_phone" property="principalPhone"/>
- <result column="town_name" property="streetName"/>
- <result column="village_name" property="communityName"/>
-
- <collection property="patrolRecordVOList" column="id"
- javaType="java.util.List" ofType="org.springblade.modules.patrol.entity.PatrolRecord"
- autoMapping="true">
- <id property="placeCheckId" column="id"/>
- </collection>
- </resultMap>
<sql id="selectPlaceCheck">
select
@@ -117,28 +141,34 @@
jczz_place_check
</sql>
- <select id="selectPlaceCheckById" parameterType="long" resultMap="PlaceCheckDTOResult">
+ <select id="selectPlaceCheckById" parameterType="long" resultMap="placeCheckResultMap">
SELECT
jpc.*,
+ jp.id jpid,
jp.place_name,
jp.location,
jg.grid_name,
jp.principal,
jp.principal_phone,
- br.town_name ,
- br.village_name
+ br.town_name,
+ br.village_name,
+ bu.`name`,
+ jpe.legal_tel,
+ jpe.legal_person
FROM
jczz_place_check jpc
LEFT JOIN jczz_place jp ON jpc.house_code = jp.house_code
LEFT JOIN jczz_grid jg ON jg.grid_code = jp.grid_code
LEFT JOIN blade_region br ON br.`code` = jg.community_code
+ LEFT JOIN jczz_place_ext jpe ON jpe.place_id = jp.id
+ LEFT JOIN blade_user bu ON bu.id = jpc.create_user
where
jpc.is_deleted = 0
and jpc.id = #{id}
</select>
<select id="selectPlaceCheckList" parameterType="org.springblade.modules.place.dto.PlaceCheckDTO"
- resultMap="PlaceCheckDTOResult">
+ resultMap="placeCheckResultMap">
<include refid="selectPlaceCheck"/>
<where>
<if test="id != null ">and id = #{id}</if>
--
Gitblit v1.9.3