QmsQueueSpellingListMapper.xml 16 KB

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