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
<?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.YsshQxshCsvMapper">
    <resultMap id="YsshQxshResult" type="com.yssh.entity.YsshQxshCsv_bak">
        <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="value" property="value" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <id column="time" property="time" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <id column="property" property="property" javaType="java.lang.Integer"  jdbcType="INTEGER"/>
        <id column="wg100" property="wg100" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <id column="wg200" property="wg200" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <id column="wg300" property="wg300" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <id column="wg500" property="wg500" javaType="java.lang.String" jdbcType="VARCHAR"/>
    </resultMap>
    <select id="query" resultType="com.yssh.entity.YsshQxshCsv_bak">
        select * from yssh_qxsh_csv where 1=1
        <if test="name != null and name != ''">
           and name = #{name}
        </if>
        order by time desc
    </select>
    <select id="queryByTime" resultType="com.yssh.entity.YsshQxshCsv_bak">
        select * from yssh_qxsh_csv where 1=1
        <if test="leftTime != null and leftTime != ''">
            and time >= #{leftTime}
        </if>
        <if test="rightTime != null and rightTime != ''">
            and time &lt;= #{rightTime}
        </if>
        <if test="name != null and name != ''">
            and name = #{name}
        </if>
        order by time desc
    </select>
    <select id="getAll" resultType="com.yssh.entity.YsshQxshCsv_bak">
        select * from yssh_qxsh_csv where 1=1
    </select>
    <select id="queryAlarmStatic" resultType="java.lang.Integer">
        select count(*) from yssh_qxsh_csv where 1=1 and value &gt;= #{jcbj} and time &gt;= #{mon}
    </select>
 
    <select id="queryCurrentAlarmStatic" resultType="java.lang.Integer">
        select count(*) from yssh_qxsh_csv where 1=1 and value &gt;= #{jcbj} and time like concat(#{mon},'%')
    </select>
 
    <select id="queryEarlyWarningStatic" resultType="java.lang.Integer">
        select count(*) from yssh_qxsh_csv where 1=1 and value &gt;= #{jcyj} and value &lt; #{jcbj} and time &gt;= #{mon}
    </select>
 
    <insert id="insert" parameterType="com.yssh.entity.YsshQxshCsv_bak">
        insert into yssh_qxsh_csv (
            name, lon, lat, value, time, property, wg100,wg200,wg300,wg500
        )
        values (
            #{name},#{lon},#{lat},#{value},#{time},#{property},#{wg100},#{wg200},#{wg300},#{wg500}
        )
    </insert>
    <delete id="delete">
        delete from yssh_qxsh_csv where id = #{id}
    </delete>
    
</mapper>