RmsLineMapper.xml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  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.RmsLineMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.RmsLine">
  5. <id column="LINE_ID" jdbcType="DECIMAL" property="lineId" />
  6. <result column="LINE_NO" jdbcType="VARCHAR" property="lineNo" />
  7. <result column="LINE_START_NODE_ID" jdbcType="DECIMAL" property="lineStartNodeId" />
  8. <result column="LINE_START_NODE_TYPE" jdbcType="DECIMAL" property="lineStartNodeType" />
  9. <result column="LINE_START_NODE_DESC" jdbcType="VARCHAR" property="lineStartNodeDesc" />
  10. <result column="LINE_PATH_LENGTH" jdbcType="DECIMAL" property="linePathLength" />
  11. <result column="LINE_END_NODE_ID" jdbcType="DECIMAL" property="lineEndNodeId" />
  12. <result column="LINE_END_NODE_TYPE" jdbcType="DECIMAL" property="lineEndNodeType" />
  13. <result column="LINE_END_NODE_DESC" jdbcType="VARCHAR" property="lineEndNodeDesc" />
  14. <result column="LINE_NAME" jdbcType="VARCHAR" property="lineName" />
  15. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  16. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  17. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  18. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  19. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  20. <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
  21. <result column="LINE_TYPE" jdbcType="DECIMAL" property="lineType" />
  22. <result column="SPELL_NUMBER" jdbcType="DECIMAL" property="spellNumber" />
  23. </resultMap>
  24. <sql id="columns">
  25. LINE_ID, LINE_NO, LINE_START_NODE_ID, LINE_START_NODE_TYPE, LINE_START_NODE_DESC,
  26. LINE_PATH_LENGTH, LINE_END_NODE_ID, LINE_END_NODE_TYPE, LINE_END_NODE_DESC, LINE_NAME,
  27. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  28. DELETED, LINE_TYPE, SPELL_NUMBER
  29. </sql>
  30. <sql id="columns_alias">
  31. t.LINE_ID, t.LINE_NO, t.LINE_START_NODE_ID, t.LINE_START_NODE_TYPE, t.LINE_START_NODE_DESC,
  32. t.LINE_PATH_LENGTH, t.LINE_END_NODE_ID, t.LINE_END_NODE_TYPE, t.LINE_END_NODE_DESC,
  33. t.LINE_NAME, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME,
  34. t.INSERT_UPDATE_REMARK, t.DELETED, t.LINE_TYPE, t.SPELL_NUMBER
  35. </sql>
  36. <sql id="select">
  37. SELECT <include refid="columns"/> FROM RMS_LINE
  38. </sql>
  39. <sql id="select_alias">
  40. SELECT <include refid="columns_alias"/> FROM RMS_LINE t
  41. </sql>
  42. <sql id="where">
  43. <where>
  44. <if test="lineId != null">
  45. and LINE_ID = #{lineId}
  46. </if>
  47. <if test="lineNo != null and lineNo != ''">
  48. and LINE_NO = #{lineNo}
  49. </if>
  50. <if test="lineStartNodeId != null">
  51. and LINE_START_NODE_ID = #{lineStartNodeId}
  52. </if>
  53. <if test="lineStartNodeType != null">
  54. and LINE_START_NODE_TYPE = #{lineStartNodeType}
  55. </if>
  56. <if test="lineStartNodeDesc != null and lineStartNodeDesc != ''">
  57. and LINE_START_NODE_DESC = #{lineStartNodeDesc}
  58. </if>
  59. <if test="linePathLength != null">
  60. and LINE_PATH_LENGTH = #{linePathLength}
  61. </if>
  62. <if test="lineEndNodeId != null">
  63. and LINE_END_NODE_ID = #{lineEndNodeId}
  64. </if>
  65. <if test="lineEndNodeType != null">
  66. and LINE_END_NODE_TYPE = #{lineEndNodeType}
  67. </if>
  68. <if test="lineEndNodeDesc != null and lineEndNodeDesc != ''">
  69. and LINE_END_NODE_DESC = #{lineEndNodeDesc}
  70. </if>
  71. <if test="lineName != null and lineName != ''">
  72. and LINE_NAME = #{lineName}
  73. </if>
  74. <if test="insertUsername != null and insertUsername != ''">
  75. and INSERT_USERNAME = #{insertUsername}
  76. </if>
  77. <if test="insertTime != null">
  78. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  79. </if>
  80. <if test="updateUsername != null and updateUsername != ''">
  81. and UPDATE_USERNAME = #{updateUsername}
  82. </if>
  83. <if test="updateTime != null">
  84. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  85. </if>
  86. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  87. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  88. </if>
  89. <if test="deleted != null">
  90. and DELETED = #{deleted}
  91. </if>
  92. <if test="lineType != null">
  93. and LINE_TYPE = #{lineType}
  94. </if>
  95. <if test="spellNumber != null">
  96. and SPELL_NUMBER = #{spellNumber}
  97. </if>
  98. </where>
  99. </sql>
  100. <sql id="whereLike">
  101. <where>
  102. <if test="lineId != null">
  103. and LINE_ID = #{lineId}
  104. </if>
  105. <if test="lineNo != null and lineNo != ''">
  106. and LINE_NO LIKE '%${lineNo}%'
  107. </if>
  108. <if test="lineStartNodeId != null">
  109. and LINE_START_NODE_ID = #{lineStartNodeId}
  110. </if>
  111. <if test="lineStartNodeType != null">
  112. and LINE_START_NODE_TYPE = #{lineStartNodeType}
  113. </if>
  114. <if test="lineStartNodeDesc != null and lineStartNodeDesc != ''">
  115. and LINE_START_NODE_DESC LIKE '%${lineStartNodeDesc}%'
  116. </if>
  117. <if test="linePathLength != null">
  118. and LINE_PATH_LENGTH = #{linePathLength}
  119. </if>
  120. <if test="lineEndNodeId != null">
  121. and LINE_END_NODE_ID = #{lineEndNodeId}
  122. </if>
  123. <if test="lineEndNodeType != null">
  124. and LINE_END_NODE_TYPE = #{lineEndNodeType}
  125. </if>
  126. <if test="lineEndNodeDesc != null and lineEndNodeDesc != ''">
  127. and LINE_END_NODE_DESC LIKE '%${lineEndNodeDesc}%'
  128. </if>
  129. <if test="lineName != null and lineName != ''">
  130. and LINE_NAME LIKE '%${lineName}%'
  131. </if>
  132. <if test="insertUsername != null and insertUsername != ''">
  133. and INSERT_USERNAME LIKE '%${insertUsername}%'
  134. </if>
  135. <if test="insertTime != null">
  136. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  137. </if>
  138. <if test="updateUsername != null and updateUsername != ''">
  139. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  140. </if>
  141. <if test="updateTime != null">
  142. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  143. </if>
  144. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  145. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  146. </if>
  147. <if test="deleted != null">
  148. and DELETED = #{deleted}
  149. </if>
  150. <if test="lineType != null">
  151. and LINE_TYPE = #{lineType}
  152. </if>
  153. <if test="spellNumber != null">
  154. and SPELL_NUMBER = #{spellNumber}
  155. </if>
  156. </where>
  157. </sql>
  158. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  159. delete from RMS_LINE
  160. where LINE_ID = #{lineId,jdbcType=DECIMAL}
  161. </delete>
  162. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  163. delete from RMS_LINE
  164. where 1!=1
  165. <if test="lineNo != null and lineNo != ''">
  166. or LINE_NO = #{lineNo}
  167. </if>
  168. <if test="lineStartNodeId != null">
  169. or LINE_START_NODE_ID = #{lineStartNodeId}
  170. </if>
  171. <if test="lineStartNodeType != null">
  172. or LINE_START_NODE_TYPE = #{lineStartNodeType}
  173. </if>
  174. <if test="lineStartNodeDesc != null and lineStartNodeDesc != ''">
  175. or LINE_START_NODE_DESC = #{lineStartNodeDesc}
  176. </if>
  177. <if test="linePathLength != null">
  178. or LINE_PATH_LENGTH = #{linePathLength}
  179. </if>
  180. <if test="lineEndNodeId != null">
  181. or LINE_END_NODE_ID = #{lineEndNodeId}
  182. </if>
  183. <if test="lineEndNodeType != null">
  184. or LINE_END_NODE_TYPE = #{lineEndNodeType}
  185. </if>
  186. <if test="lineEndNodeDesc != null and lineEndNodeDesc != ''">
  187. or LINE_END_NODE_DESC = #{lineEndNodeDesc}
  188. </if>
  189. <if test="lineName != null and lineName != ''">
  190. or LINE_NAME = #{lineName}
  191. </if>
  192. <if test="insertUsername != null and insertUsername != ''">
  193. or INSERT_USERNAME = #{insertUsername}
  194. </if>
  195. <if test="insertTime != null">
  196. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  197. </if>
  198. <if test="updateUsername != null and updateUsername != ''">
  199. or UPDATE_USERNAME = #{updateUsername}
  200. </if>
  201. <if test="updateTime != null">
  202. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  203. </if>
  204. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  205. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  206. </if>
  207. <if test="deleted != null">
  208. or DELETED = #{deleted}
  209. </if>
  210. <if test="lineType != null">
  211. or LINE_TYPE = #{lineType}
  212. </if>
  213. <if test="spellNumber != null">
  214. or SPELL_NUMBER = #{spellNumber}
  215. </if>
  216. </delete>
  217. <insert id="insert" parameterType="com.steerinfo.dil.model.RmsLine">
  218. insert into RMS_LINE (LINE_ID, LINE_NO, LINE_START_NODE_ID,
  219. LINE_START_NODE_TYPE, LINE_START_NODE_DESC, LINE_PATH_LENGTH,
  220. LINE_END_NODE_ID, LINE_END_NODE_TYPE, LINE_END_NODE_DESC,
  221. LINE_NAME, INSERT_USERNAME, INSERT_TIME,
  222. UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  223. DELETED, LINE_TYPE, SPELL_NUMBER
  224. )
  225. values (#{lineId,jdbcType=DECIMAL}, #{lineNo,jdbcType=VARCHAR}, #{lineStartNodeId,jdbcType=DECIMAL},
  226. #{lineStartNodeType,jdbcType=DECIMAL}, #{lineStartNodeDesc,jdbcType=VARCHAR}, #{linePathLength,jdbcType=DECIMAL},
  227. #{lineEndNodeId,jdbcType=DECIMAL}, #{lineEndNodeType,jdbcType=DECIMAL}, #{lineEndNodeDesc,jdbcType=VARCHAR},
  228. #{lineName,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  229. #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
  230. #{deleted,jdbcType=DECIMAL}, #{lineType,jdbcType=DECIMAL}, #{spellNumber,jdbcType=DECIMAL}
  231. )
  232. </insert>
  233. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.RmsLine">
  234. insert into RMS_LINE
  235. <trim prefix="(" suffix=")" suffixOverrides=",">
  236. <if test="lineId != null">
  237. LINE_ID,
  238. </if>
  239. <if test="lineNo != null">
  240. LINE_NO,
  241. </if>
  242. <if test="lineStartNodeId != null">
  243. LINE_START_NODE_ID,
  244. </if>
  245. <if test="lineStartNodeType != null">
  246. LINE_START_NODE_TYPE,
  247. </if>
  248. <if test="lineStartNodeDesc != null">
  249. LINE_START_NODE_DESC,
  250. </if>
  251. <if test="linePathLength != null">
  252. LINE_PATH_LENGTH,
  253. </if>
  254. <if test="lineEndNodeId != null">
  255. LINE_END_NODE_ID,
  256. </if>
  257. <if test="lineEndNodeType != null">
  258. LINE_END_NODE_TYPE,
  259. </if>
  260. <if test="lineEndNodeDesc != null">
  261. LINE_END_NODE_DESC,
  262. </if>
  263. <if test="lineName != null">
  264. LINE_NAME,
  265. </if>
  266. <if test="insertUsername != null">
  267. INSERT_USERNAME,
  268. </if>
  269. <if test="insertTime != null">
  270. INSERT_TIME,
  271. </if>
  272. <if test="updateUsername != null">
  273. UPDATE_USERNAME,
  274. </if>
  275. <if test="updateTime != null">
  276. UPDATE_TIME,
  277. </if>
  278. <if test="insertUpdateRemark != null">
  279. INSERT_UPDATE_REMARK,
  280. </if>
  281. <if test="deleted != null">
  282. DELETED,
  283. </if>
  284. <if test="lineType != null">
  285. LINE_TYPE,
  286. </if>
  287. <if test="spellNumber != null">
  288. SPELL_NUMBER,
  289. </if>
  290. </trim>
  291. <trim prefix="values (" suffix=")" suffixOverrides=",">
  292. <if test="lineId != null">
  293. #{lineId,jdbcType=DECIMAL},
  294. </if>
  295. <if test="lineNo != null">
  296. #{lineNo,jdbcType=VARCHAR},
  297. </if>
  298. <if test="lineStartNodeId != null">
  299. #{lineStartNodeId,jdbcType=DECIMAL},
  300. </if>
  301. <if test="lineStartNodeType != null">
  302. #{lineStartNodeType,jdbcType=DECIMAL},
  303. </if>
  304. <if test="lineStartNodeDesc != null">
  305. #{lineStartNodeDesc,jdbcType=VARCHAR},
  306. </if>
  307. <if test="linePathLength != null">
  308. #{linePathLength,jdbcType=DECIMAL},
  309. </if>
  310. <if test="lineEndNodeId != null">
  311. #{lineEndNodeId,jdbcType=DECIMAL},
  312. </if>
  313. <if test="lineEndNodeType != null">
  314. #{lineEndNodeType,jdbcType=DECIMAL},
  315. </if>
  316. <if test="lineEndNodeDesc != null">
  317. #{lineEndNodeDesc,jdbcType=VARCHAR},
  318. </if>
  319. <if test="lineName != null">
  320. #{lineName,jdbcType=VARCHAR},
  321. </if>
  322. <if test="insertUsername != null">
  323. #{insertUsername,jdbcType=VARCHAR},
  324. </if>
  325. <if test="insertTime != null">
  326. #{insertTime,jdbcType=TIMESTAMP},
  327. </if>
  328. <if test="updateUsername != null">
  329. #{updateUsername,jdbcType=VARCHAR},
  330. </if>
  331. <if test="updateTime != null">
  332. #{updateTime,jdbcType=TIMESTAMP},
  333. </if>
  334. <if test="insertUpdateRemark != null">
  335. #{insertUpdateRemark,jdbcType=VARCHAR},
  336. </if>
  337. <if test="deleted != null">
  338. #{deleted,jdbcType=DECIMAL},
  339. </if>
  340. <if test="lineType != null">
  341. #{lineType,jdbcType=DECIMAL},
  342. </if>
  343. <if test="spellNumber != null">
  344. #{spellNumber,jdbcType=DECIMAL},
  345. </if>
  346. </trim>
  347. </insert>
  348. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsLine">
  349. update RMS_LINE
  350. set LINE_NO = #{lineNo,jdbcType=VARCHAR},
  351. LINE_START_NODE_ID = #{lineStartNodeId,jdbcType=DECIMAL},
  352. LINE_START_NODE_TYPE = #{lineStartNodeType,jdbcType=DECIMAL},
  353. LINE_START_NODE_DESC = #{lineStartNodeDesc,jdbcType=VARCHAR},
  354. LINE_PATH_LENGTH = #{linePathLength,jdbcType=DECIMAL},
  355. LINE_END_NODE_ID = #{lineEndNodeId,jdbcType=DECIMAL},
  356. LINE_END_NODE_TYPE = #{lineEndNodeType,jdbcType=DECIMAL},
  357. LINE_END_NODE_DESC = #{lineEndNodeDesc,jdbcType=VARCHAR},
  358. LINE_NAME = #{lineName,jdbcType=VARCHAR},
  359. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  360. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  361. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  362. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  363. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  364. DELETED = #{deleted,jdbcType=DECIMAL},
  365. LINE_TYPE = #{lineType,jdbcType=DECIMAL},
  366. SPELL_NUMBER = #{spellNumber,jdbcType=DECIMAL}
  367. where LINE_ID = #{lineId,jdbcType=DECIMAL}
  368. </update>
  369. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsLine">
  370. update RMS_LINE
  371. <set>
  372. <if test="lineNo != null">
  373. LINE_NO = #{lineNo,jdbcType=VARCHAR},
  374. </if>
  375. <if test="lineStartNodeId != null">
  376. LINE_START_NODE_ID = #{lineStartNodeId,jdbcType=DECIMAL},
  377. </if>
  378. <if test="lineStartNodeType != null">
  379. LINE_START_NODE_TYPE = #{lineStartNodeType,jdbcType=DECIMAL},
  380. </if>
  381. <if test="lineStartNodeDesc != null">
  382. LINE_START_NODE_DESC = #{lineStartNodeDesc,jdbcType=VARCHAR},
  383. </if>
  384. <if test="linePathLength != null">
  385. LINE_PATH_LENGTH = #{linePathLength,jdbcType=DECIMAL},
  386. </if>
  387. <if test="lineEndNodeId != null">
  388. LINE_END_NODE_ID = #{lineEndNodeId,jdbcType=DECIMAL},
  389. </if>
  390. <if test="lineEndNodeType != null">
  391. LINE_END_NODE_TYPE = #{lineEndNodeType,jdbcType=DECIMAL},
  392. </if>
  393. <if test="lineEndNodeDesc != null">
  394. LINE_END_NODE_DESC = #{lineEndNodeDesc,jdbcType=VARCHAR},
  395. </if>
  396. <if test="lineName != null">
  397. LINE_NAME = #{lineName,jdbcType=VARCHAR},
  398. </if>
  399. <if test="insertUsername != null">
  400. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  401. </if>
  402. <if test="insertTime != null">
  403. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  404. </if>
  405. <if test="updateUsername != null">
  406. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  407. </if>
  408. <if test="updateTime != null">
  409. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  410. </if>
  411. <if test="insertUpdateRemark != null">
  412. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  413. </if>
  414. <if test="deleted != null">
  415. DELETED = #{deleted,jdbcType=DECIMAL},
  416. </if>
  417. <if test="lineType != null">
  418. LINE_TYPE = #{lineType,jdbcType=DECIMAL},
  419. </if>
  420. <if test="spellNumber != null">
  421. SPELL_NUMBER = #{spellNumber,jdbcType=DECIMAL},
  422. </if>
  423. </set>
  424. where LINE_ID = #{lineId,jdbcType=DECIMAL}
  425. </update>
  426. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  427. <include refid="select"/>
  428. where LINE_ID = #{lineId,jdbcType=DECIMAL}
  429. </select>
  430. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  431. <include refid="select"/>
  432. <include refid="where"/>
  433. </select>
  434. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  435. <include refid="select"/>
  436. <include refid="whereLike"/>
  437. </select>
  438. <insert id="batchInsert" parameterType="java.util.List">
  439. insert into RMS_LINE
  440. (LINE_ID,
  441. LINE_NO, LINE_START_NODE_ID, LINE_START_NODE_TYPE,
  442. LINE_START_NODE_DESC, LINE_PATH_LENGTH,
  443. LINE_END_NODE_ID, LINE_END_NODE_TYPE,
  444. LINE_END_NODE_DESC, LINE_NAME, INSERT_USERNAME,
  445. INSERT_TIME, UPDATE_USERNAME,
  446. UPDATE_TIME, INSERT_UPDATE_REMARK,
  447. DELETED, LINE_TYPE, SPELL_NUMBER
  448. )
  449. ( <foreach collection="list" item="item" separator="union all">
  450. select
  451. #{item.lineId,jdbcType=DECIMAL},
  452. #{item.lineNo,jdbcType=VARCHAR}, #{item.lineStartNodeId,jdbcType=DECIMAL}, #{item.lineStartNodeType,jdbcType=DECIMAL},
  453. #{item.lineStartNodeDesc,jdbcType=VARCHAR}, #{item.linePathLength,jdbcType=DECIMAL},
  454. #{item.lineEndNodeId,jdbcType=DECIMAL}, #{item.lineEndNodeType,jdbcType=DECIMAL},
  455. #{item.lineEndNodeDesc,jdbcType=VARCHAR}, #{item.lineName,jdbcType=VARCHAR}, #{item.insertUsername,jdbcType=VARCHAR},
  456. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  457. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
  458. #{item.deleted,jdbcType=DECIMAL}, #{item.lineType,jdbcType=DECIMAL}, #{item.spellNumber,jdbcType=DECIMAL}
  459. from dual
  460. </foreach> )
  461. </insert>
  462. <update id="batchUpdate" parameterType="java.util.List">
  463. update RMS_LINE
  464. set
  465. LINE_ID=
  466. <foreach collection="list" item="item" index="index" separator=" " open="case LINE_ID" close="end">
  467. when #{item.lineId,jdbcType=DECIMAL} then #{item.lineId,jdbcType=DECIMAL}
  468. </foreach>
  469. ,LINE_NO=
  470. <foreach collection="list" item="item" index="index" separator=" " open="case LINE_ID" close="end">
  471. when #{item.lineId,jdbcType=DECIMAL} then #{item.lineNo,jdbcType=VARCHAR}
  472. </foreach>
  473. ,LINE_START_NODE_ID=
  474. <foreach collection="list" item="item" index="index" separator=" " open="case LINE_ID" close="end">
  475. when #{item.lineId,jdbcType=DECIMAL} then #{item.lineStartNodeId,jdbcType=DECIMAL}
  476. </foreach>
  477. ,LINE_START_NODE_TYPE=
  478. <foreach collection="list" item="item" index="index" separator=" " open="case LINE_ID" close="end">
  479. when #{item.lineId,jdbcType=DECIMAL} then #{item.lineStartNodeType,jdbcType=DECIMAL}
  480. </foreach>
  481. ,LINE_START_NODE_DESC=
  482. <foreach collection="list" item="item" index="index" separator=" " open="case LINE_ID" close="end">
  483. when #{item.lineId,jdbcType=DECIMAL} then #{item.lineStartNodeDesc,jdbcType=VARCHAR}
  484. </foreach>
  485. ,LINE_PATH_LENGTH=
  486. <foreach collection="list" item="item" index="index" separator=" " open="case LINE_ID" close="end">
  487. when #{item.lineId,jdbcType=DECIMAL} then #{item.linePathLength,jdbcType=DECIMAL}
  488. </foreach>
  489. ,LINE_END_NODE_ID=
  490. <foreach collection="list" item="item" index="index" separator=" " open="case LINE_ID" close="end">
  491. when #{item.lineId,jdbcType=DECIMAL} then #{item.lineEndNodeId,jdbcType=DECIMAL}
  492. </foreach>
  493. ,LINE_END_NODE_TYPE=
  494. <foreach collection="list" item="item" index="index" separator=" " open="case LINE_ID" close="end">
  495. when #{item.lineId,jdbcType=DECIMAL} then #{item.lineEndNodeType,jdbcType=DECIMAL}
  496. </foreach>
  497. ,LINE_END_NODE_DESC=
  498. <foreach collection="list" item="item" index="index" separator=" " open="case LINE_ID" close="end">
  499. when #{item.lineId,jdbcType=DECIMAL} then #{item.lineEndNodeDesc,jdbcType=VARCHAR}
  500. </foreach>
  501. ,LINE_NAME=
  502. <foreach collection="list" item="item" index="index" separator=" " open="case LINE_ID" close="end">
  503. when #{item.lineId,jdbcType=DECIMAL} then #{item.lineName,jdbcType=VARCHAR}
  504. </foreach>
  505. ,INSERT_USERNAME=
  506. <foreach collection="list" item="item" index="index" separator=" " open="case LINE_ID" close="end">
  507. when #{item.lineId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  508. </foreach>
  509. ,INSERT_TIME=
  510. <foreach collection="list" item="item" index="index" separator=" " open="case LINE_ID" close="end">
  511. when #{item.lineId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  512. </foreach>
  513. ,UPDATE_USERNAME=
  514. <foreach collection="list" item="item" index="index" separator=" " open="case LINE_ID" close="end">
  515. when #{item.lineId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  516. </foreach>
  517. ,UPDATE_TIME=
  518. <foreach collection="list" item="item" index="index" separator=" " open="case LINE_ID" close="end">
  519. when #{item.lineId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  520. </foreach>
  521. ,INSERT_UPDATE_REMARK=
  522. <foreach collection="list" item="item" index="index" separator=" " open="case LINE_ID" close="end">
  523. when #{item.lineId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  524. </foreach>
  525. ,DELETED=
  526. <foreach collection="list" item="item" index="index" separator=" " open="case LINE_ID" close="end">
  527. when #{item.lineId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
  528. </foreach>
  529. ,LINE_TYPE=
  530. <foreach collection="list" item="item" index="index" separator=" " open="case LINE_ID" close="end">
  531. when #{item.lineId,jdbcType=DECIMAL} then #{item.lineType,jdbcType=DECIMAL}
  532. </foreach>
  533. ,SPELL_NUMBER=
  534. <foreach collection="list" item="item" index="index" separator=" " open="case LINE_ID" close="end">
  535. when #{item.lineId,jdbcType=DECIMAL} then #{item.spellNumber,jdbcType=DECIMAL}
  536. </foreach>
  537. where LINE_ID in
  538. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  539. #{item.lineId,jdbcType=DECIMAL}
  540. </foreach>
  541. </update>
  542. <delete id="batchDelete" parameterType="java.util.List">
  543. delete from RMS_LINE
  544. where LINE_ID in
  545. <foreach collection="list" item="id" open="(" close=")" separator=",">
  546. #{id}
  547. </foreach>
  548. </delete>
  549. <!-- 友情提示!!!-->
  550. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  551. <select id="getAllLineDesk" parameterType="java.util.Map" resultType="java.util.Map">
  552. SELECT * FROM(SELECT
  553. RL.LINE_ID "lineId",
  554. RL.LINE_NO "lineNo",
  555. RL.SPELL_NUMBER "spellNumber",
  556. RL.LINE_NAME "lineName",
  557. (
  558. CASE
  559. WHEN RL.LINE_TYPE = 1
  560. THEN '内转'
  561. WHEN RL.LINE_TYPE = 2
  562. THEN '销售'
  563. WHEN RL.LINE_TYPE = 3
  564. THEN '采购'
  565. WHEN RL.LINE_TYPE = 4
  566. THEN '退货'
  567. END) "lineType",
  568. (
  569. SELECT
  570. listagg ( LINK_NAME, '-' )
  571. within GROUP ( ORDER BY SEGMENT_SQE )
  572. FROM RMS_LINE_SEGEMNT RLS
  573. LEFT JOIN RMS_LINK RK
  574. ON RK.LINK_ID = RLS.SEGMENT_START_NODE_ID
  575. WHERE RL.LINE_ID = RLS.LINE_ID
  576. AND RLS.DELETED = 0
  577. ) "lineDesk"
  578. FROM
  579. RMS_LINE RL
  580. WHERE RL.DELETED = 0
  581. )
  582. <where>
  583. <if test="lineNo != null">
  584. and
  585. <foreach collection="lineNo" item="item" open="(" separator="or" close=")">
  586. "lineNo" like '%${item}%'
  587. </foreach>
  588. </if>
  589. <if test="spellNumber != null">
  590. and
  591. <foreach collection="spellNumber" item="item" open="(" separator="or" close=")">
  592. "spellNumber" like '%${item}%'
  593. </foreach>
  594. </if>
  595. <if test="lineType != null">
  596. and
  597. <foreach collection="lineType" item="item" open="(" separator="or" close=")">
  598. "lineType" like '%${item}%'
  599. </foreach>
  600. </if>
  601. <if test="lineDesk != null">
  602. and
  603. <foreach collection="lineDesk" item="item" open="(" separator="or" close=")">
  604. "lineDesk" like '%${item}%'
  605. </foreach>
  606. </if>
  607. <if test="lineName != null">
  608. and
  609. <foreach collection="lineName" item="item" open="(" separator="or" close=")">
  610. "lineName" like '%${item}%'
  611. </foreach>
  612. </if>
  613. </where>
  614. <include refid="orderBy"></include>
  615. </select>
  616. <sql id="orderBy">
  617. <if test="orderField != null and orderField != ''">
  618. order by "${orderField}"
  619. <if test="orderType != null and orderType != ''">
  620. ${orderType}
  621. </if>
  622. </if>
  623. <if test="orderField == null ">
  624. order by "lineId" desc
  625. </if>
  626. </sql>
  627. <!-- 根据运输订单号查询运输路线主表信息-->
  628. <select id="getRmsLine" parameterType="DECIMAL" resultType="java.util.Map">
  629. SELECT
  630. LINE_ID "lineId",
  631. LINE_NO "lineNo",
  632. LINE_NAME "lineName",
  633. LINE_TYPE "lineType",
  634. SPELL_NUMBER "spellNumber"
  635. FROM RMS_LINE
  636. WHERE LINE_ID = #{lineId}
  637. AND DELETED = 0
  638. </select>
  639. <select id="getOmstruckOrderNumber" parameterType="DECIMAL" resultType="int">
  640. SELECT
  641. count(*)
  642. FROM OMSTRUCK_ORDER
  643. WHERE LINE_ID = #{lineId}
  644. </select>
  645. </mapper>