DyeingHourAvgMapper.xml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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.jjt.dyeing.mapper.DyeingHourAvgMapper">
  6. <resultMap type="DyeingHourAvg" id="DyeingHourAvgResult">
  7. <result property="id" column="ID"/>
  8. <result property="dataDate" column="DATA_DATE"/>
  9. <result property="hour" column="HOUR"/>
  10. <result property="deviceId" column="DEVICE_ID"/>
  11. <result property="online" column="ONLINE"/>
  12. <result property="length" column="LENGTH"/>
  13. <result property="tmp" column="TMP"/>
  14. <result property="speed" column="SPEED"/>
  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="selectDyeingHourAvgVo">
  22. select ID,
  23. DATA_DATE,
  24. HOUR,
  25. DEVICE_ID,
  26. ONLINE,
  27. LENGTH,
  28. TMP,
  29. SPEED,
  30. CREATED_BY,
  31. CREATED_TIME,
  32. UPDATED_BY,
  33. UPDATED_TIME,
  34. REMARK
  35. from DYEING_HOUR_AVG
  36. </sql>
  37. <select id="selectDyeingHourAvgList" parameterType="DyeingHourAvg" resultMap="DyeingHourAvgResult">
  38. <include refid="selectDyeingHourAvgVo"/>
  39. <where>
  40. <if test="dataDate != null ">and DATA_DATE = #{dataDate}</if>
  41. <if test="hour != null ">and HOUR = #{hour}</if>
  42. <if test="deviceId != null ">and DEVICE_ID = #{deviceId}</if>
  43. <if test="online != null ">and ONLINE = #{online}</if>
  44. <if test="length != null ">and LENGTH = #{length}</if>
  45. <if test="tmp != null ">and TMP = #{tmp}</if>
  46. <if test="speed != null ">and SPEED = #{speed}</if>
  47. <if test="createdBy != null and createdBy != ''">and CREATED_BY = #{createdBy}</if>
  48. <if test="createdTime != null ">and CREATED_TIME = #{createdTime}</if>
  49. <if test="updatedBy != null and updatedBy != ''">and UPDATED_BY = #{updatedBy}</if>
  50. <if test="updatedTime != null ">and UPDATED_TIME = #{updatedTime}</if>
  51. <if test="remark != null and remark != ''">and REMARK = #{remark}</if>
  52. </where>
  53. </select>
  54. <select id="selectDyeingHourAvgById" parameterType="Long" resultMap="DyeingHourAvgResult">
  55. <include refid="selectDyeingHourAvgVo"/>
  56. where ID = #{id}
  57. </select>
  58. <insert id="insertDyeingHourAvg" parameterType="DyeingHourAvg">
  59. insert into DYEING_HOUR_AVG
  60. <trim prefix="(" suffix=")" suffixOverrides=",">
  61. <if test="dataDate != null">DATA_DATE,</if>
  62. <if test="hour != null">HOUR,</if>
  63. <if test="deviceId != null">DEVICE_ID,</if>
  64. <if test="online != null">ONLINE,</if>
  65. <if test="length != null">LENGTH,</if>
  66. <if test="tmp != null">TMP,</if>
  67. <if test="speed != null">SPEED,</if>
  68. <if test="createdBy != null">CREATED_BY,</if>
  69. <if test="createdTime != null">CREATED_TIME,</if>
  70. <if test="updatedBy != null">UPDATED_BY,</if>
  71. <if test="updatedTime != null">UPDATED_TIME,</if>
  72. <if test="remark != null">REMARK,</if>
  73. </trim>
  74. <trim prefix="values (" suffix=")" suffixOverrides=",">
  75. <if test="dataDate != null">#{dataDate},</if>
  76. <if test="hour != null">#{hour},</if>
  77. <if test="deviceId != null">#{deviceId},</if>
  78. <if test="online != null">#{online},</if>
  79. <if test="length != null">#{length},</if>
  80. <if test="tmp != null">#{tmp},</if>
  81. <if test="speed != null">#{speed},</if>
  82. <if test="createdBy != null">#{createdBy},</if>
  83. <if test="createdTime != null">#{createdTime},</if>
  84. <if test="updatedBy != null">#{updatedBy},</if>
  85. <if test="updatedTime != null">#{updatedTime},</if>
  86. <if test="remark != null">#{remark},</if>
  87. </trim>
  88. </insert>
  89. <update id="updateDyeingHourAvg" parameterType="DyeingHourAvg">
  90. update DYEING_HOUR_AVG
  91. <trim prefix="SET" suffixOverrides=",">
  92. <if test="dataDate != null">DATA_DATE = #{dataDate},</if>
  93. <if test="hour != null">HOUR = #{hour},</if>
  94. <if test="deviceId != null">DEVICE_ID = #{deviceId},</if>
  95. <if test="online != null">ONLINE = #{online},</if>
  96. <if test="length != null">LENGTH = #{length},</if>
  97. <if test="tmp != null">TMP = #{tmp},</if>
  98. <if test="speed != null">SPEED = #{speed},</if>
  99. <if test="createdBy != null">CREATED_BY = #{createdBy},</if>
  100. <if test="createdTime != null">CREATED_TIME = #{createdTime},</if>
  101. <if test="updatedBy != null">UPDATED_BY = #{updatedBy},</if>
  102. <if test="updatedTime != null">UPDATED_TIME = #{updatedTime},</if>
  103. <if test="remark != null">REMARK = #{remark},</if>
  104. </trim>
  105. where ID = #{id}
  106. </update>
  107. <delete id="deleteDyeingHourAvgById" parameterType="Long">
  108. delete
  109. from DYEING_HOUR_AVG
  110. where ID = #{id}
  111. </delete>
  112. <delete id="deleteDyeingHourAvgByIds" parameterType="String">
  113. delete from DYEING_HOUR_AVG where ID in
  114. <foreach item="id" collection="array" open="(" separator="," close=")">
  115. #{id}
  116. </foreach>
  117. </delete>
  118. <delete id="deleteByHour">
  119. delete
  120. from DYEING_HOUR_AVG
  121. where DATA_DATE = #{date}
  122. and HOUR = #{hour}
  123. </delete>
  124. </mapper>