xing
2023-02-23 c75e6f4696634d626c5569794c6349593853223a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?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>