123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <?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.TwinRecordStopMapper">
- <resultMap type="TwinRecordStop" id="TwinRecordStopResult">
- <result property="id" column="ID"/>
- <result property="deviceId" column="DEVICE_ID"/>
- <result property="dataDate" column="DATA_DATE"/>
- <result property="hour" column="HOUR"/>
- <result property="startTime" column="START_TIME"/>
- <result property="endTime" column="END_TIME"/>
- <result property="stopType" column="STOP_TYPE"/>
- <result property="calcStatus" column="CALC_STATUS"/>
- <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="selectTwinRecordStopVo">
- select ID,
- DEVICE_ID,
- DATA_DATE, HOUR, START_TIME, END_TIME, STOP_TYPE, CALC_STATUS, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, REMARK
- from twin_record_stop
- </sql>
- <select id="selectTwinRecordStopList" parameterType="TwinRecordStop" resultMap="TwinRecordStopResult">
- <include refid="selectTwinRecordStopVo"/>
- <where>
- <if test="deviceId != null ">and DEVICE_ID = #{deviceId}</if>
- <if test="dataDate != null ">and DATA_DATE = #{dataDate}</if>
- <if test="params.beginDataDate != null and params.beginDataDate != '' and params.endDataDate != null and params.endDataDate != ''">
- and DATA_DATE between #{params.beginDataDate} and #{params.endDataDate}
- </if>
- <if test="hour != null and hour != ''">and HOUR = #{hour}</if>
- <if test="params.beginStartTime != null and params.beginStartTime != '' and params.endStartTime != null and params.endStartTime != ''">
- and START_TIME between #{params.beginStartTime} and #{params.endStartTime}
- </if>
- <if test="params.beginEndTime != null and params.beginEndTime != '' and params.endEndTime != null and params.endEndTime != ''">
- and END_TIME between #{params.beginEndTime} and #{params.endEndTime}
- </if>
- <if test="stopType != null ">and STOP_TYPE = #{stopType}</if>
- <if test="calcStatus != null ">and CALC_STATUS = #{calcStatus}</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>
- </where>
- order by START_TIME
- </select>
- <select id="selectTwinRecordStopById" parameterType="Long" resultMap="TwinRecordStopResult">
- <include refid="selectTwinRecordStopVo"/>
- where ID = #{id}
- </select>
- <insert id="insertTwinRecordStop" parameterType="TwinRecordStop" useGeneratedKeys="true" keyProperty="id">
- insert into twin_record_stop
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="deviceId != null">DEVICE_ID,</if>
- <if test="dataDate != null">DATA_DATE,</if>
- <if test="hour != null">HOUR,</if>
- <if test="startTime != null">START_TIME,</if>
- <if test="endTime != null">END_TIME,</if>
- <if test="stopType != null">STOP_TYPE,</if>
- <if test="calcStatus != null ">CALC_STATUS</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="deviceId != null">#{deviceId},</if>
- <if test="dataDate != null">#{dataDate},</if>
- <if test="hour != null">#{hour},</if>
- <if test="startTime != null">#{startTime},</if>
- <if test="endTime != null">#{endTime},</if>
- <if test="stopType != null">#{stopType},</if>
- <if test="calcStatus != null ">#{calcStatus},</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="updateTwinRecordStop" parameterType="TwinRecordStop">
- update twin_record_stop
- <trim prefix="SET" suffixOverrides=",">
- <if test="deviceId != null">DEVICE_ID = #{deviceId},</if>
- <if test="dataDate != null">DATA_DATE = #{dataDate},</if>
- <if test="hour != null">HOUR = #{hour},</if>
- <if test="startTime != null">START_TIME = #{startTime},</if>
- <if test="endTime != null">END_TIME = #{endTime},</if>
- <if test="stopType != null">STOP_TYPE = #{stopType},</if>
- <if test="calcStatus != null ">CALC_STATUS = #{calcStatus},</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="deleteTwinRecordStopById" parameterType="Long">
- delete
- from twin_record_stop
- where ID = #{id}
- </delete>
- <delete id="deleteTwinRecordStopByIds" parameterType="String">
- delete from twin_record_stop where ID in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|