123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284 |
- <?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.steerinfo.ems.rttable.mapper.RttableMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.ems.rttable.model.Rttable">
- <id column="ID" jdbcType="DECIMAL" property="id" />
- <result column="ALTID" jdbcType="VARCHAR" property="altid" />
- <result column="RTVALUE" jdbcType="DECIMAL" property="rtvalue" />
- <result column="ALARMSTATUS" jdbcType="DECIMAL" property="alarmstatus" />
- <result column="COMMSTATUS" jdbcType="DECIMAL" property="commstatus" />
- <result column="UPDATETIME" jdbcType="TIMESTAMP" property="updatetime" />
- <result column="NOTE" jdbcType="VARCHAR" property="note" />
- </resultMap>
- <sql id="columns">
- ID, ALTID, RTVALUE, ALARMSTATUS, COMMSTATUS, UPDATETIME, NOTE
- </sql>
- <sql id="columns_alias">
- t.ID, t.ALTID, t.RTVALUE, t.ALARMSTATUS, t.COMMSTATUS, t.UPDATETIME, t.NOTE
- </sql>
- <sql id="select">
- SELECT <include refid="columns"/> FROM RTTABLE
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias"/> FROM RTTABLE t
- </sql>
- <sql id="where">
- <where>
- <if test="id != null">
- and ID = #{id}
- </if>
- <if test="altid != null and altid != ''">
- and ALTID = #{altid}
- </if>
- <if test="rtvalue != null">
- and RTVALUE = #{rtvalue}
- </if>
- <if test="alarmstatus != null">
- and ALARMSTATUS = #{alarmstatus}
- </if>
- <if test="commstatus != null">
- and COMMSTATUS = #{commstatus}
- </if>
- <if test="updatetime != null">
- and TO_CHAR(UPDATETIME,'yyyy-MM-dd') = #{updatetime}
- </if>
- <if test="note != null and note != ''">
- and NOTE = #{note}
- </if>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="id != null">
- and ID = #{id}
- </if>
- <if test="altid != null and altid != ''">
- and ALTID LIKE '%${altid}%'
- </if>
- <if test="rtvalue != null">
- and RTVALUE = #{rtvalue}
- </if>
- <if test="alarmstatus != null">
- and ALARMSTATUS = #{alarmstatus}
- </if>
- <if test="commstatus != null">
- and COMMSTATUS = #{commstatus}
- </if>
- <if test="updatetime != null">
- and TO_CHAR(UPDATETIME,'yyyy-MM-dd') = #{updatetime}
- </if>
- <if test="note != null and note != ''">
- and NOTE LIKE '%${note}%'
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
- delete from RTTABLE
- where ID = #{id,jdbcType=DECIMAL}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from RTTABLE
- where 1!=1
- <if test="altid != null and altid != ''">
- or ALTID = #{altid}
- </if>
- <if test="rtvalue != null">
- or RTVALUE = #{rtvalue}
- </if>
- <if test="alarmstatus != null">
- or ALARMSTATUS = #{alarmstatus}
- </if>
- <if test="commstatus != null">
- or COMMSTATUS = #{commstatus}
- </if>
- <if test="updatetime != null">
- or TO_CHAR(UPDATETIME,'yyyy-MM-dd') = '#{updatetime}'
- </if>
- <if test="note != null and note != ''">
- or NOTE = #{note}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.ems.rttable.model.Rttable">
- insert into RTTABLE (ID, ALTID, RTVALUE,
- ALARMSTATUS, COMMSTATUS, UPDATETIME,
- NOTE)
- values (#{id,jdbcType=DECIMAL}, #{altid,jdbcType=VARCHAR}, #{rtvalue,jdbcType=DECIMAL},
- #{alarmstatus,jdbcType=DECIMAL}, #{commstatus,jdbcType=DECIMAL}, #{updatetime,jdbcType=TIMESTAMP},
- #{note,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.ems.rttable.model.Rttable">
- insert into RTTABLE
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- ID,
- </if>
- <if test="altid != null">
- ALTID,
- </if>
- <if test="rtvalue != null">
- RTVALUE,
- </if>
- <if test="alarmstatus != null">
- ALARMSTATUS,
- </if>
- <if test="commstatus != null">
- COMMSTATUS,
- </if>
- <if test="updatetime != null">
- UPDATETIME,
- </if>
- <if test="note != null">
- NOTE,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=DECIMAL},
- </if>
- <if test="altid != null">
- #{altid,jdbcType=VARCHAR},
- </if>
- <if test="rtvalue != null">
- #{rtvalue,jdbcType=DECIMAL},
- </if>
- <if test="alarmstatus != null">
- #{alarmstatus,jdbcType=DECIMAL},
- </if>
- <if test="commstatus != null">
- #{commstatus,jdbcType=DECIMAL},
- </if>
- <if test="updatetime != null">
- #{updatetime,jdbcType=TIMESTAMP},
- </if>
- <if test="note != null">
- #{note,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.rttable.model.Rttable">
- update RTTABLE
- set ALTID = #{altid,jdbcType=VARCHAR},
- RTVALUE = #{rtvalue,jdbcType=DECIMAL},
- ALARMSTATUS = #{alarmstatus,jdbcType=DECIMAL},
- COMMSTATUS = #{commstatus,jdbcType=DECIMAL},
- UPDATETIME = #{updatetime,jdbcType=TIMESTAMP},
- NOTE = #{note,jdbcType=VARCHAR}
- where ID = #{id,jdbcType=DECIMAL}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.rttable.model.Rttable">
- update RTTABLE
- <set>
- <if test="altid != null">
- ALTID = #{altid,jdbcType=VARCHAR},
- </if>
- <if test="rtvalue != null">
- RTVALUE = #{rtvalue,jdbcType=DECIMAL},
- </if>
- <if test="alarmstatus != null">
- ALARMSTATUS = #{alarmstatus,jdbcType=DECIMAL},
- </if>
- <if test="commstatus != null">
- COMMSTATUS = #{commstatus,jdbcType=DECIMAL},
- </if>
- <if test="updatetime != null">
- UPDATETIME = #{updatetime,jdbcType=TIMESTAMP},
- </if>
- <if test="note != null">
- NOTE = #{note,jdbcType=VARCHAR},
- </if>
- </set>
- where ID = #{id,jdbcType=DECIMAL}
- </update>
- <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
- <include refid="select"/>
- where ID = #{id,jdbcType=DECIMAL}
- </select>
- <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select"/>
- <include refid="where"/>
- </select>
- <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select"/>
- <include refid="whereLike"/>
- </select>
- <insert id="batchInsert" parameterType="java.util.List">
- insert into RTTABLE
- (ID,
- ALTID, RTVALUE, ALARMSTATUS,
- COMMSTATUS, UPDATETIME, NOTE
- )
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.id,jdbcType=DECIMAL},
- #{item.altid,jdbcType=VARCHAR}, #{item.rtvalue,jdbcType=DECIMAL}, #{item.alarmstatus,jdbcType=DECIMAL},
- #{item.commstatus,jdbcType=DECIMAL}, #{item.updatetime,jdbcType=TIMESTAMP}, #{item.note,jdbcType=VARCHAR}
- from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update RTTABLE
- set
- ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
- when #{item.id,jdbcType=DECIMAL} then #{item.id,jdbcType=DECIMAL}
- </foreach>
- ,ALTID=
- <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
- when #{item.id,jdbcType=DECIMAL} then #{item.altid,jdbcType=VARCHAR}
- </foreach>
- ,RTVALUE=
- <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
- when #{item.id,jdbcType=DECIMAL} then #{item.rtvalue,jdbcType=DECIMAL}
- </foreach>
- ,ALARMSTATUS=
- <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
- when #{item.id,jdbcType=DECIMAL} then #{item.alarmstatus,jdbcType=DECIMAL}
- </foreach>
- ,COMMSTATUS=
- <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
- when #{item.id,jdbcType=DECIMAL} then #{item.commstatus,jdbcType=DECIMAL}
- </foreach>
- ,UPDATETIME=
- <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
- when #{item.id,jdbcType=DECIMAL} then #{item.updatetime,jdbcType=TIMESTAMP}
- </foreach>
- ,NOTE=
- <foreach collection="list" item="item" index="index" separator=" " open="case ID" close="end">
- when #{item.id,jdbcType=DECIMAL} then #{item.note,jdbcType=VARCHAR}
- </foreach>
- where ID in
- <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
- #{item.id,jdbcType=DECIMAL}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from RTTABLE
- where ID in
- <foreach collection="list" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- <insert id="insertPowerTenMinutes" parameterType="java.util.HashMap">
- INSERT INTO EMS_POWER_TIMING(TMSTMP) VALUES
- (to_date (#{clock1,jdbcType=TIME}, 'YYYY-MM-DD HH24:MI:SS' )
- )
- </insert>
- <update id="updatePowerTenMinutes" parameterType="java.util.HashMap">
- update EMS_POWER_TIMING
- <set>
- ${sql}
- </set>
- where TMSTMP =to_date (#{clock1,jdbcType=TIME}, 'YYYY-MM-DD HH24:MI:SS' )
- </update>
- <update id="updatePowerMinutes" parameterType="java.util.HashMap">
- update ${table}
- <set>
- <if test="clock != null and clock != ''">
- TMSTMP = to_date (#{clock,jdbcType=TIME}, 'YYYY-MM-DD HH24:MI:SS' )
- </if>
- ${sql}
- </set>
- </update>
- </mapper>
|