TmstrainLoadingTempMapper.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  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.TmstrainLoadingTempMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstrainLoadingTemp">
  5. <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
  6. <result column="RESULT_WAGON_NO" jdbcType="VARCHAR" property="resultWagonNo" />
  7. <result column="RESULT_BILLABLE_TONNAGE" jdbcType="DECIMAL" property="resultBillableTonnage" />
  8. <result column="MATERIAL_NAME" jdbcType="VARCHAR" property="materialName" />
  9. <result column="SEND_STATION" jdbcType="VARCHAR" property="sendStation" />
  10. <result column="ARRIVAL_STATION" jdbcType="VARCHAR" property="arrivalStation" />
  11. <result column="SUPPLIER_NAME" jdbcType="VARCHAR" property="supplierName" />
  12. <result column="SEND_DATE" jdbcType="VARCHAR" property="sendDate" />
  13. <result column="MAKE_DATE" jdbcType="VARCHAR" property="makeDate" />
  14. <result column="MINERAL" jdbcType="VARCHAR" property="mineral" />
  15. <result column="PURCHASE_ORDER_NO" jdbcType="VARCHAR" property="purchaseOrderNo" />
  16. </resultMap>
  17. <sql id="columns">
  18. RESULT_ID, RESULT_WAGON_NO, RESULT_BILLABLE_TONNAGE, MATERIAL_NAME, SEND_STATION,
  19. ARRIVAL_STATION, SUPPLIER_NAME, SEND_DATE, MAKE_DATE, MINERAL, PURCHASE_ORDER_NO
  20. </sql>
  21. <sql id="columns_alias">
  22. t.RESULT_ID, t.RESULT_WAGON_NO, t.RESULT_BILLABLE_TONNAGE, t.MATERIAL_NAME, t.SEND_STATION,
  23. t.ARRIVAL_STATION, t.SUPPLIER_NAME, t.SEND_DATE, t.MAKE_DATE, t.MINERAL, t.PURCHASE_ORDER_NO
  24. </sql>
  25. <sql id="select">
  26. SELECT <include refid="columns" /> FROM TMSTRAIN_LOADING_TEMP
  27. </sql>
  28. <sql id="select_alias">
  29. SELECT <include refid="columns_alias" /> FROM TMSTRAIN_LOADING_TEMP t
  30. </sql>
  31. <sql id="where">
  32. <where>
  33. <if test="resultId != null">
  34. and RESULT_ID = #{resultId}
  35. </if>
  36. <if test="resultWagonNo != null and resultWagonNo != ''">
  37. and RESULT_WAGON_NO = #{resultWagonNo}
  38. </if>
  39. <if test="resultBillableTonnage != null">
  40. and RESULT_BILLABLE_TONNAGE = #{resultBillableTonnage}
  41. </if>
  42. <if test="materialName != null and materialName != ''">
  43. and MATERIAL_NAME = #{materialName}
  44. </if>
  45. <if test="sendStation != null and sendStation != ''">
  46. and SEND_STATION = #{sendStation}
  47. </if>
  48. <if test="arrivalStation != null and arrivalStation != ''">
  49. and ARRIVAL_STATION = #{arrivalStation}
  50. </if>
  51. <if test="supplierName != null and supplierName != ''">
  52. and SUPPLIER_NAME = #{supplierName}
  53. </if>
  54. <if test="sendDate != null and sendDate != ''">
  55. and SEND_DATE = #{sendDate}
  56. </if>
  57. <if test="makeDate != null and makeDate != ''">
  58. and MAKE_DATE = #{makeDate}
  59. </if>
  60. <if test="mineral != null and mineral != ''">
  61. and MINERAL = #{mineral}
  62. </if>
  63. <if test="purchaseOrderNo != null and purchaseOrderNo != ''">
  64. and PURCHASE_ORDER_NO = #{purchaseOrderNo}
  65. </if>
  66. </where>
  67. </sql>
  68. <sql id="whereLike">
  69. <where>
  70. <if test="resultId != null">
  71. and RESULT_ID = #{resultId}
  72. </if>
  73. <if test="resultWagonNo != null and resultWagonNo != ''">
  74. and RESULT_WAGON_NO LIKE '%${resultWagonNo}%'
  75. </if>
  76. <if test="resultBillableTonnage != null">
  77. and RESULT_BILLABLE_TONNAGE = #{resultBillableTonnage}
  78. </if>
  79. <if test="materialName != null and materialName != ''">
  80. and MATERIAL_NAME LIKE '%${materialName}%'
  81. </if>
  82. <if test="sendStation != null and sendStation != ''">
  83. and SEND_STATION LIKE '%${sendStation}%'
  84. </if>
  85. <if test="arrivalStation != null and arrivalStation != ''">
  86. and ARRIVAL_STATION LIKE '%${arrivalStation}%'
  87. </if>
  88. <if test="supplierName != null and supplierName != ''">
  89. and SUPPLIER_NAME LIKE '%${supplierName}%'
  90. </if>
  91. <if test="sendDate != null and sendDate != ''">
  92. and SEND_DATE LIKE '%${sendDate}%'
  93. </if>
  94. <if test="makeDate != null and makeDate != ''">
  95. and MAKE_DATE LIKE '%${makeDate}%'
  96. </if>
  97. <if test="mineral != null and mineral != ''">
  98. and MINERAL LIKE '%${mineral}%'
  99. </if>
  100. <if test="purchaseOrderNo != null and purchaseOrderNo != ''">
  101. and PURCHASE_ORDER_NO LIKE '%${purchaseOrderNo}%'
  102. </if>
  103. </where>
  104. </sql>
  105. <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
  106. delete from TMSTRAIN_LOADING_TEMP
  107. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  108. </delete>
  109. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  110. delete from TMSTRAIN_LOADING_TEMP
  111. where 1!=1
  112. <if test="resultWagonNo != null and resultWagonNo != ''">
  113. or RESULT_WAGON_NO = #{resultWagonNo}
  114. </if>
  115. <if test="resultBillableTonnage != null">
  116. or RESULT_BILLABLE_TONNAGE = #{resultBillableTonnage}
  117. </if>
  118. <if test="materialName != null and materialName != ''">
  119. or MATERIAL_NAME = #{materialName}
  120. </if>
  121. <if test="sendStation != null and sendStation != ''">
  122. or SEND_STATION = #{sendStation}
  123. </if>
  124. <if test="arrivalStation != null and arrivalStation != ''">
  125. or ARRIVAL_STATION = #{arrivalStation}
  126. </if>
  127. <if test="supplierName != null and supplierName != ''">
  128. or SUPPLIER_NAME = #{supplierName}
  129. </if>
  130. <if test="sendDate != null and sendDate != ''">
  131. or SEND_DATE = #{sendDate}
  132. </if>
  133. <if test="makeDate != null and makeDate != ''">
  134. or MAKE_DATE = #{makeDate}
  135. </if>
  136. <if test="mineral != null and mineral != ''">
  137. or MINERAL = #{mineral}
  138. </if>
  139. <if test="purchaseOrderNo != null and purchaseOrderNo != ''">
  140. or PURCHASE_ORDER_NO = #{purchaseOrderNo}
  141. </if>
  142. </delete>
  143. <insert id="insert" parameterType="com.steerinfo.dil.model.TmstrainLoadingTemp">
  144. insert into TMSTRAIN_LOADING_TEMP (RESULT_ID, RESULT_WAGON_NO, RESULT_BILLABLE_TONNAGE,
  145. MATERIAL_NAME, SEND_STATION, ARRIVAL_STATION,
  146. SUPPLIER_NAME, SEND_DATE, MAKE_DATE,
  147. MINERAL, PURCHASE_ORDER_NO)
  148. values (#{resultId,jdbcType=DECIMAL}, #{resultWagonNo,jdbcType=VARCHAR}, #{resultBillableTonnage,jdbcType=DECIMAL},
  149. #{materialName,jdbcType=VARCHAR}, #{sendStation,jdbcType=VARCHAR}, #{arrivalStation,jdbcType=VARCHAR},
  150. #{supplierName,jdbcType=VARCHAR}, #{sendDate,jdbcType=VARCHAR}, #{makeDate,jdbcType=VARCHAR},
  151. #{mineral,jdbcType=VARCHAR}, #{purchaseOrderNo,jdbcType=VARCHAR})
  152. </insert>
  153. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstrainLoadingTemp">
  154. insert into TMSTRAIN_LOADING_TEMP
  155. <trim prefix="(" suffix=")" suffixOverrides=",">
  156. <if test="resultId != null">
  157. RESULT_ID,
  158. </if>
  159. <if test="resultWagonNo != null">
  160. RESULT_WAGON_NO,
  161. </if>
  162. <if test="resultBillableTonnage != null">
  163. RESULT_BILLABLE_TONNAGE,
  164. </if>
  165. <if test="materialName != null">
  166. MATERIAL_NAME,
  167. </if>
  168. <if test="sendStation != null">
  169. SEND_STATION,
  170. </if>
  171. <if test="arrivalStation != null">
  172. ARRIVAL_STATION,
  173. </if>
  174. <if test="supplierName != null">
  175. SUPPLIER_NAME,
  176. </if>
  177. <if test="sendDate != null">
  178. SEND_DATE,
  179. </if>
  180. <if test="makeDate != null">
  181. MAKE_DATE,
  182. </if>
  183. <if test="mineral != null">
  184. MINERAL,
  185. </if>
  186. <if test="purchaseOrderNo != null">
  187. PURCHASE_ORDER_NO,
  188. </if>
  189. </trim>
  190. <trim prefix="values (" suffix=")" suffixOverrides=",">
  191. <if test="resultId != null">
  192. #{resultId,jdbcType=DECIMAL},
  193. </if>
  194. <if test="resultWagonNo != null">
  195. #{resultWagonNo,jdbcType=VARCHAR},
  196. </if>
  197. <if test="resultBillableTonnage != null">
  198. #{resultBillableTonnage,jdbcType=DECIMAL},
  199. </if>
  200. <if test="materialName != null">
  201. #{materialName,jdbcType=VARCHAR},
  202. </if>
  203. <if test="sendStation != null">
  204. #{sendStation,jdbcType=VARCHAR},
  205. </if>
  206. <if test="arrivalStation != null">
  207. #{arrivalStation,jdbcType=VARCHAR},
  208. </if>
  209. <if test="supplierName != null">
  210. #{supplierName,jdbcType=VARCHAR},
  211. </if>
  212. <if test="sendDate != null">
  213. #{sendDate,jdbcType=VARCHAR},
  214. </if>
  215. <if test="makeDate != null">
  216. #{makeDate,jdbcType=VARCHAR},
  217. </if>
  218. <if test="mineral != null">
  219. #{mineral,jdbcType=VARCHAR},
  220. </if>
  221. <if test="purchaseOrderNo != null">
  222. #{purchaseOrderNo,jdbcType=VARCHAR},
  223. </if>
  224. </trim>
  225. </insert>
  226. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstrainLoadingTemp">
  227. update TMSTRAIN_LOADING_TEMP
  228. set RESULT_WAGON_NO = #{resultWagonNo,jdbcType=VARCHAR},
  229. RESULT_BILLABLE_TONNAGE = #{resultBillableTonnage,jdbcType=DECIMAL},
  230. MATERIAL_NAME = #{materialName,jdbcType=VARCHAR},
  231. SEND_STATION = #{sendStation,jdbcType=VARCHAR},
  232. ARRIVAL_STATION = #{arrivalStation,jdbcType=VARCHAR},
  233. SUPPLIER_NAME = #{supplierName,jdbcType=VARCHAR},
  234. SEND_DATE = #{sendDate,jdbcType=VARCHAR},
  235. MAKE_DATE = #{makeDate,jdbcType=VARCHAR},
  236. MINERAL = #{mineral,jdbcType=VARCHAR},
  237. PURCHASE_ORDER_NO = #{purchaseOrderNo,jdbcType=VARCHAR}
  238. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  239. </update>
  240. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstrainLoadingTemp">
  241. update TMSTRAIN_LOADING_TEMP
  242. <set>
  243. <if test="resultWagonNo != null">
  244. RESULT_WAGON_NO = #{resultWagonNo,jdbcType=VARCHAR},
  245. </if>
  246. <if test="resultBillableTonnage != null">
  247. RESULT_BILLABLE_TONNAGE = #{resultBillableTonnage,jdbcType=DECIMAL},
  248. </if>
  249. <if test="materialName != null">
  250. MATERIAL_NAME = #{materialName,jdbcType=VARCHAR},
  251. </if>
  252. <if test="sendStation != null">
  253. SEND_STATION = #{sendStation,jdbcType=VARCHAR},
  254. </if>
  255. <if test="arrivalStation != null">
  256. ARRIVAL_STATION = #{arrivalStation,jdbcType=VARCHAR},
  257. </if>
  258. <if test="supplierName != null">
  259. SUPPLIER_NAME = #{supplierName,jdbcType=VARCHAR},
  260. </if>
  261. <if test="sendDate != null">
  262. SEND_DATE = #{sendDate,jdbcType=VARCHAR},
  263. </if>
  264. <if test="makeDate != null">
  265. MAKE_DATE = #{makeDate,jdbcType=VARCHAR},
  266. </if>
  267. <if test="mineral != null">
  268. MINERAL = #{mineral,jdbcType=VARCHAR},
  269. </if>
  270. <if test="purchaseOrderNo != null">
  271. PURCHASE_ORDER_NO = #{purchaseOrderNo,jdbcType=VARCHAR},
  272. </if>
  273. </set>
  274. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  275. </update>
  276. <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
  277. <include refid="select" />
  278. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  279. </select>
  280. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  281. <include refid="select" />
  282. <include refid="where" />
  283. </select>
  284. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  285. <include refid="select" />
  286. <include refid="whereLike" />
  287. </select>
  288. <insert id="batchInsert" parameterType="java.util.List">
  289. insert into TMSTRAIN_LOADING_TEMP
  290. (RESULT_ID,
  291. RESULT_WAGON_NO, RESULT_BILLABLE_TONNAGE,
  292. MATERIAL_NAME, SEND_STATION, ARRIVAL_STATION,
  293. SUPPLIER_NAME, SEND_DATE, MAKE_DATE,
  294. MINERAL, PURCHASE_ORDER_NO)
  295. ( <foreach collection="list" item="item" separator="union all">
  296. select
  297. #{item.resultId,jdbcType=DECIMAL},
  298. #{item.resultWagonNo,jdbcType=VARCHAR}, #{item.resultBillableTonnage,jdbcType=DECIMAL},
  299. #{item.materialName,jdbcType=VARCHAR}, #{item.sendStation,jdbcType=VARCHAR}, #{item.arrivalStation,jdbcType=VARCHAR},
  300. #{item.supplierName,jdbcType=VARCHAR}, #{item.sendDate,jdbcType=VARCHAR}, #{item.makeDate,jdbcType=VARCHAR},
  301. #{item.mineral,jdbcType=VARCHAR}, #{item.purchaseOrderNo,jdbcType=VARCHAR} from dual
  302. </foreach> )
  303. </insert>
  304. <update id="batchUpdate" parameterType="java.util.List">
  305. update TMSTRAIN_LOADING_TEMP
  306. set
  307. RESULT_ID=
  308. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  309. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
  310. </foreach>
  311. ,RESULT_WAGON_NO=
  312. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  313. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultWagonNo,jdbcType=VARCHAR}
  314. </foreach>
  315. ,RESULT_BILLABLE_TONNAGE=
  316. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  317. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultBillableTonnage,jdbcType=DECIMAL}
  318. </foreach>
  319. ,MATERIAL_NAME=
  320. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  321. when #{item.resultId,jdbcType=DECIMAL} then #{item.materialName,jdbcType=VARCHAR}
  322. </foreach>
  323. ,SEND_STATION=
  324. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  325. when #{item.resultId,jdbcType=DECIMAL} then #{item.sendStation,jdbcType=VARCHAR}
  326. </foreach>
  327. ,ARRIVAL_STATION=
  328. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  329. when #{item.resultId,jdbcType=DECIMAL} then #{item.arrivalStation,jdbcType=VARCHAR}
  330. </foreach>
  331. ,SUPPLIER_NAME=
  332. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  333. when #{item.resultId,jdbcType=DECIMAL} then #{item.supplierName,jdbcType=VARCHAR}
  334. </foreach>
  335. ,SEND_DATE=
  336. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  337. when #{item.resultId,jdbcType=DECIMAL} then #{item.sendDate,jdbcType=VARCHAR}
  338. </foreach>
  339. ,MAKE_DATE=
  340. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  341. when #{item.resultId,jdbcType=DECIMAL} then #{item.makeDate,jdbcType=VARCHAR}
  342. </foreach>
  343. ,MINERAL=
  344. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  345. when #{item.resultId,jdbcType=DECIMAL} then #{item.mineral,jdbcType=VARCHAR}
  346. </foreach>
  347. ,PURCHASE_ORDER_NO=
  348. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  349. when #{item.resultId,jdbcType=DECIMAL} then #{item.purchaseOrderNo,jdbcType=VARCHAR}
  350. </foreach>
  351. where RESULT_ID in
  352. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  353. #{item.resultId,jdbcType=DECIMAL}
  354. </foreach>
  355. </update>
  356. <delete id="batchDelete" parameterType="java.util.List">
  357. delete from TMSTRAIN_LOADING_TEMP
  358. where RESULT_ID in
  359. <foreach close=")" collection="list" item="id" open="(" separator=",">
  360. #{id}
  361. </foreach>
  362. </delete>
  363. <!-- 友情提示!!!-->
  364. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  365. <select id="selectMaxId" resultType="java.math.BigDecimal">
  366. select seq_tmstrain_loading_temp.nextval from dual
  367. </select>
  368. </mapper>