DilCidCapacityMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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.DilCidCapacityMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.DilCidCapacity">
  5. <id column="CID_CAPACITY_ID" jdbcType="DECIMAL" property="cidCapacityId"/>
  6. <result column="CID" jdbcType="VARCHAR" property="cid"/>
  7. <result column="CAPACITY_NUMBER" jdbcType="VARCHAR" property="capacityNumber"/>
  8. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername"/>
  9. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime"/>
  10. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername"/>
  11. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/>
  12. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark"/>
  13. </resultMap>
  14. <sql id="columns">
  15. CID_CAPACITY_ID, CID, CAPACITY_NUMBER, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  16. UPDATE_TIME, INSERT_UPDATE_REMARK
  17. </sql>
  18. <sql id="columns_alias">
  19. t.CID_CAPACITY_ID, t.CID, t.CAPACITY_NUMBER, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME,
  20. t.UPDATE_TIME, t.INSERT_UPDATE_REMARK
  21. </sql>
  22. <sql id="select">
  23. SELECT
  24. <include refid="columns"/>
  25. FROM DIL_CID_CAPACITY
  26. </sql>
  27. <sql id="select_alias">
  28. SELECT
  29. <include refid="columns_alias"/>
  30. FROM DIL_CID_CAPACITY t
  31. </sql>
  32. <sql id="where">
  33. <where>
  34. <if test="cidCapacityId != null">
  35. and CID_CAPACITY_ID = #{cidCapacityId}
  36. </if>
  37. <if test="cid != null and cid != ''">
  38. and CID = #{cid}
  39. </if>
  40. <if test="capacityNumber != null and capacityNumber != ''">
  41. and CAPACITY_NUMBER = #{capacityNumber}
  42. </if>
  43. <if test="insertUsername != null and insertUsername != ''">
  44. and INSERT_USERNAME = #{insertUsername}
  45. </if>
  46. <if test="insertTime != null">
  47. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  48. </if>
  49. <if test="updateUsername != null and updateUsername != ''">
  50. and UPDATE_USERNAME = #{updateUsername}
  51. </if>
  52. <if test="updateTime != null">
  53. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  54. </if>
  55. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  56. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  57. </if>
  58. </where>
  59. </sql>
  60. <sql id="whereLike">
  61. <where>
  62. <if test="cidCapacityId != null">
  63. and CID_CAPACITY_ID = #{cidCapacityId}
  64. </if>
  65. <if test="cid != null and cid != ''">
  66. and CID LIKE '%${cid}%'
  67. </if>
  68. <if test="capacityNumber != null and capacityNumber != ''">
  69. and CAPACITY_NUMBER LIKE '%${capacityNumber}%'
  70. </if>
  71. <if test="insertUsername != null and insertUsername != ''">
  72. and INSERT_USERNAME LIKE '%${insertUsername}%'
  73. </if>
  74. <if test="insertTime != null">
  75. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  76. </if>
  77. <if test="updateUsername != null and updateUsername != ''">
  78. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  79. </if>
  80. <if test="updateTime != null">
  81. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  82. </if>
  83. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  84. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  85. </if>
  86. </where>
  87. </sql>
  88. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  89. delete from DIL_CID_CAPACITY
  90. where CID_CAPACITY_ID = #{cidCapacityId,jdbcType=DECIMAL}
  91. </delete>
  92. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  93. delete from DIL_CID_CAPACITY
  94. where 1!=1
  95. <if test="cid != null and cid != ''">
  96. or CID = #{cid}
  97. </if>
  98. <if test="capacityNumber != null and capacityNumber != ''">
  99. or CAPACITY_NUMBER = #{capacityNumber}
  100. </if>
  101. <if test="insertUsername != null and insertUsername != ''">
  102. or INSERT_USERNAME = #{insertUsername}
  103. </if>
  104. <if test="insertTime != null">
  105. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  106. </if>
  107. <if test="updateUsername != null and updateUsername != ''">
  108. or UPDATE_USERNAME = #{updateUsername}
  109. </if>
  110. <if test="updateTime != null">
  111. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  112. </if>
  113. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  114. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  115. </if>
  116. </delete>
  117. <insert id="insert" parameterType="com.steerinfo.dil.model.DilCidCapacity">
  118. insert into DIL_CID_CAPACITY (CID_CAPACITY_ID, CID, CAPACITY_NUMBER,
  119. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  120. UPDATE_TIME, INSERT_UPDATE_REMARK)
  121. values (#{cidCapacityId,jdbcType=DECIMAL}, #{cid,jdbcType=VARCHAR}, #{capacityNumber,jdbcType=VARCHAR},
  122. #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
  123. #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR})
  124. </insert>
  125. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.DilCidCapacity">
  126. insert into DIL_CID_CAPACITY
  127. <trim prefix="(" suffix=")" suffixOverrides=",">
  128. <if test="cidCapacityId != null">
  129. CID_CAPACITY_ID,
  130. </if>
  131. <if test="cid != null">
  132. CID,
  133. </if>
  134. <if test="capacityNumber != null">
  135. CAPACITY_NUMBER,
  136. </if>
  137. <if test="insertUsername != null">
  138. INSERT_USERNAME,
  139. </if>
  140. <if test="insertTime != null">
  141. INSERT_TIME,
  142. </if>
  143. <if test="updateUsername != null">
  144. UPDATE_USERNAME,
  145. </if>
  146. <if test="updateTime != null">
  147. UPDATE_TIME,
  148. </if>
  149. <if test="insertUpdateRemark != null">
  150. INSERT_UPDATE_REMARK,
  151. </if>
  152. </trim>
  153. <trim prefix="values (" suffix=")" suffixOverrides=",">
  154. <if test="cidCapacityId != null">
  155. #{cidCapacityId,jdbcType=DECIMAL},
  156. </if>
  157. <if test="cid != null">
  158. #{cid,jdbcType=VARCHAR},
  159. </if>
  160. <if test="capacityNumber != null">
  161. #{capacityNumber,jdbcType=VARCHAR},
  162. </if>
  163. <if test="insertUsername != null">
  164. #{insertUsername,jdbcType=VARCHAR},
  165. </if>
  166. <if test="insertTime != null">
  167. #{insertTime,jdbcType=TIMESTAMP},
  168. </if>
  169. <if test="updateUsername != null">
  170. #{updateUsername,jdbcType=VARCHAR},
  171. </if>
  172. <if test="updateTime != null">
  173. #{updateTime,jdbcType=TIMESTAMP},
  174. </if>
  175. <if test="insertUpdateRemark != null">
  176. #{insertUpdateRemark,jdbcType=VARCHAR},
  177. </if>
  178. </trim>
  179. </insert>
  180. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.DilCidCapacity">
  181. update DIL_CID_CAPACITY
  182. set CID = #{cid,jdbcType=VARCHAR},
  183. CAPACITY_NUMBER = #{capacityNumber,jdbcType=VARCHAR},
  184. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  185. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  186. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  187. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  188. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR}
  189. where CID_CAPACITY_ID = #{cidCapacityId,jdbcType=DECIMAL}
  190. </update>
  191. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.DilCidCapacity">
  192. update DIL_CID_CAPACITY
  193. <set>
  194. <if test="cid != null">
  195. CID = #{cid,jdbcType=VARCHAR},
  196. </if>
  197. <if test="capacityNumber != null">
  198. CAPACITY_NUMBER = #{capacityNumber,jdbcType=VARCHAR},
  199. </if>
  200. <if test="insertUsername != null">
  201. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  202. </if>
  203. <if test="insertTime != null">
  204. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  205. </if>
  206. <if test="updateUsername != null">
  207. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  208. </if>
  209. <if test="updateTime != null">
  210. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  211. </if>
  212. <if test="insertUpdateRemark != null">
  213. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  214. </if>
  215. </set>
  216. where CID_CAPACITY_ID = #{cidCapacityId,jdbcType=DECIMAL}
  217. </update>
  218. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  219. <include refid="select"/>
  220. where CID_CAPACITY_ID = #{cidCapacityId,jdbcType=DECIMAL}
  221. </select>
  222. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  223. <include refid="select"/>
  224. <include refid="where"/>
  225. </select>
  226. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  227. <include refid="select"/>
  228. <include refid="whereLike"/>
  229. </select>
  230. <insert id="batchInsert" parameterType="java.util.List">
  231. insert into DIL_CID_CAPACITY
  232. (CID_CAPACITY_ID,
  233. CID, CAPACITY_NUMBER, INSERT_USERNAME,
  234. INSERT_TIME, UPDATE_USERNAME,
  235. UPDATE_TIME, INSERT_UPDATE_REMARK
  236. )
  237. ( <foreach collection="list" item="item" separator="union all">
  238. select
  239. #{item.cidCapacityId,jdbcType=DECIMAL},
  240. #{item.cid,jdbcType=VARCHAR}, #{item.capacityNumber,jdbcType=VARCHAR}, #{item.insertUsername,jdbcType=VARCHAR},
  241. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  242. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR}
  243. from dual
  244. </foreach> )
  245. </insert>
  246. <update id="batchUpdate" parameterType="java.util.List">
  247. update DIL_CID_CAPACITY
  248. set
  249. CID_CAPACITY_ID=
  250. <foreach collection="list" item="item" index="index" separator=" " open="case CID_CAPACITY_ID" close="end">
  251. when #{item.cidCapacityId,jdbcType=DECIMAL} then #{item.cidCapacityId,jdbcType=DECIMAL}
  252. </foreach>
  253. ,CID=
  254. <foreach collection="list" item="item" index="index" separator=" " open="case CID_CAPACITY_ID" close="end">
  255. when #{item.cidCapacityId,jdbcType=DECIMAL} then #{item.cid,jdbcType=VARCHAR}
  256. </foreach>
  257. ,CAPACITY_NUMBER=
  258. <foreach collection="list" item="item" index="index" separator=" " open="case CID_CAPACITY_ID" close="end">
  259. when #{item.cidCapacityId,jdbcType=DECIMAL} then #{item.capacityNumber,jdbcType=VARCHAR}
  260. </foreach>
  261. ,INSERT_USERNAME=
  262. <foreach collection="list" item="item" index="index" separator=" " open="case CID_CAPACITY_ID" close="end">
  263. when #{item.cidCapacityId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  264. </foreach>
  265. ,INSERT_TIME=
  266. <foreach collection="list" item="item" index="index" separator=" " open="case CID_CAPACITY_ID" close="end">
  267. when #{item.cidCapacityId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  268. </foreach>
  269. ,UPDATE_USERNAME=
  270. <foreach collection="list" item="item" index="index" separator=" " open="case CID_CAPACITY_ID" close="end">
  271. when #{item.cidCapacityId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  272. </foreach>
  273. ,UPDATE_TIME=
  274. <foreach collection="list" item="item" index="index" separator=" " open="case CID_CAPACITY_ID" close="end">
  275. when #{item.cidCapacityId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  276. </foreach>
  277. ,INSERT_UPDATE_REMARK=
  278. <foreach collection="list" item="item" index="index" separator=" " open="case CID_CAPACITY_ID" close="end">
  279. when #{item.cidCapacityId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  280. </foreach>
  281. where CID_CAPACITY_ID in
  282. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  283. #{item.cidCapacityId,jdbcType=DECIMAL}
  284. </foreach>
  285. </update>
  286. <delete id="batchDelete" parameterType="java.util.List">
  287. delete from DIL_CID_CAPACITY
  288. where CID_CAPACITY_ID in
  289. <foreach collection="list" item="id" open="(" close=")" separator=",">
  290. #{id}
  291. </foreach>
  292. </delete>
  293. <!-- 友情提示!!!-->
  294. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  295. <select id="selectByCidAndCapacityNo" resultType="java.lang.Integer" parameterType="string">
  296. select count(DCC.CAPACITY_NUMBER) from DIL_CID_CAPACITY DCC
  297. WHERE DCC.CAPACITY_NUMBER = #{capacityNo}
  298. AND DCC.CID = #{cid}
  299. </select>
  300. </mapper>