MouldHistoryTimeMapper.xml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.js.kbt.mapper.MouldHistoryTimeMapper">
  4. <resultMap id="BaseResultMap" type="com.js.kbt.model.MouldHistoryTime">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Fri Mar 20 18:04:50 CST 2020.
  9. -->
  10. <result column="history_id" jdbcType="BIGINT" property="historyId" />
  11. <result column="seq" jdbcType="INTEGER" property="seq" />
  12. <result column="close_time" jdbcType="TIMESTAMP" property="closeTime" />
  13. <result column="open_time" jdbcType="TIMESTAMP" property="openTime" />
  14. <result column="time_cost" jdbcType="INTEGER" property="timeCost" />
  15. <result column="equipment_no" jdbcType="VARCHAR" property="equipmentNo" />
  16. <result column="is_true" jdbcType="INTEGER" property="isTrue" />
  17. </resultMap>
  18. <sql id="Example_Where_Clause">
  19. <!--
  20. WARNING - @mbg.generated
  21. This element is automatically generated by MyBatis Generator, do not modify.
  22. This element was generated on Fri Mar 20 18:04:50 CST 2020.
  23. -->
  24. <where>
  25. <foreach collection="oredCriteria" item="criteria" separator="or">
  26. <if test="criteria.valid">
  27. <trim prefix="(" prefixOverrides="and" suffix=")">
  28. <foreach collection="criteria.criteria" item="criterion">
  29. <choose>
  30. <when test="criterion.noValue">
  31. and ${criterion.condition}
  32. </when>
  33. <when test="criterion.singleValue">
  34. and ${criterion.condition} #{criterion.value}
  35. </when>
  36. <when test="criterion.betweenValue">
  37. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  38. </when>
  39. <when test="criterion.listValue">
  40. and ${criterion.condition}
  41. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  42. #{listItem}
  43. </foreach>
  44. </when>
  45. </choose>
  46. </foreach>
  47. </trim>
  48. </if>
  49. </foreach>
  50. </where>
  51. </sql>
  52. <sql id="Update_By_Example_Where_Clause">
  53. <!--
  54. WARNING - @mbg.generated
  55. This element is automatically generated by MyBatis Generator, do not modify.
  56. This element was generated on Fri Mar 20 18:04:50 CST 2020.
  57. -->
  58. <where>
  59. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  60. <if test="criteria.valid">
  61. <trim prefix="(" prefixOverrides="and" suffix=")">
  62. <foreach collection="criteria.criteria" item="criterion">
  63. <choose>
  64. <when test="criterion.noValue">
  65. and ${criterion.condition}
  66. </when>
  67. <when test="criterion.singleValue">
  68. and ${criterion.condition} #{criterion.value}
  69. </when>
  70. <when test="criterion.betweenValue">
  71. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  72. </when>
  73. <when test="criterion.listValue">
  74. and ${criterion.condition}
  75. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  76. #{listItem}
  77. </foreach>
  78. </when>
  79. </choose>
  80. </foreach>
  81. </trim>
  82. </if>
  83. </foreach>
  84. </where>
  85. </sql>
  86. <sql id="Base_Column_List">
  87. <!--
  88. WARNING - @mbg.generated
  89. This element is automatically generated by MyBatis Generator, do not modify.
  90. This element was generated on Fri Mar 20 18:04:50 CST 2020.
  91. -->
  92. history_id, seq, close_time, open_time, time_cost, equipment_no, is_true
  93. </sql>
  94. <select id="selectByExample" parameterType="com.js.kbt.model.MouldHistoryTimeExample" resultMap="BaseResultMap">
  95. <!--
  96. WARNING - @mbg.generated
  97. This element is automatically generated by MyBatis Generator, do not modify.
  98. This element was generated on Fri Mar 20 18:04:50 CST 2020.
  99. -->
  100. select
  101. <if test="distinct">
  102. distinct
  103. </if>
  104. <include refid="Base_Column_List" />
  105. from mould_history_time
  106. <if test="_parameter != null">
  107. <include refid="Example_Where_Clause" />
  108. </if>
  109. <if test="orderByClause != null">
  110. order by ${orderByClause}
  111. </if>
  112. </select>
  113. <delete id="deleteByExample" parameterType="com.js.kbt.model.MouldHistoryTimeExample">
  114. <!--
  115. WARNING - @mbg.generated
  116. This element is automatically generated by MyBatis Generator, do not modify.
  117. This element was generated on Fri Mar 20 18:04:50 CST 2020.
  118. -->
  119. delete from mould_history_time
  120. <if test="_parameter != null">
  121. <include refid="Example_Where_Clause" />
  122. </if>
  123. </delete>
  124. <insert id="insert" parameterType="com.js.kbt.model.MouldHistoryTime">
  125. <!--
  126. WARNING - @mbg.generated
  127. This element is automatically generated by MyBatis Generator, do not modify.
  128. This element was generated on Fri Mar 20 18:04:50 CST 2020.
  129. -->
  130. insert into mould_history_time (history_id, seq, close_time,
  131. open_time, time_cost, equipment_no,
  132. is_true)
  133. values (#{historyId,jdbcType=BIGINT}, #{seq,jdbcType=INTEGER}, #{closeTime,jdbcType=TIMESTAMP},
  134. #{openTime,jdbcType=TIMESTAMP}, #{timeCost,jdbcType=INTEGER}, #{equipmentNo,jdbcType=VARCHAR},
  135. #{isTrue,jdbcType=INTEGER})
  136. </insert>
  137. <insert id="insertSelective" parameterType="com.js.kbt.model.MouldHistoryTime">
  138. <!--
  139. WARNING - @mbg.generated
  140. This element is automatically generated by MyBatis Generator, do not modify.
  141. This element was generated on Fri Mar 20 18:04:50 CST 2020.
  142. -->
  143. insert into mould_history_time
  144. <trim prefix="(" suffix=")" suffixOverrides=",">
  145. <if test="historyId != null">
  146. history_id,
  147. </if>
  148. <if test="seq != null">
  149. seq,
  150. </if>
  151. <if test="closeTime != null">
  152. close_time,
  153. </if>
  154. <if test="openTime != null">
  155. open_time,
  156. </if>
  157. <if test="timeCost != null">
  158. time_cost,
  159. </if>
  160. <if test="equipmentNo != null">
  161. equipment_no,
  162. </if>
  163. <if test="isTrue != null">
  164. is_true,
  165. </if>
  166. </trim>
  167. <trim prefix="values (" suffix=")" suffixOverrides=",">
  168. <if test="historyId != null">
  169. #{historyId,jdbcType=BIGINT},
  170. </if>
  171. <if test="seq != null">
  172. #{seq,jdbcType=INTEGER},
  173. </if>
  174. <if test="closeTime != null">
  175. #{closeTime,jdbcType=TIMESTAMP},
  176. </if>
  177. <if test="openTime != null">
  178. #{openTime,jdbcType=TIMESTAMP},
  179. </if>
  180. <if test="timeCost != null">
  181. #{timeCost,jdbcType=INTEGER},
  182. </if>
  183. <if test="equipmentNo != null">
  184. #{equipmentNo,jdbcType=VARCHAR},
  185. </if>
  186. <if test="isTrue != null">
  187. #{isTrue,jdbcType=INTEGER},
  188. </if>
  189. </trim>
  190. </insert>
  191. <select id="countByExample" parameterType="com.js.kbt.model.MouldHistoryTimeExample" resultType="java.lang.Long">
  192. <!--
  193. WARNING - @mbg.generated
  194. This element is automatically generated by MyBatis Generator, do not modify.
  195. This element was generated on Fri Mar 20 18:04:50 CST 2020.
  196. -->
  197. select count(*) from mould_history_time
  198. <if test="_parameter != null">
  199. <include refid="Example_Where_Clause" />
  200. </if>
  201. </select>
  202. <update id="updateByExampleSelective" parameterType="map">
  203. <!--
  204. WARNING - @mbg.generated
  205. This element is automatically generated by MyBatis Generator, do not modify.
  206. This element was generated on Fri Mar 20 18:04:50 CST 2020.
  207. -->
  208. update mould_history_time
  209. <set>
  210. <if test="record.historyId != null">
  211. history_id = #{record.historyId,jdbcType=BIGINT},
  212. </if>
  213. <if test="record.seq != null">
  214. seq = #{record.seq,jdbcType=INTEGER},
  215. </if>
  216. <if test="record.closeTime != null">
  217. close_time = #{record.closeTime,jdbcType=TIMESTAMP},
  218. </if>
  219. <if test="record.openTime != null">
  220. open_time = #{record.openTime,jdbcType=TIMESTAMP},
  221. </if>
  222. <if test="record.timeCost != null">
  223. time_cost = #{record.timeCost,jdbcType=INTEGER},
  224. </if>
  225. <if test="record.equipmentNo != null">
  226. equipment_no = #{record.equipmentNo,jdbcType=VARCHAR},
  227. </if>
  228. <if test="record.isTrue != null">
  229. is_true = #{record.isTrue,jdbcType=INTEGER},
  230. </if>
  231. </set>
  232. <if test="_parameter != null">
  233. <include refid="Update_By_Example_Where_Clause" />
  234. </if>
  235. </update>
  236. <update id="updateByExample" parameterType="map">
  237. <!--
  238. WARNING - @mbg.generated
  239. This element is automatically generated by MyBatis Generator, do not modify.
  240. This element was generated on Fri Mar 20 18:04:50 CST 2020.
  241. -->
  242. update mould_history_time
  243. set history_id = #{record.historyId,jdbcType=BIGINT},
  244. seq = #{record.seq,jdbcType=INTEGER},
  245. close_time = #{record.closeTime,jdbcType=TIMESTAMP},
  246. open_time = #{record.openTime,jdbcType=TIMESTAMP},
  247. time_cost = #{record.timeCost,jdbcType=INTEGER},
  248. equipment_no = #{record.equipmentNo,jdbcType=VARCHAR},
  249. is_true = #{record.isTrue,jdbcType=INTEGER}
  250. <if test="_parameter != null">
  251. <include refid="Update_By_Example_Where_Clause" />
  252. </if>
  253. </update>
  254. <select id="selectByEquipmentNoAndThanZero" resultMap="BaseResultMap">
  255. select history_id, seq, close_time, open_time, time_cost, equipment_no
  256. from mould_history_time where equipment_no = #{equipmentNo} and time_cost &gt; 0
  257. </select>
  258. <select id="getDateByHistory" resultMap="BaseResultMap">
  259. select history_id, seq, close_time, open_time, time_cost, equipment_no
  260. from mould_history_time where history_id = #{id}
  261. </select>
  262. </mapper>