<?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 < #{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>
|