mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-19 01:15:54 +08:00
大屏展示设备地图实现
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.iot.mapper.AreaCityGeoMapper">
|
||||
<resultMap id="BaseResultMap" type="com.ruoyi.iot.domain.AreaCityGeo">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table area_city_geo-->
|
||||
<result column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="pid" jdbcType="VARCHAR" property="pid" />
|
||||
<result column="deep" jdbcType="VARCHAR" property="deep" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, pid, deep, `name`
|
||||
</sql>
|
||||
|
||||
<select id="selectAreaCityGeoByPoint" resultMap="BaseResultMap">
|
||||
select <include refid="Base_Column_List"/> from area_city_geo where
|
||||
ST_Intersects(polygon, ST_GeomFromText(#{point,jdbcType=VARCHAR},0))=1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -322,6 +322,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="imgUrl != null">img_url,</if>
|
||||
<if test="summary != null">summary,</if>
|
||||
<if test="province != null">province,</if>
|
||||
<if test="city != null">city,</if>
|
||||
<if test="county != null">county,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
|
||||
@@ -351,6 +354,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="imgUrl != null">#{imgUrl},</if>
|
||||
<if test="summary != null">#{summary},</if>
|
||||
<if test="province != null">#{province},</if>
|
||||
<if test="city != null">#{city},</if>
|
||||
<if test="county != null">#{county},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -384,6 +390,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="imgUrl != null">img_url = #{imgUrl},</if>
|
||||
<if test="summary != null">summary = #{summary},</if>
|
||||
<if test="province != null">province = #{province},</if>
|
||||
<if test="city != null">city = #{city},</if>
|
||||
<if test="county != null">county = #{county},</if>
|
||||
</trim>
|
||||
where device_id = #{deviceId}
|
||||
</update>
|
||||
@@ -397,6 +406,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="longitude != null">longitude = #{longitude},</if>
|
||||
<if test="latitude != null">latitude = #{latitude},</if>
|
||||
<if test="activeTime != null">active_time = #{activeTime},</if>
|
||||
<if test="province != null">province = #{province},</if>
|
||||
<if test="city != null">city = #{city},</if>
|
||||
<if test="county != null">county = #{county},</if>
|
||||
</trim>
|
||||
where serial_number = #{serialNumber}
|
||||
</update>
|
||||
@@ -463,4 +475,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="userId != null"> and group_id in(select group_id from iot_group where user_id = #{userId})</if>
|
||||
</where>
|
||||
</delete>
|
||||
|
||||
<resultMap type="com.ruoyi.iot.model.bigscreen.dto.TotalDeviceArea" id="TotalDeviceAreaResult">
|
||||
<result property="name" column="name" />
|
||||
<result property="value" column="value" />
|
||||
</resultMap>
|
||||
|
||||
<select id="groupDeviceProvince" resultMap="TotalDeviceAreaResult">
|
||||
select province name,IFNULL(count(device_id), 0)value from iot_device group by province
|
||||
</select>
|
||||
|
||||
<select id="groupDeviceCityByProvince" resultMap="TotalDeviceAreaResult">
|
||||
select city name,IFNULL(count(device_id), 0)value from iot_device where province = #{province,jdbcType=VARCHAR} group by city
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user