123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- <?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.jjt.rz.mapper.TwinCalcHourRzMapper">
- <resultMap type="TwinCalcHourRz" id="TwinCalcHourRzResult">
- <result property="id" column="ID"/>
- <result property="dataDate" column="DATA_DATE"/>
- <result property="hour" column="HOUR"/>
- <result property="dataTime" column="DATA_TIME"/>
- <result property="deviceId" column="DEVICE_ID"/>
- <result property="data" column="DATA"/>
- <result property="online" column="ONLINE"/>
- <result property="createdBy" column="CREATED_BY"/>
- <result property="createdTime" column="CREATED_TIME"/>
- <result property="updatedBy" column="UPDATED_BY"/>
- <result property="updatedTime" column="UPDATED_TIME"/>
- <result property="remark" column="REMARK"/>
- <result property="line" column="LINE"/>
- <result property="deviceName" column="DEVICE_NAME"/>
- <result property="wsName" column="WS_NAME"/>
- <result property="typeId" column="TYPE_ID"/>
- </resultMap>
- <sql id="selectTwinCalcHourRzVo">
- select *
- from (select a.ID,
- a.DATA_DATE,
- a.HOUR,
- a.DATA_TIME,
- a.DEVICE_ID,
- a.DATA,
- a.ONLINE,
- a.CREATED_BY,
- a.CREATED_TIME,
- a.UPDATED_BY,
- a.UPDATED_TIME,
- a.REMARK,
- b.DEVICE_NAME,
- b.line,
- b.WS_NAME,
- b.TYPE_ID
- from TWIN_CALC_HOUR_RZ a,
- TWIN_DEVICE_RZ b
- where a.device_id = b.device_id) a
- </sql>
- <select id="selectTwinCalcHourRzList" parameterType="TwinCalcHourRz" resultMap="TwinCalcHourRzResult">
- <include refid="selectTwinCalcHourRzVo"/>
- <where>
- <if test="dataDate != null ">and DATA_DATE = #{dataDate}</if>
- <if test="hour != null ">and HOUR = #{hour}</if>
- <if test="dataTime != null ">and DATA_TIME = #{dataTime}</if>
- <if test="deviceId != null ">and DEVICE_ID = #{deviceId}</if>
- <if test="data != null and data != ''">and DATA = #{data}</if>
- <if test="online != null ">and ONLINE = #{online}</if>
- <if test="createdBy != null and createdBy != ''">and CREATED_BY = #{createdBy}</if>
- <if test="createdTime != null ">and CREATED_TIME = #{createdTime}</if>
- <if test="updatedBy != null and updatedBy != ''">and UPDATED_BY = #{updatedBy}</if>
- <if test="updatedTime != null ">and UPDATED_TIME = #{updatedTime}</if>
- <if test="remark != null and remark != ''">and REMARK = #{remark}</if>
- <if test="line != null">and line = #{line}</if>
- </where>
- </select>
- <select id="selectTwinCalcHourRzById" parameterType="Long" resultMap="TwinCalcHourRzResult">
- <include refid="selectTwinCalcHourRzVo"/>
- where ID = #{id}
- </select>
- <select id="lastRecord" resultType="com.jjt.rz.domain.TwinCalcHourRz">
- select top 1 *
- from TWIN_CALC_HOUR_RZ
- order by id desc
- </select>
- <insert id="insertTwinCalcHourRz" parameterType="TwinCalcHourRz">
- insert into TWIN_CALC_HOUR_RZ
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="dataDate != null">DATA_DATE,</if>
- <if test="hour != null">HOUR,</if>
- <if test="dataTime != null">DATA_TIME,</if>
- <if test="deviceId != null">DEVICE_ID,</if>
- <if test="data != null">DATA,</if>
- <if test="online != null">ONLINE,</if>
- <if test="createdBy != null">CREATED_BY,</if>
- <if test="createdTime != null">CREATED_TIME,</if>
- <if test="updatedBy != null">UPDATED_BY,</if>
- <if test="updatedTime != null">UPDATED_TIME,</if>
- <if test="remark != null">REMARK,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="dataDate != null">#{dataDate},</if>
- <if test="hour != null">#{hour},</if>
- <if test="dataTime != null">#{dataTime},</if>
- <if test="deviceId != null">#{deviceId},</if>
- <if test="data != null">#{data},</if>
- <if test="online != null">#{online},</if>
- <if test="createdBy != null">#{createdBy},</if>
- <if test="createdTime != null">#{createdTime},</if>
- <if test="updatedBy != null">#{updatedBy},</if>
- <if test="updatedTime != null">#{updatedTime},</if>
- <if test="remark != null">#{remark},</if>
- </trim>
- </insert>
- <update id="updateTwinCalcHourRz" parameterType="TwinCalcHourRz">
- update TWIN_CALC_HOUR_RZ
- <trim prefix="SET" suffixOverrides=",">
- <if test="dataDate != null">DATA_DATE = #{dataDate},</if>
- <if test="hour != null">HOUR = #{hour},</if>
- <if test="dataTime != null">DATA_TIME = #{dataTime},</if>
- <if test="deviceId != null">DEVICE_ID = #{deviceId},</if>
- <if test="data != null">DATA = #{data},</if>
- <if test="online != null">ONLINE = #{online},</if>
- <if test="createdBy != null">CREATED_BY = #{createdBy},</if>
- <if test="createdTime != null">CREATED_TIME = #{createdTime},</if>
- <if test="updatedBy != null">UPDATED_BY = #{updatedBy},</if>
- <if test="updatedTime != null">UPDATED_TIME = #{updatedTime},</if>
- <if test="remark != null">REMARK = #{remark},</if>
- </trim>
- where ID = #{id}
- </update>
- <delete id="deleteTwinCalcHourRzById" parameterType="Long">
- delete
- from TWIN_CALC_HOUR_RZ
- where ID = #{id}
- </delete>
- <delete id="deleteTwinCalcHourRzByIds" parameterType="String">
- delete from TWIN_CALC_HOUR_RZ where ID in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <delete id="deleteTwinCalcHourRz">
- delete
- from TWIN_CALC_HOUR_RZ
- where DATA_DATE = #{date}
- and HOUR = #{hour}
- </delete>
- </mapper>
|