<?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.Yssh2dreliMapper">
|
<resultMap id="Yssh2dreliResult" type="com.yssh.entity.Yssh2dreli">
|
<id column="id" property="id" javaType="java.lang.Integer" />
|
<id column="lon" property="lon" javaType="java.lang.Float" jdbcType="DOUBLE"/>
|
<id column="lat" property="lat" javaType="java.lang.Float" jdbcType="DOUBLE"/>
|
<id column="value" property="value" javaType="java.lang.String" jdbcType="VARCHAR" />
|
</resultMap>
|
|
<!--select * from yssh_2dreli where 1=1-->
|
<select id="getAll" resultType="com.yssh.entity.Yssh2dreli">
|
select * from yssh_2dreli where 1=1
|
</select>
|
|
<!--创建表的 SQL 语句-->
|
<update id="create2dreliTable" parameterType="java.lang.String">
|
CREATE TABLE IF NOT EXISTS `${tableName}` (
|
`id` int(20) NOT NULL AUTO_INCREMENT,
|
`lon` double NULL DEFAULT NULL COMMENT '经度',
|
`lat` double NULL DEFAULT NULL COMMENT '纬度',
|
`value` double NOT NULL,
|
`time` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
|
PRIMARY KEY (`id`) USING BTREE
|
) ENGINE = InnoDB AUTO_INCREMENT = 135712 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
</update>
|
|
<!--删除的 SQL 语句-->
|
<update id="drop2dreliTable" parameterType="java.lang.String">
|
DROP TABLE IF EXISTS ${tableName}
|
</update>
|
|
|
|
<!-- 时间查询yssh_2dreli_20230206 -->
|
<select id="query2data" resultType="com.yssh.entity.Yssh2dreli">
|
select * from ${tableName}
|
<where>
|
<if test="time != null and time != ''"> and time = '${time}'</if>
|
</where>
|
</select>
|
|
|
<!-- 时间查询 -->
|
<select id="twoDDataQuery" resultType="com.yssh.entity.Yssh2dreli">
|
select * from ${tableName}
|
</select>
|
|
<!-- 时间查询 1 -->
|
<select id="twoDDataQuery1" resultType="com.yssh.entity.Yssh2dreli">
|
SELECT * FROM ${tableName}
|
<where>
|
<if test="startTime != null and startTime != ''"> and TIME BETWEEN ${startTime} AND ${endOfTime}</if>
|
</where>
|
ORDER BY TIME DESC
|
</select>
|
|
<!-- 时间查询 2 -->
|
<select id="twoDDataQuery2" resultType="com.yssh.entity.Yssh2dreli">
|
SELECT * FROM ${tableName}
|
<where>
|
<if test="startTime != null and startTime != ''"> and TIME <![CDATA[ >= ]]> ${startTime}</if>
|
</where>
|
ORDER BY TIME DESC
|
</select>
|
|
<!-- 时间查询 3 -->
|
<select id="twoDDataQuery3" resultType="com.yssh.entity.Yssh2dreli">
|
SELECT * FROM ${tableName}
|
<where>
|
<if test="endOfTime != null and endOfTime != ''"> and TIME <![CDATA[ <= ]]> ${endOfTime}</if>
|
</where>
|
ORDER BY TIME DESC
|
</select>
|
|
|
|
</mapper>
|