<?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.yssh.dao.Yssh3dreliMapper">
|
<resultMap id="Yssh3dreliResult" type="com.yssh.entity.Yssh3dreli">
|
<id column="id" property="id" javaType="java.lang.Integer" />
|
<id column="name" property="name" javaType="java.lang.String" jdbcType="VARCHAR" />
|
<id column="lon" property="lon" javaType="java.lang.Float" jdbcType="DOUBLE"/>
|
<id column="lat" property="lat" javaType="java.lang.Float" jdbcType="DOUBLE"/>
|
<id column="height0" property="height0" javaType="java.lang.String" jdbcType="VARCHAR" />
|
<id column="height10" property="height10" javaType="java.lang.String" jdbcType="VARCHAR" />
|
<id column="height20" property="height20" javaType="java.lang.String" jdbcType="VARCHAR" />
|
<id column="height30" property="height30" javaType="java.lang.String" jdbcType="VARCHAR" />
|
<id column="height40" property="height40" javaType="java.lang.String" jdbcType="VARCHAR" />
|
<id column="height50" property="height50" javaType="java.lang.String" jdbcType="VARCHAR" />
|
<id column="height60" property="height60" javaType="java.lang.String" jdbcType="VARCHAR" />
|
<id column="height70" property="height70" javaType="java.lang.String" jdbcType="VARCHAR" />
|
<id column="height80" property="height80" javaType="java.lang.String" jdbcType="VARCHAR" />
|
<id column="height90" property="height90" javaType="java.lang.String" jdbcType="VARCHAR" />
|
</resultMap>
|
<select id="query" resultType="com.yssh.entity.Yssh3dreli">
|
select * from yssh_3dreli where 1=1
|
<if test="name != null and name != ''">
|
and name = #{name}
|
</if>
|
</select>
|
<select id="getAll" resultType="com.yssh.entity.Yssh3dreli">
|
select * from yssh_3dreli where 1=1
|
</select>
|
|
|
<!--创建表的 SQL 语句-->
|
<update id="create3dreliTable" parameterType="java.lang.String">
|
CREATE TABLE IF NOT EXISTS `${tableName}`
|
(
|
`id` int(20) NOT NULL AUTO_INCREMENT,
|
`name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '点位名称',
|
`lon` double NULL DEFAULT NULL COMMENT '经度',
|
`lat` double NULL DEFAULT NULL COMMENT '纬度',
|
`height0` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '热力图高度0m数据',
|
`height10` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '热力图高度10m数据',
|
`height20` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '热力图高度20m数据',
|
`height30` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '热力图高度30m数据',
|
`height40` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '热力图高度40m数据',
|
`height50` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '热力图高度50m数据',
|
`height60` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '热力图高度60m数据',
|
`height70` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '热力图高度70m数据',
|
`height80` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '热力图高度80m数据',
|
`height90` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '热力图高度90m数据',
|
`time` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '时间',
|
PRIMARY KEY (`id`) USING BTREE
|
) ENGINE = InnoDB AUTO_INCREMENT = 8715 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
|
</update>
|
|
<!--删除的 SQL 语句 DROP TABLE ${tableName}-->
|
<update id="drop3dreliTable" parameterType="java.lang.String">
|
DROP TABLE IF EXISTS ${tableName}
|
</update>
|
|
|
|
<!-- 批量新增3D数据 <foreach item="item" index="index" collection="list" separator=","> -->
|
<insert id="batchInsert3dreliData" parameterType="java.util.List">
|
insert into ${tableName}
|
(name, lon, lat, height0, height10, height20, height30, height40, height50, height60, height70, height80, height90, time)
|
values
|
<foreach item="item" index="index" collection="list" separator=",">
|
(#{item.name},#{item.lon}, #{item.lat},#{item.height0},#{item.height10},#{item.height20},#{item.height30},#{item.height40},#{item.height50},#{item.height60},#{item.height70},#{item.height80},#{item.height90},#{item.time})
|
</foreach>
|
</insert>
|
|
<!-- 批量新增2D数据 <foreach item="item" index="index" collection="list" separator=","> -->
|
<insert id="batchInsert2dreliData" parameterType="java.util.List">
|
insert into ${tableName}
|
( lon, lat, value, time)
|
values
|
<foreach item="item" index="index" collection="list" separator=",">
|
(#{item.lon}, #{item.lat},#{item.value},#{item.time})
|
</foreach>
|
</insert>
|
|
|
|
|
<!-- 时间查询yssh_3dreli_20230206 -->
|
<select id="query3data" resultType="com.yssh.entity.Yssh3dreli">
|
select * from ${tableName}
|
<where>
|
<if test="time != null and time != ''"> and time = ${time}</if>
|
</where>
|
</select>
|
|
<!-- 时间查询 -->
|
<select id="thrDDataQuery" resultType="com.yssh.entity.Yssh3dreli">
|
select * from ${tableName}
|
</select>
|
<!-- 时间查询 01 -->
|
<select id="thrDDataQuery01" resultType="com.yssh.entity.Yssh3dreli">
|
select * from ${tableName}
|
<where>
|
<if test="name != null and name != ''"> and name like '${name}'</if>
|
</where>
|
</select>
|
|
<!-- 时间查询 1 -->
|
<select id="thrDDataQuery1" resultType="com.yssh.entity.Yssh3dreli">
|
SELECT * FROM ${tableName}
|
<where>
|
<if test="startTime != null and startTime != ''"> and TIME BETWEEN ${startTime} AND ${endOfTime}</if>
|
</where>
|
ORDER BY TIME DESC
|
</select>
|
<!-- 时间查询 11 -->
|
<select id="thrDDataQuery11" resultType="com.yssh.entity.Yssh3dreli">
|
SELECT * FROM ${tableName}
|
<where>
|
<if test="name != null and name != ''"> and name like '${name}'</if>
|
<if test="startTime != null and startTime != ''"> and TIME BETWEEN ${startTime} AND ${endOfTime}</if>
|
</where>
|
ORDER BY TIME DESC
|
</select>
|
|
<!-- 时间查询 2 -->
|
<select id="thrDDataQuery2" resultType="com.yssh.entity.Yssh3dreli">
|
SELECT * FROM ${tableName}
|
<where>
|
<if test="startTime != null and startTime != ''"> and TIME <![CDATA[ >= ]]> ${startTime}</if>
|
</where>
|
ORDER BY TIME DESC
|
</select>
|
|
<!-- 时间查询 3 -->
|
<select id="thrDDataQuery3" resultType="com.yssh.entity.Yssh3dreli">
|
SELECT * FROM ${tableName}
|
<where>
|
<if test="endOfTime != null and endOfTime != ''"> and TIME <![CDATA[ <= ]]> ${endOfTime}</if>
|
</where>
|
ORDER BY TIME DESC
|
</select>
|
|
|
|
|
|
|
</mapper>
|