DilCapacityTimesMapper.xml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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.steerinfo.dil.mapper.DilCapacityTimesMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.DilCapacityTimes">
  5. <id column="TIMES_ID" jdbcType="DECIMAL" property="timesId" />
  6. <result column="TIMES_VALUE" jdbcType="TIMESTAMP" property="timesValue" />
  7. <result column="TIMES_TYPE" jdbcType="DECIMAL" property="timesType" />
  8. <result column="TIMES_REMARK" jdbcType="VARCHAR" property="timesRemark" />
  9. <result column="TIMES_CAPACITY_NUMBER" jdbcType="VARCHAR" property="timesCapacityNumber" />
  10. </resultMap>
  11. <sql id="columns">
  12. TIMES_ID, TIMES_VALUE, TIMES_TYPE, TIMES_REMARK, TIMES_CAPACITY_NUMBER
  13. </sql>
  14. <sql id="columns_alias">
  15. t.TIMES_ID, t.TIMES_VALUE, t.TIMES_TYPE, t.TIMES_REMARK, t.TIMES_CAPACITY_NUMBER
  16. </sql>
  17. <sql id="select">
  18. SELECT <include refid="columns"/> FROM DIL_CAPACITY_TIMES
  19. </sql>
  20. <sql id="select_alias">
  21. SELECT <include refid="columns_alias"/> FROM DIL_CAPACITY_TIMES t
  22. </sql>
  23. <sql id="where">
  24. <where>
  25. <if test="timesId != null">
  26. and TIMES_ID = #{timesId}
  27. </if>
  28. <if test="timesValue != null">
  29. and TO_CHAR(TIMES_VALUE,'yyyy-MM-dd') = #{timesValue}
  30. </if>
  31. <if test="timesType != null">
  32. and TIMES_TYPE = #{timesType}
  33. </if>
  34. <if test="timesRemark != null and timesRemark != ''">
  35. and TIMES_REMARK = #{timesRemark}
  36. </if>
  37. <if test="timesCapacityNumber != null and timesCapacityNumber != ''">
  38. and TIMES_CAPACITY_NUMBER = #{timesCapacityNumber}
  39. </if>
  40. </where>
  41. </sql>
  42. <sql id="whereLike">
  43. <where>
  44. <if test="timesId != null">
  45. and TIMES_ID = #{timesId}
  46. </if>
  47. <if test="timesValue != null">
  48. and TO_CHAR(TIMES_VALUE,'yyyy-MM-dd') = #{timesValue}
  49. </if>
  50. <if test="timesType != null">
  51. and TIMES_TYPE = #{timesType}
  52. </if>
  53. <if test="timesRemark != null and timesRemark != ''">
  54. and TIMES_REMARK LIKE '%${timesRemark}%'
  55. </if>
  56. <if test="timesCapacityNumber != null and timesCapacityNumber != ''">
  57. and TIMES_CAPACITY_NUMBER LIKE '%${timesCapacityNumber}%'
  58. </if>
  59. </where>
  60. </sql>
  61. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  62. delete from DIL_CAPACITY_TIMES
  63. where TIMES_ID = #{timesId,jdbcType=DECIMAL}
  64. </delete>
  65. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  66. delete from DIL_CAPACITY_TIMES
  67. where 1!=1
  68. <if test="timesValue != null">
  69. or TO_CHAR(TIMES_VALUE,'yyyy-MM-dd') = '#{timesValue}'
  70. </if>
  71. <if test="timesType != null">
  72. or TIMES_TYPE = #{timesType}
  73. </if>
  74. <if test="timesRemark != null and timesRemark != ''">
  75. or TIMES_REMARK = #{timesRemark}
  76. </if>
  77. <if test="timesCapacityNumber != null and timesCapacityNumber != ''">
  78. or TIMES_CAPACITY_NUMBER = #{timesCapacityNumber}
  79. </if>
  80. </delete>
  81. <insert id="insert" parameterType="com.steerinfo.dil.model.DilCapacityTimes">
  82. insert into DIL_CAPACITY_TIMES (TIMES_ID, TIMES_VALUE, TIMES_TYPE,
  83. TIMES_REMARK, TIMES_CAPACITY_NUMBER)
  84. values (#{timesId,jdbcType=DECIMAL}, #{timesValue,jdbcType=TIMESTAMP}, #{timesType,jdbcType=DECIMAL},
  85. #{timesRemark,jdbcType=VARCHAR}, #{timesCapacityNumber,jdbcType=VARCHAR})
  86. </insert>
  87. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.DilCapacityTimes">
  88. insert into DIL_CAPACITY_TIMES
  89. <trim prefix="(" suffix=")" suffixOverrides=",">
  90. <if test="timesId != null">
  91. TIMES_ID,
  92. </if>
  93. <if test="timesValue != null">
  94. TIMES_VALUE,
  95. </if>
  96. <if test="timesType != null">
  97. TIMES_TYPE,
  98. </if>
  99. <if test="timesRemark != null">
  100. TIMES_REMARK,
  101. </if>
  102. <if test="timesCapacityNumber != null">
  103. TIMES_CAPACITY_NUMBER,
  104. </if>
  105. </trim>
  106. <trim prefix="values (" suffix=")" suffixOverrides=",">
  107. <if test="timesId != null">
  108. #{timesId,jdbcType=DECIMAL},
  109. </if>
  110. <if test="timesValue != null">
  111. #{timesValue,jdbcType=TIMESTAMP},
  112. </if>
  113. <if test="timesType != null">
  114. #{timesType,jdbcType=DECIMAL},
  115. </if>
  116. <if test="timesRemark != null">
  117. #{timesRemark,jdbcType=VARCHAR},
  118. </if>
  119. <if test="timesCapacityNumber != null">
  120. #{timesCapacityNumber,jdbcType=VARCHAR},
  121. </if>
  122. </trim>
  123. </insert>
  124. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.DilCapacityTimes">
  125. update DIL_CAPACITY_TIMES
  126. set TIMES_VALUE = #{timesValue,jdbcType=TIMESTAMP},
  127. TIMES_TYPE = #{timesType,jdbcType=DECIMAL},
  128. TIMES_REMARK = #{timesRemark,jdbcType=VARCHAR},
  129. TIMES_CAPACITY_NUMBER = #{timesCapacityNumber,jdbcType=VARCHAR}
  130. where TIMES_ID = #{timesId,jdbcType=DECIMAL}
  131. </update>
  132. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.DilCapacityTimes">
  133. update DIL_CAPACITY_TIMES
  134. <set>
  135. <if test="timesValue != null">
  136. TIMES_VALUE = #{timesValue,jdbcType=TIMESTAMP},
  137. </if>
  138. <if test="timesType != null">
  139. TIMES_TYPE = #{timesType,jdbcType=DECIMAL},
  140. </if>
  141. <if test="timesRemark != null">
  142. TIMES_REMARK = #{timesRemark,jdbcType=VARCHAR},
  143. </if>
  144. <if test="timesCapacityNumber != null">
  145. TIMES_CAPACITY_NUMBER = #{timesCapacityNumber,jdbcType=VARCHAR},
  146. </if>
  147. </set>
  148. where TIMES_ID = #{timesId,jdbcType=DECIMAL}
  149. </update>
  150. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  151. <include refid="select"/>
  152. where TIMES_ID = #{timesId,jdbcType=DECIMAL}
  153. </select>
  154. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  155. <include refid="select"/>
  156. <include refid="where"/>
  157. </select>
  158. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  159. <include refid="select"/>
  160. <include refid="whereLike"/>
  161. </select>
  162. <insert id="batchInsert" parameterType="java.util.List">
  163. insert into DIL_CAPACITY_TIMES
  164. (TIMES_ID,
  165. TIMES_VALUE, TIMES_TYPE, TIMES_REMARK,
  166. TIMES_CAPACITY_NUMBER)
  167. ( <foreach collection="list" item="item" separator="union all">
  168. select
  169. #{item.timesId,jdbcType=DECIMAL},
  170. #{item.timesValue,jdbcType=TIMESTAMP}, #{item.timesType,jdbcType=DECIMAL}, #{item.timesRemark,jdbcType=VARCHAR},
  171. #{item.timesCapacityNumber,jdbcType=VARCHAR} from dual
  172. </foreach> )
  173. </insert>
  174. <update id="batchUpdate" parameterType="java.util.List">
  175. update DIL_CAPACITY_TIMES
  176. set
  177. TIMES_ID=
  178. <foreach collection="list" item="item" index="index" separator=" " open="case TIMES_ID" close="end">
  179. when #{item.timesId,jdbcType=DECIMAL} then #{item.timesId,jdbcType=DECIMAL}
  180. </foreach>
  181. ,TIMES_VALUE=
  182. <foreach collection="list" item="item" index="index" separator=" " open="case TIMES_ID" close="end">
  183. when #{item.timesId,jdbcType=DECIMAL} then #{item.timesValue,jdbcType=TIMESTAMP}
  184. </foreach>
  185. ,TIMES_TYPE=
  186. <foreach collection="list" item="item" index="index" separator=" " open="case TIMES_ID" close="end">
  187. when #{item.timesId,jdbcType=DECIMAL} then #{item.timesType,jdbcType=DECIMAL}
  188. </foreach>
  189. ,TIMES_REMARK=
  190. <foreach collection="list" item="item" index="index" separator=" " open="case TIMES_ID" close="end">
  191. when #{item.timesId,jdbcType=DECIMAL} then #{item.timesRemark,jdbcType=VARCHAR}
  192. </foreach>
  193. ,TIMES_CAPACITY_NUMBER=
  194. <foreach collection="list" item="item" index="index" separator=" " open="case TIMES_ID" close="end">
  195. when #{item.timesId,jdbcType=DECIMAL} then #{item.timesCapacityNumber,jdbcType=VARCHAR}
  196. </foreach>
  197. where TIMES_ID in
  198. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  199. #{item.timesId,jdbcType=DECIMAL}
  200. </foreach>
  201. </update>
  202. <delete id="batchDelete" parameterType="java.util.List">
  203. delete from DIL_CAPACITY_TIMES
  204. where TIMES_ID in
  205. <foreach collection="list" item="id" open="(" close=")" separator=",">
  206. #{id}
  207. </foreach>
  208. </delete>
  209. <!-- 友情提示!!!-->
  210. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  211. </mapper>