TwinRecordStopMapper.xml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.biz.mapper.TwinRecordStopMapper">
  6. <resultMap type="TwinRecordStop" id="TwinRecordStopResult">
  7. <result property="id" column="ID"/>
  8. <result property="deviceId" column="DEVICE_ID"/>
  9. <result property="dataDate" column="DATA_DATE"/>
  10. <result property="hour" column="HOUR"/>
  11. <result property="startTime" column="START_TIME"/>
  12. <result property="endTime" column="END_TIME"/>
  13. <result property="stopType" column="STOP_TYPE"/>
  14. <result property="calcStatus" column="CALC_STATUS"/>
  15. <result property="createdBy" column="CREATED_BY"/>
  16. <result property="createdTime" column="CREATED_TIME"/>
  17. <result property="updatedBy" column="UPDATED_BY"/>
  18. <result property="updatedTime" column="UPDATED_TIME"/>
  19. <result property="remark" column="REMARK"/>
  20. </resultMap>
  21. <sql id="selectTwinRecordStopVo">
  22. select ID,
  23. DEVICE_ID,
  24. DATA_DATE, HOUR, START_TIME, END_TIME, STOP_TYPE, CALC_STATUS, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, REMARK
  25. from twin_record_stop
  26. </sql>
  27. <select id="selectTwinRecordStopList" parameterType="TwinRecordStop" resultMap="TwinRecordStopResult">
  28. <include refid="selectTwinRecordStopVo"/>
  29. <where>
  30. <if test="deviceId != null ">and DEVICE_ID = #{deviceId}</if>
  31. <if test="dataDate != null ">and DATA_DATE = #{dataDate}</if>
  32. <if test="params.beginDataDate != null and params.beginDataDate != '' and params.endDataDate != null and params.endDataDate != ''">
  33. and DATA_DATE between #{params.beginDataDate} and #{params.endDataDate}
  34. </if>
  35. <if test="hour != null and hour != ''">and HOUR = #{hour}</if>
  36. <if test="params.beginStartTime != null and params.beginStartTime != '' and params.endStartTime != null and params.endStartTime != ''">
  37. and START_TIME between #{params.beginStartTime} and #{params.endStartTime}
  38. </if>
  39. <if test="params.beginEndTime != null and params.beginEndTime != '' and params.endEndTime != null and params.endEndTime != ''">
  40. and END_TIME between #{params.beginEndTime} and #{params.endEndTime}
  41. </if>
  42. <if test="stopType != null ">and STOP_TYPE = #{stopType}</if>
  43. <if test="calcStatus != null ">and CALC_STATUS = #{calcStatus}</if>
  44. <if test="createdBy != null and createdBy != ''">and CREATED_BY = #{createdBy}</if>
  45. <if test="createdTime != null ">and CREATED_TIME = #{createdTime}</if>
  46. <if test="updatedBy != null and updatedBy != ''">and UPDATED_BY = #{updatedBy}</if>
  47. <if test="updatedTime != null ">and UPDATED_TIME = #{updatedTime}</if>
  48. <if test="remark != null and remark != ''">and REMARK = #{remark}</if>
  49. </where>
  50. order by START_TIME
  51. </select>
  52. <select id="selectTwinRecordStopById" parameterType="Long" resultMap="TwinRecordStopResult">
  53. <include refid="selectTwinRecordStopVo"/>
  54. where ID = #{id}
  55. </select>
  56. <insert id="insertTwinRecordStop" parameterType="TwinRecordStop" useGeneratedKeys="true" keyProperty="id">
  57. insert into twin_record_stop
  58. <trim prefix="(" suffix=")" suffixOverrides=",">
  59. <if test="deviceId != null">DEVICE_ID,</if>
  60. <if test="dataDate != null">DATA_DATE,</if>
  61. <if test="hour != null">HOUR,</if>
  62. <if test="startTime != null">START_TIME,</if>
  63. <if test="endTime != null">END_TIME,</if>
  64. <if test="stopType != null">STOP_TYPE,</if>
  65. <if test="calcStatus != null ">CALC_STATUS</if>
  66. <if test="createdBy != null">CREATED_BY,</if>
  67. <if test="createdTime != null">CREATED_TIME,</if>
  68. <if test="updatedBy != null">UPDATED_BY,</if>
  69. <if test="updatedTime != null">UPDATED_TIME,</if>
  70. <if test="remark != null">REMARK,</if>
  71. </trim>
  72. <trim prefix="values (" suffix=")" suffixOverrides=",">
  73. <if test="deviceId != null">#{deviceId},</if>
  74. <if test="dataDate != null">#{dataDate},</if>
  75. <if test="hour != null">#{hour},</if>
  76. <if test="startTime != null">#{startTime},</if>
  77. <if test="endTime != null">#{endTime},</if>
  78. <if test="stopType != null">#{stopType},</if>
  79. <if test="calcStatus != null ">#{calcStatus},</if>
  80. <if test="createdBy != null">#{createdBy},</if>
  81. <if test="createdTime != null">#{createdTime},</if>
  82. <if test="updatedBy != null">#{updatedBy},</if>
  83. <if test="updatedTime != null">#{updatedTime},</if>
  84. <if test="remark != null">#{remark},</if>
  85. </trim>
  86. </insert>
  87. <update id="updateTwinRecordStop" parameterType="TwinRecordStop">
  88. update twin_record_stop
  89. <trim prefix="SET" suffixOverrides=",">
  90. <if test="deviceId != null">DEVICE_ID = #{deviceId},</if>
  91. <if test="dataDate != null">DATA_DATE = #{dataDate},</if>
  92. <if test="hour != null">HOUR = #{hour},</if>
  93. <if test="startTime != null">START_TIME = #{startTime},</if>
  94. <if test="endTime != null">END_TIME = #{endTime},</if>
  95. <if test="stopType != null">STOP_TYPE = #{stopType},</if>
  96. <if test="calcStatus != null ">CALC_STATUS = #{calcStatus},</if>
  97. <if test="createdBy != null">CREATED_BY = #{createdBy},</if>
  98. <if test="createdTime != null">CREATED_TIME = #{createdTime},</if>
  99. <if test="updatedBy != null">UPDATED_BY = #{updatedBy},</if>
  100. <if test="updatedTime != null">UPDATED_TIME = #{updatedTime},</if>
  101. <if test="remark != null">REMARK = #{remark},</if>
  102. </trim>
  103. where ID = #{id}
  104. </update>
  105. <delete id="deleteTwinRecordStopById" parameterType="Long">
  106. delete
  107. from twin_record_stop
  108. where ID = #{id}
  109. </delete>
  110. <delete id="deleteTwinRecordStopByIds" parameterType="String">
  111. delete from twin_record_stop where ID in
  112. <foreach item="id" collection="array" open="(" separator="," close=")">
  113. #{id}
  114. </foreach>
  115. </delete>
  116. </mapper>