MouldHistoryTimeMapper.xml 9.5 KB

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