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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?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.YsshSuYuan200Mapper">
    <resultMap id="YsshSuYuan200Result" type="com.yssh.entity.YsshSuYuanX00">
        <id column="id" property="id" javaType="java.lang.String" />
        <id column="name" property="name" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <id column="vocs_name" property="vocsName" 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="vocs_value" property="vocsValue" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <id column="vocs_daily" property="vocsDaily" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <id column="vocs_monthly" property="vocsMonthly" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <id column="vocs_annual" property="vocsAnnual" javaType="java.lang.String" jdbcType="VARCHAR"/>
        <id column="info" property="info" javaType="java.lang.String" jdbcType="VARCHAR"/>
    </resultMap>
    <select id="query" resultType="com.yssh.entity.YsshSuYuanX00">
        select * from yssh_suyuan200 where 1=1
        <if test="name != null and name != ''">
            and name = #{name}
        </if>
    </select>
    <select id="queryByIds" resultType="com.yssh.entity.YsshSuYuanX00">
        select * from yssh_suyuan200 where id in
        <foreach item="item" index="index" collection="list"
                 open="(" separator="," close=")">
            #{item}
        </foreach>
    </select>
    <select id="getAll" resultType="com.yssh.entity.YsshSuYuanX00">
        select * from yssh_suyuan200 where 1=1
    </select>
    <insert id="insert" parameterType="com.yssh.entity.YsshSuYuanX00">
        insert into yssh_suyuan200 (
            name, vocs_name, lon, lat, vocs_value, vocs_daily, vocs_monthly, vocs_annual, info
        )
        values (
            #{name},#{vocsName},#{lon},#{lat},#{vocsValue},#{vocsDaily},#{vocsMonthly},#{vocsAnnual},#{info}
        )
    </insert>
    <delete id="delete">
        delete from yssh_suyuan200 where id = #{id}
    </delete>
 
    <update id="update">
        update yssh_suyuan200
        <set >
            <if test="name != null and name != ''">
                name = #{name},
            </if>
            <if test="vocsName != null and vocsName != ''">
                vocs_name = #{vocsName},
            </if>
            <if test="lon != null">
                lon = #{lon},
            </if>
            <if test="lat != null">
                lat = #{lat},
            </if>
            <if test="vocsValue != null and vocsValue != ''">
                vocs_value = #{vocsValue},
            </if>
            <if test="vocsDaily != null and vocsDaily != ''">
                vocs_daily = #{vocsDaily},
            </if>
            <if test="vocsMonthly != null and vocsMonthly != ''">
                vocs_monthly = #{vocsMonthly},
            </if>
            <if test="vocsAnnual != null and vocsAnnual != ''">
                vocs_annual = #{vocsAnnual},
            </if>
            <if test="info != null and info != ''">
                info = #{info},
            </if>
        </set>
        where id = #{id}
    </update>
 
    <update id="updateBatch">
        update yssh_suyuan200
        <set >
            <if test="newName != null and newName != ''">
                vocs_name = #{newName},
            </if>
        </set>
        where id in
        <foreach item="item" index="index" collection="ids"
                 open="(" separator="," close=")">
            #{item}
        </foreach>
    </update>
 
    <select id="queryMaxVlue" resultType="com.yssh.entity.YsshSuYuanX00">
        select * from yssh_suyuan200 where 1=1
        <if test="name != null and name != ''">
            and name = #{name}
        </if>
        order by vocs_value desc limit 1
    </select>
</mapper>