燕山石化溯源三维电子沙盘-【后端】-服务
13693261870
2023-04-25 ecd0ef5c6a78ac091b3fc2d42035cd0582c93a3f
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
<?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.WeatherMapper">
    <resultMap id="WeatherResult" type="com.yssh.entity.Weather">
        <id column="id" property="id" javaType="java.lang.Integer" />
        <id column="time" property="time" javaType="java.lang.String" jdbcType="VARCHAR" />
        <id column="wind_Speed" property="windSpeed" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <id column="wind_direction" property="windDirection" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <id column="weather_condition" property="weatherCondition" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <id column="temperature" property="temperature" javaType="java.lang.String" jdbcType="VARCHAR"/>
    </resultMap>
    
    <select id="query" resultMap="WeatherResult">
        select * from weather
        <where>
            <if test="begin != null and begin != ''">
                and Time &gt;= #{begin}
            </if>
            <if test="end != null and end != ''">
                and Time &lt;= #{end}
            </if>
        </where>
    </select>
    
    <select id="getAll" resultMap="WeatherResult">
        select * from weather
    </select>
 
    <insert id="insert" parameterType="com.yssh.entity.Weather">
        insert into weather (
            time, wind_speed, wind_direction, weather_condition, temperature
        )
        values (
            #{time},#{windSpeed},#{windDirection},#{weatherCondition},#{temperature}
        )
    </insert>
    <delete id="delete">
        delete from weather where id = #{id}
    </delete>
</mapper>