123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <?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.ruoyi.biz.mapper.TwinCalcHourMapper">
- <resultMap type="TwinCalcHour" id="TwinCalcHourResult">
- <result property="id" column="ID"/>
- <result property="dataDate" column="DATA_DATE"/>
- <result property="hour" column="HOUR"/>
- <result property="time" column="TIME"/>
- <result property="deviceId" column="DEVICE_ID"/>
- <result property="kwh" column="KWH"/>
- <result property="weight" column="WEIGHT"/>
- <result property="length" column="LENGTH"/>
- <result property="openTime" column="OPEN_TIME"/>
- <result property="closeTime" column="CLOSE_TIME"/>
- <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"/>
- </resultMap>
- <sql id="selectTwinCalcHourVo">
- select ID,
- DATA_DATE, HOUR, DEVICE_ID, KWH, WEIGHT, LENGTH, OPEN_TIME, CLOSE_TIME, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, REMARK
- from twin_calc_hour
- </sql>
- <select id="selectTwinCalcHourList" parameterType="TwinCalcHour" resultMap="TwinCalcHourResult">
- <include refid="selectTwinCalcHourVo"/>
- <where>
- <if test="dataDate != null ">and DATA_DATE = #{dataDate}</if>
- <if test="hour != null">and HOUR = #{hour}</if>
- <if test="deviceId != null ">and DEVICE_ID = #{deviceId}</if>
- <if test="kwh != null ">and KWH = #{kwh}</if>
- <if test="weight != null ">and WEIGHT = #{weight}</if>
- <if test="length != null ">and LENGTH = #{length}</if>
- <if test="openTime != null ">and OPEN_TIME = #{openTime}</if>
- <if test="closeTime != null ">and CLOSE_TIME = #{closeTime}</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="params.sTime != null and params.eTime != null">
- and DATE_ADD(data_date, INTERVAL `HOUR` HOUR) between #{params.sTime} and #{params.eTime}
- </if>
- </where>
- </select>
- <select id="selectTwinCalcHourById" parameterType="Long" resultMap="TwinCalcHourResult">
- <include refid="selectTwinCalcHourVo"/>
- where ID = #{id}
- </select>
- <select id="lastHour" resultMap="TwinCalcHourResult">
- <include refid="selectTwinCalcHourVo"/>
- order by id desc limit 1
- </select>
- <insert id="insertTwinCalcHour" parameterType="TwinCalcHour" useGeneratedKeys="true" keyProperty="id">
- insert into twin_calc_hour
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="dataDate != null">DATA_DATE,</if>
- <if test="hour != null">HOUR,</if>
- <if test="deviceId != null">DEVICE_ID,</if>
- <if test="kwh != null">KWH,</if>
- <if test="weight != null">WEIGHT,</if>
- <if test="length != null">LENGTH,</if>
- <if test="openTime != null">OPEN_TIME,</if>
- <if test="closeTime != null">CLOSE_TIME,</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="deviceId != null">#{deviceId},</if>
- <if test="kwh != null">#{kwh},</if>
- <if test="weight != null">#{weight},</if>
- <if test="length != null">#{length},</if>
- <if test="openTime != null">#{openTime},</if>
- <if test="closeTime != null">#{closeTime},</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="updateTwinCalcHour" parameterType="TwinCalcHour">
- update twin_calc_hour
- <trim prefix="SET" suffixOverrides=",">
- <if test="dataDate != null">DATA_DATE = #{dataDate},</if>
- <if test="hour != null">HOUR = #{hour},</if>
- <if test="deviceId != null">DEVICE_ID = #{deviceId},</if>
- <if test="kwh != null">KWH = #{kwh},</if>
- <if test="weight != null">WEIGHT = #{weight},</if>
- <if test="length != null">LENGTH = #{length},</if>
- <if test="openTime != null">OPEN_TIME = #{openTime},</if>
- <if test="closeTime != null">CLOSE_TIME = #{closeTime},</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="deleteTwinCalcHourById" parameterType="Long">
- delete
- from twin_calc_hour
- where ID = #{id}
- </delete>
- <delete id="deleteTwinCalcHourByIds" parameterType="String">
- delete from twin_calc_hour where ID in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|