update 查询站点列表接口

This commit is contained in:
Guoqs
2024-05-15 11:32:08 +08:00
parent fb8f69ab9e
commit 659818ed43
2 changed files with 373 additions and 7532 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -309,64 +309,61 @@
where id = #{id} where id = #{id}
</update> </update>
<delete id="deletePileStationInfoByIds" parameterType="String">
delete from pile_station_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="queryStationInfos" parameterType="com.jsowell.pile.dto.QueryStationDTO" resultType="com.jsowell.pile.vo.web.PileStationVO"> <select id="queryStationInfos" parameterType="com.jsowell.pile.dto.QueryStationDTO" resultType="com.jsowell.pile.vo.web.PileStationVO">
SELECT SELECT
t1.id as id, t1.id as id,
t1.dept_id as deptId, t1.dept_id as deptId,
t1.parking_id as parkingId, t1.parking_id as parkingId,
t1.station_name as stationName, t1.station_name as stationName,
count(t2.id) as pileNum, count(t2.id) as pileNum,
t1.area_code as areaCode, t1.area_code as areaCode,
t1.address as address, t1.address as address,
t1.qrcode_prefix as qrcodePrefix, t1.qrcode_prefix as qrcodePrefix,
t1.station_type as stationType, t1.station_type as stationType,
t1.station_status as stationStatus, t1.station_status as stationStatus,
t1.create_time as createTime, t1.create_time as createTime,
t1.pictures as pictures, t1.pictures as pictures,
t1.park_fee_describe as parkFeeDescribe, t1.park_fee_describe as parkFeeDescribe,
t2.merchant_id as merchantId, t2.merchant_id as merchantId,
t3.merchant_name as merchantName, t3.merchant_name as merchantName,
t1.station_admin_name as stationAdminName, t1.station_admin_name as stationAdminName,
t3.manager_name as merchantAdminName, t3.manager_name as merchantAdminName,
t3.manager_phone as managerPhone, t3.manager_phone as managerPhone,
t1.station_tel as stationTel, t1.station_tel as stationTel,
t1.match_cars as matchCars, t1.match_cars as matchCars,
t1.station_lng as stationLng, t1.station_lng as stationLng,
t1.station_lat as stationLat, t1.station_lat as stationLat,
t1.construction, <if test="stationDTO.stationLng != null and stationDTO.stationLng != ''">
t1.business_hours as businessHours, st_distance_sphere (POINT (#{stationDTO.stationLng} , #{stationDTO.stationLat}),POINT ( t1.station_lng, t1.station_lat )) distance,
t3.organization_code as organizationCode, IF(t1.station_lng IS NULL OR t1.station_lat IS NULL, 1, 0) AS is_missing,
t1.public_flag as publicFlag, </if>
t1.amap_flag as aMapFlag, t1.construction,
t1.open_flag as openFlag t1.business_hours as businessHours,
t3.organization_code as organizationCode,
t1.public_flag as publicFlag,
t1.amap_flag as aMapFlag,
t1.open_flag as openFlag
FROM FROM
pile_station_info t1 pile_station_info t1
left JOIN pile_basic_info t2 ON t1.id = t2.station_id and t2.del_flag = '0' left JOIN pile_basic_info t2 ON t1.id = t2.station_id and t2.del_flag = '0'
left JOIN pile_merchant_info t3 ON t3.id = t1.merchant_id and t3.del_flag = '0' left JOIN pile_merchant_info t3 ON t3.id = t1.merchant_id and t3.del_flag = '0'
where where
t1.del_flag = '0' t1.del_flag = '0'
<if test="stationDTO.stationName != null and stationDTO.stationName != ''"> <if test="stationDTO.stationName != null and stationDTO.stationName != ''">
and t1.station_name LIKE '%${stationDTO.stationName}%' and t1.station_name LIKE '%${stationDTO.stationName}%'
</if> </if>
<if test="stationDTO.stationAddress != null and stationDTO.stationAddress != ''"> <if test="stationDTO.stationAddress != null and stationDTO.stationAddress != ''">
and t1.address LIKE '%${stationDTO.stationAddress}%' and t1.address LIKE '%${stationDTO.stationAddress}%'
</if> </if>
<if test="stationDTO.areaCode != null and stationDTO.areaCode != ''"> <if test="stationDTO.areaCode != null and stationDTO.areaCode != ''">
and t1.area_code LIKE '%${stationDTO.areaCode}%' and t1.area_code LIKE '%${stationDTO.areaCode}%'
</if> </if>
<if test="stationDTO.publicFlag != null and stationDTO.publicFlag != ''"> <if test="stationDTO.publicFlag != null and stationDTO.publicFlag != ''">
and t1.public_flag = #{stationDTO.publicFlag,jdbcType=VARCHAR} and t1.public_flag = #{stationDTO.publicFlag,jdbcType=VARCHAR}
</if> </if>
<if test="stationDTO.merchantId != null and stationDTO.merchantId != ''"> <if test="stationDTO.merchantId != null and stationDTO.merchantId != ''">
and t1.merchant_id = #{stationDTO.merchantId,jdbcType=VARCHAR} and t1.merchant_id = #{stationDTO.merchantId,jdbcType=VARCHAR}
</if> </if>
<if test="stationDTO.stationAdminName != null and stationDTO.stationAdminName != ''"> <if test="stationDTO.stationAdminName != null and stationDTO.stationAdminName != ''">
and t1.station_admin_name = #{stationDTO.stationAdminName,jdbcType=VARCHAR} and t1.station_admin_name = #{stationDTO.stationAdminName,jdbcType=VARCHAR}
</if> </if>
@@ -376,41 +373,53 @@
<if test="stationDTO.stationTel != null and stationDTO.stationTel != ''"> <if test="stationDTO.stationTel != null and stationDTO.stationTel != ''">
and t1.station_tel = #{stationDTO.stationTel,jdbcType=VARCHAR} and t1.station_tel = #{stationDTO.stationTel,jdbcType=VARCHAR}
</if> </if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
<if test="stationDTO.merchantDeptIds != null and stationDTO.merchantDeptIds.size() != 0"> <if test="stationDTO.merchantDeptIds != null and stationDTO.merchantDeptIds.size() != 0">
and t3.dept_id in and t3.dept_id in
<foreach collection="stationDTO.merchantDeptIds" item="merchantDeptId" open="(" separator="," close=")"> <foreach collection="stationDTO.merchantDeptIds" item="merchantDeptId" open="(" separator="," close=")">
#{merchantDeptId} #{merchantDeptId}
</foreach> </foreach>
</if> </if>
<if test="stationDTO.stationDeptIds != null and stationDTO.stationDeptIds.size() != 0"> <if test="stationDTO.stationDeptIds != null and stationDTO.stationDeptIds.size() != 0">
and t1.dept_id in and t1.dept_id in
<foreach collection="stationDTO.stationDeptIds" item="stationDeptId" open="(" separator="," close=")"> <foreach collection="stationDTO.stationDeptIds" item="stationDeptId" open="(" separator="," close=")">
#{stationDeptId} #{stationDeptId}
</foreach> </foreach>
</if> </if>
GROUP BY GROUP BY
t1.id, t1.id,
t1.station_name, t1.station_name,
t1.area_code, t1.area_code,
t1.address, t1.address,
t1.station_type, t1.station_type,
t1.station_status, t1.station_status,
t1.create_time, t1.create_time,
t1.pictures, t1.pictures,
t2.merchant_id, t2.merchant_id,
t3.merchant_name, t3.merchant_name,
t3.manager_name, t3.manager_name,
t1.station_tel, t1.station_tel,
t1.match_cars, t1.match_cars,
t1.station_lng, t1.station_lng,
t1.station_lat, t1.station_lat,
t1.construction, t1.construction,
t1.business_hours, t1.business_hours,
t3.organization_code, t3.organization_code,
t1.public_flag, t1.public_flag,
t1.open_flag t1.open_flag
</select> <if test="stationDTO.stationLng != null and stationDTO.stationLng != ''">
ORDER BY
is_missing ASC,
distance ASC
</if>
</select>`
<delete id="deletePileStationInfoByIds" parameterType="String">
delete from pile_station_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectStationListByMerchantId" resultMap="PileStationInfoResult"> <select id="selectStationListByMerchantId" resultMap="PileStationInfoResult">
<include refid="selectPileStationInfoVo"/> <include refid="selectPileStationInfoVo"/>