AmsSaleMaterialMapper.xml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  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.AmsSaleMaterialMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.AmsSaleMaterial">
  5. <id column="SALE_MATERIAL_ID" jdbcType="DECIMAL" property="saleMaterialId" />
  6. <result column="SALE_ORDER_ID" jdbcType="DECIMAL" property="saleOrderId" />
  7. <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId" />
  8. <result column="MATERIAL_WEIGHT" jdbcType="DECIMAL" property="materialWeight" />
  9. <result column="MATERIAL_NUMBER" jdbcType="DECIMAL" property="materialNumber" />
  10. <result column="EAS_PRIMARY_ID" jdbcType="VARCHAR" property="easPrimaryId" />
  11. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  12. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  13. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  14. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  15. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  16. <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
  17. <result column="SALE_WAREHOUSE" jdbcType="VARCHAR" property="saleWarehouse" />
  18. <result column="STEEL_METER" jdbcType="DECIMAL" property="steelMeter" />
  19. <result column="IS_POUND_SALE" jdbcType="DECIMAL" property="isPoundSale" />
  20. <result column="METER_WEIGHT" jdbcType="DECIMAL" property="meterWeight" />
  21. </resultMap>
  22. <sql id="columns">
  23. SALE_MATERIAL_ID, SALE_ORDER_ID, MATERIAL_ID, MATERIAL_WEIGHT, MATERIAL_NUMBER, EAS_PRIMARY_ID,
  24. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  25. DELETED, SALE_WAREHOUSE, STEEL_METER, IS_POUND_SALE, METER_WEIGHT
  26. </sql>
  27. <sql id="columns_alias">
  28. t.SALE_MATERIAL_ID, t.SALE_ORDER_ID, t.MATERIAL_ID, t.MATERIAL_WEIGHT, t.MATERIAL_NUMBER,
  29. t.EAS_PRIMARY_ID, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME,
  30. t.INSERT_UPDATE_REMARK, t.DELETED, t.SALE_WAREHOUSE, t.STEEL_METER, t.IS_POUND_SALE,
  31. t.METER_WEIGHT
  32. </sql>
  33. <sql id="select">
  34. SELECT <include refid="columns" /> FROM AMS_SALE_MATERIAL
  35. </sql>
  36. <sql id="select_alias">
  37. SELECT <include refid="columns_alias" /> FROM AMS_SALE_MATERIAL t
  38. </sql>
  39. <sql id="where">
  40. <where>
  41. <if test="saleMaterialId != null">
  42. and SALE_MATERIAL_ID = #{saleMaterialId}
  43. </if>
  44. <if test="saleOrderId != null">
  45. and SALE_ORDER_ID = #{saleOrderId}
  46. </if>
  47. <if test="materialId != null">
  48. and MATERIAL_ID = #{materialId}
  49. </if>
  50. <if test="materialWeight != null">
  51. and MATERIAL_WEIGHT = #{materialWeight}
  52. </if>
  53. <if test="materialNumber != null">
  54. and MATERIAL_NUMBER = #{materialNumber}
  55. </if>
  56. <if test="easPrimaryId != null and easPrimaryId != ''">
  57. and EAS_PRIMARY_ID = #{easPrimaryId}
  58. </if>
  59. <if test="insertUsername != null and insertUsername != ''">
  60. and INSERT_USERNAME = #{insertUsername}
  61. </if>
  62. <if test="insertTime != null">
  63. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  64. </if>
  65. <if test="updateUsername != null and updateUsername != ''">
  66. and UPDATE_USERNAME = #{updateUsername}
  67. </if>
  68. <if test="updateTime != null">
  69. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  70. </if>
  71. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  72. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  73. </if>
  74. <if test="deleted != null">
  75. and DELETED = #{deleted}
  76. </if>
  77. <if test="saleWarehouse != null and saleWarehouse != ''">
  78. and SALE_WAREHOUSE = #{saleWarehouse}
  79. </if>
  80. <if test="steelMeter != null">
  81. and STEEL_METER = #{steelMeter}
  82. </if>
  83. <if test="isPoundSale != null">
  84. and IS_POUND_SALE = #{isPoundSale}
  85. </if>
  86. <if test="meterWeight != null">
  87. and METER_WEIGHT = #{meterWeight}
  88. </if>
  89. </where>
  90. </sql>
  91. <sql id="whereLike">
  92. <where>
  93. <if test="saleMaterialId != null">
  94. and SALE_MATERIAL_ID = #{saleMaterialId}
  95. </if>
  96. <if test="saleOrderId != null">
  97. and SALE_ORDER_ID = #{saleOrderId}
  98. </if>
  99. <if test="materialId != null">
  100. and MATERIAL_ID = #{materialId}
  101. </if>
  102. <if test="materialWeight != null">
  103. and MATERIAL_WEIGHT = #{materialWeight}
  104. </if>
  105. <if test="materialNumber != null">
  106. and MATERIAL_NUMBER = #{materialNumber}
  107. </if>
  108. <if test="easPrimaryId != null and easPrimaryId != ''">
  109. and EAS_PRIMARY_ID LIKE '%${easPrimaryId}%'
  110. </if>
  111. <if test="insertUsername != null and insertUsername != ''">
  112. and INSERT_USERNAME LIKE '%${insertUsername}%'
  113. </if>
  114. <if test="insertTime != null">
  115. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  116. </if>
  117. <if test="updateUsername != null and updateUsername != ''">
  118. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  119. </if>
  120. <if test="updateTime != null">
  121. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  122. </if>
  123. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  124. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  125. </if>
  126. <if test="deleted != null">
  127. and DELETED = #{deleted}
  128. </if>
  129. <if test="saleWarehouse != null and saleWarehouse != ''">
  130. and SALE_WAREHOUSE LIKE '%${saleWarehouse}%'
  131. </if>
  132. <if test="steelMeter != null">
  133. and STEEL_METER = #{steelMeter}
  134. </if>
  135. <if test="isPoundSale != null">
  136. and IS_POUND_SALE = #{isPoundSale}
  137. </if>
  138. <if test="meterWeight != null">
  139. and METER_WEIGHT = #{meterWeight}
  140. </if>
  141. </where>
  142. </sql>
  143. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  144. delete from AMS_SALE_MATERIAL
  145. where SALE_MATERIAL_ID = #{saleMaterialId,jdbcType=DECIMAL}
  146. </delete>
  147. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  148. delete from AMS_SALE_MATERIAL
  149. where 1!=1
  150. <if test="saleOrderId != null">
  151. or SALE_ORDER_ID = #{saleOrderId}
  152. </if>
  153. <if test="materialId != null">
  154. or MATERIAL_ID = #{materialId}
  155. </if>
  156. <if test="materialWeight != null">
  157. or MATERIAL_WEIGHT = #{materialWeight}
  158. </if>
  159. <if test="materialNumber != null">
  160. or MATERIAL_NUMBER = #{materialNumber}
  161. </if>
  162. <if test="easPrimaryId != null and easPrimaryId != ''">
  163. or EAS_PRIMARY_ID = #{easPrimaryId}
  164. </if>
  165. <if test="insertUsername != null and insertUsername != ''">
  166. or INSERT_USERNAME = #{insertUsername}
  167. </if>
  168. <if test="insertTime != null">
  169. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  170. </if>
  171. <if test="updateUsername != null and updateUsername != ''">
  172. or UPDATE_USERNAME = #{updateUsername}
  173. </if>
  174. <if test="updateTime != null">
  175. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  176. </if>
  177. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  178. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  179. </if>
  180. <if test="deleted != null">
  181. or DELETED = #{deleted}
  182. </if>
  183. <if test="saleWarehouse != null and saleWarehouse != ''">
  184. or SALE_WAREHOUSE = #{saleWarehouse}
  185. </if>
  186. <if test="steelMeter != null">
  187. or STEEL_METER = #{steelMeter}
  188. </if>
  189. <if test="isPoundSale != null">
  190. or IS_POUND_SALE = #{isPoundSale}
  191. </if>
  192. <if test="meterWeight != null">
  193. or METER_WEIGHT = #{meterWeight}
  194. </if>
  195. </delete>
  196. <insert id="insert" parameterType="com.steerinfo.dil.model.AmsSaleMaterial">
  197. insert into AMS_SALE_MATERIAL (SALE_MATERIAL_ID, SALE_ORDER_ID, MATERIAL_ID,
  198. MATERIAL_WEIGHT, MATERIAL_NUMBER, EAS_PRIMARY_ID,
  199. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
  200. UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED,
  201. SALE_WAREHOUSE, STEEL_METER, IS_POUND_SALE,
  202. METER_WEIGHT)
  203. values (#{saleMaterialId,jdbcType=DECIMAL}, #{saleOrderId,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL},
  204. #{materialWeight,jdbcType=DECIMAL}, #{materialNumber,jdbcType=DECIMAL}, #{easPrimaryId,jdbcType=VARCHAR},
  205. #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
  206. #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
  207. #{saleWarehouse,jdbcType=VARCHAR}, #{steelMeter,jdbcType=DECIMAL}, #{isPoundSale,jdbcType=DECIMAL},
  208. #{meterWeight,jdbcType=DECIMAL})
  209. </insert>
  210. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsSaleMaterial">
  211. insert into AMS_SALE_MATERIAL
  212. <trim prefix="(" suffix=")" suffixOverrides=",">
  213. <if test="saleMaterialId != null">
  214. SALE_MATERIAL_ID,
  215. </if>
  216. <if test="saleOrderId != null">
  217. SALE_ORDER_ID,
  218. </if>
  219. <if test="materialId != null">
  220. MATERIAL_ID,
  221. </if>
  222. <if test="materialWeight != null">
  223. MATERIAL_WEIGHT,
  224. </if>
  225. <if test="materialNumber != null">
  226. MATERIAL_NUMBER,
  227. </if>
  228. <if test="easPrimaryId != null">
  229. EAS_PRIMARY_ID,
  230. </if>
  231. <if test="insertUsername != null">
  232. INSERT_USERNAME,
  233. </if>
  234. <if test="insertTime != null">
  235. INSERT_TIME,
  236. </if>
  237. <if test="updateUsername != null">
  238. UPDATE_USERNAME,
  239. </if>
  240. <if test="updateTime != null">
  241. UPDATE_TIME,
  242. </if>
  243. <if test="insertUpdateRemark != null">
  244. INSERT_UPDATE_REMARK,
  245. </if>
  246. <if test="deleted != null">
  247. DELETED,
  248. </if>
  249. <if test="saleWarehouse != null">
  250. SALE_WAREHOUSE,
  251. </if>
  252. <if test="steelMeter != null">
  253. STEEL_METER,
  254. </if>
  255. <if test="isPoundSale != null">
  256. IS_POUND_SALE,
  257. </if>
  258. <if test="meterWeight != null">
  259. METER_WEIGHT,
  260. </if>
  261. </trim>
  262. <trim prefix="values (" suffix=")" suffixOverrides=",">
  263. <if test="saleMaterialId != null">
  264. #{saleMaterialId,jdbcType=DECIMAL},
  265. </if>
  266. <if test="saleOrderId != null">
  267. #{saleOrderId,jdbcType=DECIMAL},
  268. </if>
  269. <if test="materialId != null">
  270. #{materialId,jdbcType=DECIMAL},
  271. </if>
  272. <if test="materialWeight != null">
  273. #{materialWeight,jdbcType=DECIMAL},
  274. </if>
  275. <if test="materialNumber != null">
  276. #{materialNumber,jdbcType=DECIMAL},
  277. </if>
  278. <if test="easPrimaryId != null">
  279. #{easPrimaryId,jdbcType=VARCHAR},
  280. </if>
  281. <if test="insertUsername != null">
  282. #{insertUsername,jdbcType=VARCHAR},
  283. </if>
  284. <if test="insertTime != null">
  285. #{insertTime,jdbcType=TIMESTAMP},
  286. </if>
  287. <if test="updateUsername != null">
  288. #{updateUsername,jdbcType=VARCHAR},
  289. </if>
  290. <if test="updateTime != null">
  291. #{updateTime,jdbcType=TIMESTAMP},
  292. </if>
  293. <if test="insertUpdateRemark != null">
  294. #{insertUpdateRemark,jdbcType=VARCHAR},
  295. </if>
  296. <if test="deleted != null">
  297. #{deleted,jdbcType=DECIMAL},
  298. </if>
  299. <if test="saleWarehouse != null">
  300. #{saleWarehouse,jdbcType=VARCHAR},
  301. </if>
  302. <if test="steelMeter != null">
  303. #{steelMeter,jdbcType=DECIMAL},
  304. </if>
  305. <if test="isPoundSale != null">
  306. #{isPoundSale,jdbcType=DECIMAL},
  307. </if>
  308. <if test="meterWeight != null">
  309. #{meterWeight,jdbcType=DECIMAL},
  310. </if>
  311. </trim>
  312. </insert>
  313. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsSaleMaterial">
  314. update AMS_SALE_MATERIAL
  315. set SALE_ORDER_ID = #{saleOrderId,jdbcType=DECIMAL},
  316. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  317. MATERIAL_WEIGHT = #{materialWeight,jdbcType=DECIMAL},
  318. MATERIAL_NUMBER = #{materialNumber,jdbcType=DECIMAL},
  319. EAS_PRIMARY_ID = #{easPrimaryId,jdbcType=VARCHAR},
  320. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  321. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  322. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  323. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  324. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  325. DELETED = #{deleted,jdbcType=DECIMAL},
  326. SALE_WAREHOUSE = #{saleWarehouse,jdbcType=VARCHAR},
  327. STEEL_METER = #{steelMeter,jdbcType=DECIMAL},
  328. IS_POUND_SALE = #{isPoundSale,jdbcType=DECIMAL},
  329. METER_WEIGHT = #{meterWeight,jdbcType=DECIMAL}
  330. where SALE_MATERIAL_ID = #{saleMaterialId,jdbcType=DECIMAL}
  331. </update>
  332. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsSaleMaterial">
  333. update AMS_SALE_MATERIAL
  334. <set>
  335. <if test="saleOrderId != null">
  336. SALE_ORDER_ID = #{saleOrderId,jdbcType=DECIMAL},
  337. </if>
  338. <if test="materialId != null">
  339. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  340. </if>
  341. <if test="materialWeight != null">
  342. MATERIAL_WEIGHT = #{materialWeight,jdbcType=DECIMAL},
  343. </if>
  344. <if test="materialNumber != null">
  345. MATERIAL_NUMBER = #{materialNumber,jdbcType=DECIMAL},
  346. </if>
  347. <if test="easPrimaryId != null">
  348. EAS_PRIMARY_ID = #{easPrimaryId,jdbcType=VARCHAR},
  349. </if>
  350. <if test="insertUsername != null">
  351. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  352. </if>
  353. <if test="insertTime != null">
  354. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  355. </if>
  356. <if test="updateUsername != null">
  357. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  358. </if>
  359. <if test="updateTime != null">
  360. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  361. </if>
  362. <if test="insertUpdateRemark != null">
  363. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  364. </if>
  365. <if test="deleted != null">
  366. DELETED = #{deleted,jdbcType=DECIMAL},
  367. </if>
  368. <if test="saleWarehouse != null">
  369. SALE_WAREHOUSE = #{saleWarehouse,jdbcType=VARCHAR},
  370. </if>
  371. <if test="steelMeter != null">
  372. STEEL_METER = #{steelMeter,jdbcType=DECIMAL},
  373. </if>
  374. <if test="isPoundSale != null">
  375. IS_POUND_SALE = #{isPoundSale,jdbcType=DECIMAL},
  376. </if>
  377. <if test="meterWeight != null">
  378. METER_WEIGHT = #{meterWeight,jdbcType=DECIMAL},
  379. </if>
  380. </set>
  381. where SALE_MATERIAL_ID = #{saleMaterialId,jdbcType=DECIMAL}
  382. </update>
  383. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  384. <include refid="select" />
  385. where SALE_MATERIAL_ID = #{saleMaterialId,jdbcType=DECIMAL}
  386. </select>
  387. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  388. <include refid="select" />
  389. <include refid="where" />
  390. </select>
  391. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  392. <include refid="select" />
  393. <include refid="whereLike" />
  394. </select>
  395. <insert id="batchInsert" parameterType="java.util.List">
  396. insert into AMS_SALE_MATERIAL
  397. (SALE_MATERIAL_ID,
  398. SALE_ORDER_ID, MATERIAL_ID, MATERIAL_WEIGHT,
  399. MATERIAL_NUMBER, EAS_PRIMARY_ID,
  400. INSERT_USERNAME, INSERT_TIME,
  401. UPDATE_USERNAME, UPDATE_TIME,
  402. INSERT_UPDATE_REMARK, DELETED,
  403. SALE_WAREHOUSE, STEEL_METER, IS_POUND_SALE,
  404. METER_WEIGHT)
  405. ( <foreach collection="list" item="item" separator="union all">
  406. select
  407. #{item.saleMaterialId,jdbcType=DECIMAL},
  408. #{item.saleOrderId,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL}, #{item.materialWeight,jdbcType=DECIMAL},
  409. #{item.materialNumber,jdbcType=DECIMAL}, #{item.easPrimaryId,jdbcType=VARCHAR},
  410. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  411. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  412. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleted,jdbcType=DECIMAL},
  413. #{item.saleWarehouse,jdbcType=VARCHAR}, #{item.steelMeter,jdbcType=DECIMAL}, #{item.isPoundSale,jdbcType=DECIMAL},
  414. #{item.meterWeight,jdbcType=DECIMAL} from dual
  415. </foreach> )
  416. </insert>
  417. <update id="batchUpdate" parameterType="java.util.List">
  418. update AMS_SALE_MATERIAL
  419. set
  420. SALE_MATERIAL_ID=
  421. <foreach close="end" collection="list" index="index" item="item" open="case SALE_MATERIAL_ID" separator=" ">
  422. when #{item.saleMaterialId,jdbcType=DECIMAL} then #{item.saleMaterialId,jdbcType=DECIMAL}
  423. </foreach>
  424. ,SALE_ORDER_ID=
  425. <foreach close="end" collection="list" index="index" item="item" open="case SALE_MATERIAL_ID" separator=" ">
  426. when #{item.saleMaterialId,jdbcType=DECIMAL} then #{item.saleOrderId,jdbcType=DECIMAL}
  427. </foreach>
  428. ,MATERIAL_ID=
  429. <foreach close="end" collection="list" index="index" item="item" open="case SALE_MATERIAL_ID" separator=" ">
  430. when #{item.saleMaterialId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
  431. </foreach>
  432. ,MATERIAL_WEIGHT=
  433. <foreach close="end" collection="list" index="index" item="item" open="case SALE_MATERIAL_ID" separator=" ">
  434. when #{item.saleMaterialId,jdbcType=DECIMAL} then #{item.materialWeight,jdbcType=DECIMAL}
  435. </foreach>
  436. ,MATERIAL_NUMBER=
  437. <foreach close="end" collection="list" index="index" item="item" open="case SALE_MATERIAL_ID" separator=" ">
  438. when #{item.saleMaterialId,jdbcType=DECIMAL} then #{item.materialNumber,jdbcType=DECIMAL}
  439. </foreach>
  440. ,EAS_PRIMARY_ID=
  441. <foreach close="end" collection="list" index="index" item="item" open="case SALE_MATERIAL_ID" separator=" ">
  442. when #{item.saleMaterialId,jdbcType=DECIMAL} then #{item.easPrimaryId,jdbcType=VARCHAR}
  443. </foreach>
  444. ,INSERT_USERNAME=
  445. <foreach close="end" collection="list" index="index" item="item" open="case SALE_MATERIAL_ID" separator=" ">
  446. when #{item.saleMaterialId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  447. </foreach>
  448. ,INSERT_TIME=
  449. <foreach close="end" collection="list" index="index" item="item" open="case SALE_MATERIAL_ID" separator=" ">
  450. when #{item.saleMaterialId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  451. </foreach>
  452. ,UPDATE_USERNAME=
  453. <foreach close="end" collection="list" index="index" item="item" open="case SALE_MATERIAL_ID" separator=" ">
  454. when #{item.saleMaterialId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  455. </foreach>
  456. ,UPDATE_TIME=
  457. <foreach close="end" collection="list" index="index" item="item" open="case SALE_MATERIAL_ID" separator=" ">
  458. when #{item.saleMaterialId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  459. </foreach>
  460. ,INSERT_UPDATE_REMARK=
  461. <foreach close="end" collection="list" index="index" item="item" open="case SALE_MATERIAL_ID" separator=" ">
  462. when #{item.saleMaterialId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  463. </foreach>
  464. ,DELETED=
  465. <foreach close="end" collection="list" index="index" item="item" open="case SALE_MATERIAL_ID" separator=" ">
  466. when #{item.saleMaterialId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  467. </foreach>
  468. ,SALE_WAREHOUSE=
  469. <foreach close="end" collection="list" index="index" item="item" open="case SALE_MATERIAL_ID" separator=" ">
  470. when #{item.saleMaterialId,jdbcType=DECIMAL} then #{item.saleWarehouse,jdbcType=VARCHAR}
  471. </foreach>
  472. ,STEEL_METER=
  473. <foreach close="end" collection="list" index="index" item="item" open="case SALE_MATERIAL_ID" separator=" ">
  474. when #{item.saleMaterialId,jdbcType=DECIMAL} then #{item.steelMeter,jdbcType=DECIMAL}
  475. </foreach>
  476. ,IS_POUND_SALE=
  477. <foreach close="end" collection="list" index="index" item="item" open="case SALE_MATERIAL_ID" separator=" ">
  478. when #{item.saleMaterialId,jdbcType=DECIMAL} then #{item.isPoundSale,jdbcType=DECIMAL}
  479. </foreach>
  480. ,METER_WEIGHT=
  481. <foreach close="end" collection="list" index="index" item="item" open="case SALE_MATERIAL_ID" separator=" ">
  482. when #{item.saleMaterialId,jdbcType=DECIMAL} then #{item.meterWeight,jdbcType=DECIMAL}
  483. </foreach>
  484. where SALE_MATERIAL_ID in
  485. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  486. #{item.saleMaterialId,jdbcType=DECIMAL}
  487. </foreach>
  488. </update>
  489. <delete id="batchDelete" parameterType="java.util.List">
  490. delete from AMS_SALE_MATERIAL
  491. where SALE_MATERIAL_ID in
  492. <foreach close=")" collection="list" item="id" open="(" separator=",">
  493. #{id}
  494. </foreach>
  495. </delete>
  496. <!-- 友情提示!!!-->
  497. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  498. <select id="getMaterialCount" parameterType="DECIMAL" resultType="java.lang.Integer">
  499. SELECT RM.MATERIAL_COUNT AS "materialCount"
  500. FROM RMS_MATERIAL RM
  501. WHERE RM.MATERIAL_ID = #{materialId}
  502. </select>
  503. </mapper>