‘liusuyi’
2023-09-19 893c1ef4c42b9e158d95c22172d332d328efd829
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?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.ard.alarm.digitization.mapper.DataBridgeMapper">
  <resultMap id="BaseResultMap" type="com.ard.alarm.digitization.model.DataBridge">
    <id column="DB_GUID" jdbcType="NVARCHAR" property="id" />
    <result column="DB_XMMC" jdbcType="VARCHAR" property="xmmc" />
    <result column="DB_FKEY" jdbcType="VARCHAR" property="fKey" />
    <result column="DB_FNAME" jdbcType="VARCHAR" property="fName" />
    <result column="DB_VALUE" jdbcType="VARCHAR" property="value" />
    <result column="DB_DATETIME" jdbcType="DATE" property="dateTime" />
    <result column="DB_BZ" jdbcType="VARCHAR" property="DB_BZ" />
  </resultMap>
  <sql id="Base_Column_List">
    DB_GUID, DB_XMMC, DB_FKEY, DB_FNAME, DB_VALUE, DB_DATETIME, DB_BZ
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from DATABRIDGE
    where DB_GUID = #{id,jdbcType=NVARCHAR}
  </select>
  <select id="selectDatabridgeList" parameterType="com.ard.alarm.digitization.model.DataBridge" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from (select * from DATABRIDGE  order by DB_DATETIME desc )
    <where>
      <if test="dateTime != null "> and DB_DATETIME > cast(#{dateTime,jdbcType=DATE} as date)</if>
      <if test="rowNum != null  ">and rownum &lt; #{rowNum}</if>
    </where>
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from DATABRIDGE
    where DB_GUID = #{id,jdbcType=NVARCHAR}
  </delete>
  <insert id="insert" parameterType="com.ard.alarm.digitization.model.DataBridge">
    insert into DATABRIDGE (DB_GUID, DB_XMMC, DB_FKEY, 
      DB_FNAME, DB_VALUE, DB_DATETIME, 
      DB_BZ)
    values (#{id,jdbcType=NVARCHAR}, #{xmmc,jdbcType=VARCHAR}, #{fKey,jdbcType=VARCHAR}, 
      #{fName,jdbcType=VARCHAR}, #{value,jdbcType=VARCHAR}, #{dateTime,jdbcType=TIMESTAMP}, 
      #{DB_BZ,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.ard.alarm.digitization.model.DataBridge">
    insert into DATABRIDGE
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        DB_GUID,
      </if>
      <if test="xmmc != null">
        DB_XMMC,
      </if>
      <if test="fKey != null">
        DB_FKEY,
      </if>
      <if test="fName != null">
        DB_FNAME,
      </if>
      <if test="value != null">
        DB_VALUE,
      </if>
      <if test="dateTime != null">
        DB_DATETIME,
      </if>
      <if test="DB_BZ != null">
        DB_BZ,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=NVARCHAR},
      </if>
      <if test="xmmc != null">
        #{xmmc,jdbcType=VARCHAR},
      </if>
      <if test="fKey != null">
        #{fKey,jdbcType=VARCHAR},
      </if>
      <if test="fName != null">
        #{fName,jdbcType=VARCHAR},
      </if>
      <if test="value != null">
        #{value,jdbcType=VARCHAR},
      </if>
      <if test="dateTime != null">
        #{dateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="DB_BZ != null">
        #{DB_BZ,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.ard.alarm.digitization.model.DataBridge">
    update DATABRIDGE
    <set>
      <if test="xmmc != null">
        DB_XMMC = #{xmmc,jdbcType=VARCHAR},
      </if>
      <if test="fKey != null">
        DB_FKEY = #{fKey,jdbcType=VARCHAR},
      </if>
      <if test="fName != null">
        DB_FNAME = #{fName,jdbcType=VARCHAR},
      </if>
      <if test="value != null">
        DB_VALUE = #{value,jdbcType=VARCHAR},
      </if>
      <if test="dateTime != null">
        DB_DATETIME = #{dateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="DB_BZ != null">
        DB_BZ = #{DB_BZ,jdbcType=VARCHAR},
      </if>
    </set>
    where DB_GUID = #{id,jdbcType=NVARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ard.alarm.digitization.model.DataBridge">
    update DATABRIDGE
    set DB_XMMC = #{xmmc,jdbcType=VARCHAR},
      DB_FKEY = #{fKey,jdbcType=VARCHAR},
      DB_FNAME = #{fName,jdbcType=VARCHAR},
      DB_VALUE = #{value,jdbcType=VARCHAR},
      DB_DATETIME = #{dateTime,jdbcType=TIMESTAMP},
      DB_BZ = #{DB_BZ,jdbcType=VARCHAR}
    where DB_GUID = #{id,jdbcType=NVARCHAR}
  </update>
</mapper>