TmstruckEnfactoryResultMapper.xml 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368
  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.TmstruckEnfactoryResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckEnfactoryResult">
  5. <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId" />
  6. <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
  7. <result column="GATEPOST_ID" jdbcType="DECIMAL" property="gatepostId" />
  8. <result column="RESULT_ENTRY_MODE" jdbcType="VARCHAR" property="resultEntryMode" />
  9. <result column="RESULT_ENTRY_GATE_TIME" jdbcType="TIMESTAMP" property="resultEntryGateTime" />
  10. <result column="RESULT_MEMO" jdbcType="VARCHAR" property="resultMemo" />
  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="DELETE_USERNAME" jdbcType="VARCHAR" property="deleteUsername" />
  17. <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
  18. <result column="SEGMEN_SQE" jdbcType="DECIMAL" property="segmenSqe" />
  19. </resultMap>
  20. <sql id="columns">
  21. RESULT_ID, RESULT_TOTAL_ID, GATEPOST_ID, RESULT_ENTRY_MODE, RESULT_ENTRY_GATE_TIME,
  22. RESULT_MEMO, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  23. DELETE_USERNAME, DELETE_TIME, SEGMEN_SQE
  24. </sql>
  25. <sql id="columns_alias">
  26. t.RESULT_ID, t.RESULT_TOTAL_ID, t.GATEPOST_ID, t.RESULT_ENTRY_MODE, t.RESULT_ENTRY_GATE_TIME,
  27. t.RESULT_MEMO, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME,
  28. t.INSERT_UPDATE_REMARK, t.DELETE_USERNAME, t.DELETE_TIME, t.SEGMEN_SQE
  29. </sql>
  30. <sql id="select">
  31. SELECT <include refid="columns"/> FROM TMSTRUCK_ENFACTORY_RESULT
  32. </sql>
  33. <sql id="select_alias">
  34. SELECT <include refid="columns_alias"/> FROM TMSTRUCK_ENFACTORY_RESULT t
  35. </sql>
  36. <sql id="where">
  37. <where>
  38. <if test="resultId != null">
  39. and RESULT_ID = #{resultId}
  40. </if>
  41. <if test="resultTotalId != null">
  42. and RESULT_TOTAL_ID = #{resultTotalId}
  43. </if>
  44. <if test="gatepostId != null">
  45. and GATEPOST_ID = #{gatepostId}
  46. </if>
  47. <if test="resultEntryMode != null and resultEntryMode != ''">
  48. and RESULT_ENTRY_MODE = #{resultEntryMode}
  49. </if>
  50. <if test="resultEntryGateTime != null">
  51. and TO_CHAR(RESULT_ENTRY_GATE_TIME,'yyyy-MM-dd') = #{resultEntryGateTime}
  52. </if>
  53. <if test="resultMemo != null and resultMemo != ''">
  54. and RESULT_MEMO = #{resultMemo}
  55. </if>
  56. <if test="insertUsername != null and insertUsername != ''">
  57. and INSERT_USERNAME = #{insertUsername}
  58. </if>
  59. <if test="insertTime != null">
  60. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  61. </if>
  62. <if test="updateUsername != null and updateUsername != ''">
  63. and UPDATE_USERNAME = #{updateUsername}
  64. </if>
  65. <if test="updateTime != null">
  66. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  67. </if>
  68. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  69. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  70. </if>
  71. <if test="deleteUsername != null and deleteUsername != ''">
  72. and DELETE_USERNAME = #{deleteUsername}
  73. </if>
  74. <if test="deleteTime != null">
  75. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  76. </if>
  77. <if test="segmenSqe != null">
  78. and SEGMEN_SQE = #{segmenSqe}
  79. </if>
  80. </where>
  81. </sql>
  82. <sql id="whereLike">
  83. <where>
  84. <if test="resultId != null">
  85. and RESULT_ID = #{resultId}
  86. </if>
  87. <if test="resultTotalId != null">
  88. and RESULT_TOTAL_ID = #{resultTotalId}
  89. </if>
  90. <if test="gatepostId != null">
  91. and GATEPOST_ID = #{gatepostId}
  92. </if>
  93. <if test="resultEntryMode != null and resultEntryMode != ''">
  94. and RESULT_ENTRY_MODE LIKE '%${resultEntryMode}%'
  95. </if>
  96. <if test="resultEntryGateTime != null">
  97. and TO_CHAR(RESULT_ENTRY_GATE_TIME,'yyyy-MM-dd') = #{resultEntryGateTime}
  98. </if>
  99. <if test="resultMemo != null and resultMemo != ''">
  100. and RESULT_MEMO LIKE '%${resultMemo}%'
  101. </if>
  102. <if test="insertUsername != null and insertUsername != ''">
  103. and INSERT_USERNAME LIKE '%${insertUsername}%'
  104. </if>
  105. <if test="insertTime != null">
  106. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  107. </if>
  108. <if test="updateUsername != null and updateUsername != ''">
  109. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  110. </if>
  111. <if test="updateTime != null">
  112. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  113. </if>
  114. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  115. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  116. </if>
  117. <if test="deleteUsername != null and deleteUsername != ''">
  118. and DELETE_USERNAME LIKE '%${deleteUsername}%'
  119. </if>
  120. <if test="deleteTime != null">
  121. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  122. </if>
  123. <if test="segmenSqe != null">
  124. and SEGMEN_SQE = #{segmenSqe}
  125. </if>
  126. </where>
  127. </sql>
  128. <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
  129. delete from TMSTRUCK_ENFACTORY_RESULT
  130. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  131. </delete>
  132. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  133. delete from TMSTRUCK_ENFACTORY_RESULT
  134. where 1!=1
  135. <if test="resultTotalId != null">
  136. or RESULT_TOTAL_ID = #{resultTotalId}
  137. </if>
  138. <if test="gatepostId != null">
  139. or GATEPOST_ID = #{gatepostId}
  140. </if>
  141. <if test="resultEntryMode != null and resultEntryMode != ''">
  142. or RESULT_ENTRY_MODE = #{resultEntryMode}
  143. </if>
  144. <if test="resultEntryGateTime != null">
  145. or TO_CHAR(RESULT_ENTRY_GATE_TIME,'yyyy-MM-dd') = '#{resultEntryGateTime}'
  146. </if>
  147. <if test="resultMemo != null and resultMemo != ''">
  148. or RESULT_MEMO = #{resultMemo}
  149. </if>
  150. <if test="insertUsername != null and insertUsername != ''">
  151. or INSERT_USERNAME = #{insertUsername}
  152. </if>
  153. <if test="insertTime != null">
  154. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  155. </if>
  156. <if test="updateUsername != null and updateUsername != ''">
  157. or UPDATE_USERNAME = #{updateUsername}
  158. </if>
  159. <if test="updateTime != null">
  160. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  161. </if>
  162. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  163. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  164. </if>
  165. <if test="deleteUsername != null and deleteUsername != ''">
  166. or DELETE_USERNAME = #{deleteUsername}
  167. </if>
  168. <if test="deleteTime != null">
  169. or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
  170. </if>
  171. <if test="segmenSqe != null">
  172. or SEGMEN_SQE = #{segmenSqe}
  173. </if>
  174. </delete>
  175. <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckEnfactoryResult">
  176. insert into TMSTRUCK_ENFACTORY_RESULT (RESULT_ID, RESULT_TOTAL_ID, GATEPOST_ID,
  177. RESULT_ENTRY_MODE, RESULT_ENTRY_GATE_TIME,
  178. RESULT_MEMO, INSERT_USERNAME, INSERT_TIME,
  179. UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  180. DELETE_USERNAME, DELETE_TIME, SEGMEN_SQE
  181. )
  182. values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{gatepostId,jdbcType=DECIMAL},
  183. #{resultEntryMode,jdbcType=VARCHAR}, #{resultEntryGateTime,jdbcType=TIMESTAMP},
  184. #{resultMemo,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  185. #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
  186. #{deleteUsername,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP}, #{segmenSqe,jdbcType=DECIMAL}
  187. )
  188. </insert>
  189. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckEnfactoryResult">
  190. insert into TMSTRUCK_ENFACTORY_RESULT
  191. <trim prefix="(" suffix=")" suffixOverrides=",">
  192. <if test="resultId != null">
  193. RESULT_ID,
  194. </if>
  195. <if test="resultTotalId != null">
  196. RESULT_TOTAL_ID,
  197. </if>
  198. <if test="gatepostId != null">
  199. GATEPOST_ID,
  200. </if>
  201. <if test="resultEntryMode != null">
  202. RESULT_ENTRY_MODE,
  203. </if>
  204. <if test="resultEntryGateTime != null">
  205. RESULT_ENTRY_GATE_TIME,
  206. </if>
  207. <if test="resultMemo != null">
  208. RESULT_MEMO,
  209. </if>
  210. <if test="insertUsername != null">
  211. INSERT_USERNAME,
  212. </if>
  213. <if test="insertTime != null">
  214. INSERT_TIME,
  215. </if>
  216. <if test="updateUsername != null">
  217. UPDATE_USERNAME,
  218. </if>
  219. <if test="updateTime != null">
  220. UPDATE_TIME,
  221. </if>
  222. <if test="insertUpdateRemark != null">
  223. INSERT_UPDATE_REMARK,
  224. </if>
  225. <if test="deleteUsername != null">
  226. DELETE_USERNAME,
  227. </if>
  228. <if test="deleteTime != null">
  229. DELETE_TIME,
  230. </if>
  231. <if test="segmenSqe != null">
  232. SEGMEN_SQE,
  233. </if>
  234. </trim>
  235. <trim prefix="values (" suffix=")" suffixOverrides=",">
  236. <if test="resultId != null">
  237. #{resultId,jdbcType=DECIMAL},
  238. </if>
  239. <if test="resultTotalId != null">
  240. #{resultTotalId,jdbcType=DECIMAL},
  241. </if>
  242. <if test="gatepostId != null">
  243. #{gatepostId,jdbcType=DECIMAL},
  244. </if>
  245. <if test="resultEntryMode != null">
  246. #{resultEntryMode,jdbcType=VARCHAR},
  247. </if>
  248. <if test="resultEntryGateTime != null">
  249. #{resultEntryGateTime,jdbcType=TIMESTAMP},
  250. </if>
  251. <if test="resultMemo != null">
  252. #{resultMemo,jdbcType=VARCHAR},
  253. </if>
  254. <if test="insertUsername != null">
  255. #{insertUsername,jdbcType=VARCHAR},
  256. </if>
  257. <if test="insertTime != null">
  258. #{insertTime,jdbcType=TIMESTAMP},
  259. </if>
  260. <if test="updateUsername != null">
  261. #{updateUsername,jdbcType=VARCHAR},
  262. </if>
  263. <if test="updateTime != null">
  264. #{updateTime,jdbcType=TIMESTAMP},
  265. </if>
  266. <if test="insertUpdateRemark != null">
  267. #{insertUpdateRemark,jdbcType=VARCHAR},
  268. </if>
  269. <if test="deleteUsername != null">
  270. #{deleteUsername,jdbcType=VARCHAR},
  271. </if>
  272. <if test="deleteTime != null">
  273. #{deleteTime,jdbcType=TIMESTAMP},
  274. </if>
  275. <if test="segmenSqe != null">
  276. #{segmenSqe,jdbcType=DECIMAL},
  277. </if>
  278. </trim>
  279. </insert>
  280. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckEnfactoryResult">
  281. update TMSTRUCK_ENFACTORY_RESULT
  282. set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  283. GATEPOST_ID = #{gatepostId,jdbcType=DECIMAL},
  284. RESULT_ENTRY_MODE = #{resultEntryMode,jdbcType=VARCHAR},
  285. RESULT_ENTRY_GATE_TIME = #{resultEntryGateTime,jdbcType=TIMESTAMP},
  286. RESULT_MEMO = #{resultMemo,jdbcType=VARCHAR},
  287. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  288. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  289. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  290. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  291. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  292. DELETE_USERNAME = #{deleteUsername,jdbcType=VARCHAR},
  293. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  294. SEGMEN_SQE = #{segmenSqe,jdbcType=DECIMAL}
  295. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  296. </update>
  297. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckEnfactoryResult">
  298. update TMSTRUCK_ENFACTORY_RESULT
  299. <set>
  300. <if test="resultTotalId != null">
  301. RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  302. </if>
  303. <if test="gatepostId != null">
  304. GATEPOST_ID = #{gatepostId,jdbcType=DECIMAL},
  305. </if>
  306. <if test="resultEntryMode != null">
  307. RESULT_ENTRY_MODE = #{resultEntryMode,jdbcType=VARCHAR},
  308. </if>
  309. <if test="resultEntryGateTime != null">
  310. RESULT_ENTRY_GATE_TIME = #{resultEntryGateTime,jdbcType=TIMESTAMP},
  311. </if>
  312. <if test="resultMemo != null">
  313. RESULT_MEMO = #{resultMemo,jdbcType=VARCHAR},
  314. </if>
  315. <if test="insertUsername != null">
  316. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  317. </if>
  318. <if test="insertTime != null">
  319. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  320. </if>
  321. <if test="updateUsername != null">
  322. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  323. </if>
  324. <if test="updateTime != null">
  325. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  326. </if>
  327. <if test="insertUpdateRemark != null">
  328. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  329. </if>
  330. <if test="deleteUsername != null">
  331. DELETE_USERNAME = #{deleteUsername,jdbcType=VARCHAR},
  332. </if>
  333. <if test="deleteTime != null">
  334. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  335. </if>
  336. <if test="segmenSqe != null">
  337. SEGMEN_SQE = #{segmenSqe,jdbcType=DECIMAL},
  338. </if>
  339. </set>
  340. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  341. </update>
  342. <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
  343. <include refid="select"/>
  344. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  345. </select>
  346. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  347. <include refid="select"/>
  348. <include refid="where"/>
  349. </select>
  350. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  351. <include refid="select"/>
  352. <include refid="whereLike"/>
  353. </select>
  354. <insert id="batchInsert" parameterType="java.util.List">
  355. insert into TMSTRUCK_ENFACTORY_RESULT
  356. (RESULT_ID,
  357. RESULT_TOTAL_ID, GATEPOST_ID, RESULT_ENTRY_MODE,
  358. RESULT_ENTRY_GATE_TIME, RESULT_MEMO,
  359. INSERT_USERNAME, INSERT_TIME,
  360. UPDATE_USERNAME, UPDATE_TIME,
  361. INSERT_UPDATE_REMARK, DELETE_USERNAME,
  362. DELETE_TIME, SEGMEN_SQE)
  363. ( <foreach collection="list" item="item" separator="union all">
  364. select
  365. #{item.resultId,jdbcType=DECIMAL},
  366. #{item.resultTotalId,jdbcType=DECIMAL}, #{item.gatepostId,jdbcType=DECIMAL}, #{item.resultEntryMode,jdbcType=VARCHAR},
  367. #{item.resultEntryGateTime,jdbcType=TIMESTAMP}, #{item.resultMemo,jdbcType=VARCHAR},
  368. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  369. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  370. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleteUsername,jdbcType=VARCHAR},
  371. #{item.deleteTime,jdbcType=TIMESTAMP}, #{item.segmenSqe,jdbcType=DECIMAL} from dual
  372. </foreach> )
  373. </insert>
  374. <update id="batchUpdate" parameterType="java.util.List">
  375. update TMSTRUCK_ENFACTORY_RESULT
  376. set
  377. RESULT_ID=
  378. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  379. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
  380. </foreach>
  381. ,RESULT_TOTAL_ID=
  382. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  383. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
  384. </foreach>
  385. ,GATEPOST_ID=
  386. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  387. when #{item.resultId,jdbcType=DECIMAL} then #{item.gatepostId,jdbcType=DECIMAL}
  388. </foreach>
  389. ,RESULT_ENTRY_MODE=
  390. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  391. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEntryMode,jdbcType=VARCHAR}
  392. </foreach>
  393. ,RESULT_ENTRY_GATE_TIME=
  394. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  395. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultEntryGateTime,jdbcType=TIMESTAMP}
  396. </foreach>
  397. ,RESULT_MEMO=
  398. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  399. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultMemo,jdbcType=VARCHAR}
  400. </foreach>
  401. ,INSERT_USERNAME=
  402. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  403. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  404. </foreach>
  405. ,INSERT_TIME=
  406. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  407. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  408. </foreach>
  409. ,UPDATE_USERNAME=
  410. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  411. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  412. </foreach>
  413. ,UPDATE_TIME=
  414. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  415. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  416. </foreach>
  417. ,INSERT_UPDATE_REMARK=
  418. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  419. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  420. </foreach>
  421. ,DELETE_USERNAME=
  422. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  423. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteUsername,jdbcType=VARCHAR}
  424. </foreach>
  425. ,DELETE_TIME=
  426. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  427. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
  428. </foreach>
  429. ,SEGMEN_SQE=
  430. <foreach collection="list" item="item" index="index" separator=" " open="case RESULT_ID" close="end">
  431. when #{item.resultId,jdbcType=DECIMAL} then #{item.segmenSqe,jdbcType=DECIMAL}
  432. </foreach>
  433. where RESULT_ID in
  434. <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
  435. #{item.resultId,jdbcType=DECIMAL}
  436. </foreach>
  437. </update>
  438. <delete id="batchDelete" parameterType="java.util.List">
  439. delete from TMSTRUCK_ENFACTORY_RESULT
  440. where RESULT_ID in
  441. <foreach collection="list" item="id" open="(" close=")" separator=",">
  442. #{id}
  443. </foreach>
  444. </delete>
  445. <!-- 友情提示!!!-->
  446. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  447. <!-- 按照进厂时间进行排序 -->
  448. <sql id="orderByEnterTime">
  449. <if test="orderField != null and orderField != ''">
  450. order by "${orderField}"
  451. <if test="orderType != null and orderType != ''">
  452. ${orderType}
  453. </if>
  454. </if>
  455. <if test="orderField == null ">
  456. order by "resultEntryGateTime" desc
  457. </if>
  458. </sql>
  459. <!-- 查询所有的采购进厂作业实绩 -->
  460. <select id="getCGJKEnFactoryResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  461. select *
  462. from (
  463. select
  464. TER.RESULT_ID "resultId",
  465. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  466. RM.MATERIAL_NAME "materialName",
  467. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  468. OO.ORDER_NUMBER "orderNumber",
  469. RC.CAPACITY_NUMBER "capacityNumber",
  470. RG.GATEPOST_NAME "gatepostName",
  471. TER.RESULT_ENTRY_MODE "resultEntryMode",
  472. TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
  473. RS.SUPPLIER_NAME "supplierName",
  474. OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
  475. TER.INSERT_TIME "insertTime",
  476. RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName"
  477. from TMSTRUCK_ENFACTORY_RESULT TER
  478. left join TMSTRUCK_TOTAL_RESULT TTR
  479. on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  480. left join OMSTRUCK_ORDER OO
  481. on TTR.ORDER_ID = OO.ORDER_ID
  482. left join AMS_PURCHASE_ORDER APO
  483. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  484. left join DIL_BATCH DB
  485. on DB.BATCH_ID = APO.BATCH_ID
  486. left join RMS_CAPACITY RC
  487. on RC.CAPACITY_ID = OO.CAPACITY_ID
  488. left join RMS_SUPPLIER RS
  489. on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
  490. left join RMS_CONSIGNEE RCON
  491. on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
  492. left join OMSTRUCK_ORDER_MATERIAL OOM
  493. on OOM.ORDER_ID = OO.ORDER_ID
  494. left join RMS_MATERIAL RM
  495. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  496. left join RMS_GATEPOST RG
  497. on RG.GATEPOST_ID = TER.GATEPOST_ID
  498. where TER.RESULT_ENTRY_GATE_TIME is not null and OO.ORDER_TYPE = #{orderTypee}
  499. )
  500. <where>
  501. <if test="purchaseOrderId != null">
  502. <foreach collection="purchaseOrderId" item="item" open="(" separator="or" close=")">
  503. "purchaseOrderId" like '%${item}%'
  504. </foreach>
  505. </if>
  506. <if test="materialName != null">
  507. and
  508. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  509. "materialName" like '%${item}%'
  510. </foreach>
  511. </if>
  512. <if test="resultForeignShipName != null">
  513. and
  514. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  515. "resultForeignShipName" like '%${item}%'
  516. </foreach>
  517. </if>
  518. <if test="orderNumber != null">
  519. and
  520. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  521. "orderNumber" like '%${item}%'
  522. </foreach>
  523. </if>
  524. <if test="capacityNumber != null">
  525. and
  526. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  527. "capacityNumber" like '%${item}%'
  528. </foreach>
  529. </if>
  530. <if test="warehouseName != null">
  531. and
  532. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  533. "warehouseName" like '%${item}%'
  534. </foreach>
  535. </if>
  536. <if test="resultEntryMode != null">
  537. and
  538. <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
  539. "resultEntryMode" like '%${item}%'
  540. </foreach>
  541. </if>
  542. <if test="supplierName != null">
  543. and
  544. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  545. "supplierName" like '%${item}%'
  546. </foreach>
  547. </if>
  548. <if test="orderMaterialWeight != null">
  549. and
  550. <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
  551. "orderMaterialWeight" like '%${item}%'
  552. </foreach>
  553. </if>
  554. </where>
  555. <include refid="orderByEnterTime"></include>
  556. </select>
  557. <!-- 查询内转进厂作业实绩 -->
  558. <select id="getAllInwardTurnEnFactoryResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  559. select *
  560. from (
  561. select
  562. RM.MATERIAL_NAME "materialName",
  563. OO.ORDER_NUMBER "orderNumber",
  564. RC.CAPACITY_NUMBER "capacityNumber",
  565. RG.GATEPOST_NAME "gatepostName",
  566. TER.RESULT_ENTRY_MODE "resultEntryMode",
  567. TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
  568. (
  569. CASE
  570. WHEN OOM.ORDER_MATERIAL_WEIGHT is null
  571. THEN OOM.ORDER_MATERIAL_NUMBER
  572. ELSE OOM.ORDER_MATERIAL_WEIGHT
  573. END
  574. ) "orderMaterialNo"
  575. from TMSTRUCK_ENFACTORY_RESULT TER
  576. left join TMSTRUCK_TOTAL_RESULT TTR
  577. on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  578. left join OMSTRUCK_ORDER OO
  579. on TTR.ORDER_ID = OO.ORDER_ID
  580. left join RMS_CAPACITY RC
  581. on RC.CAPACITY_ID = OO.CAPACITY_ID
  582. left join OMSTRUCK_ORDER_MATERIAL OOM
  583. on OOM.ORDER_ID = OO.ORDER_ID
  584. left join RMS_MATERIAL RM
  585. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  586. left join RMS_GATEPOST RG
  587. on RG.GATEPOST_ID = TER.GATEPOST_ID
  588. where TER.RESULT_ENTRY_GATE_TIME is not null and OO.ORDER_TYPE = 4
  589. )
  590. <where>
  591. <if test="materialName != null">
  592. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  593. "materialName" like '%${item}%'
  594. </foreach>
  595. </if>
  596. <if test="orderNumber != null">
  597. and
  598. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  599. "orderNumber" like '%${item}%'
  600. </foreach>
  601. </if>
  602. <if test="capacityNumber != null">
  603. and
  604. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  605. "capacityNumber" like '%${item}%'
  606. </foreach>
  607. </if>
  608. <if test="resultEntryMode != null">
  609. and
  610. <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
  611. "resultEntryMode" like '%${item}%'
  612. </foreach>
  613. </if>
  614. <if test="orderMaterialNo != null">
  615. and
  616. <foreach collection="orderMaterialNo" item="item" open="(" separator="or" close=")">
  617. "orderMaterialNo" like '%${item}%'
  618. </foreach>
  619. </if>
  620. </where>
  621. <include refid="orderByEnterTime"></include>
  622. </select>
  623. <!-- 通过车牌号并且状态不为2 或 运输订单 或运输订单ID 查询关联的实绩总表ID -->
  624. <select id="selectTotalResultIdByCpAndOn" parameterType="java.util.Map" resultType="java.util.Map">
  625. select TTR.RESULT_TOTAL_ID "resultTotalId",
  626. RC.CAPACITY_NUMBER "capacityNumber",
  627. OO.ORDER_TYPE "orderType"
  628. from OMSTRUCK_ORDER OO
  629. left join TMSTRUCK_TOTAL_RESULT TTR
  630. on TTR.ORDER_ID = OO.ORDER_ID
  631. left join RMS_CAPACITY RC
  632. on RC.CAPACITY_ID = OO.CAPACITY_ID
  633. <where>
  634. <if test="orderId != null">
  635. OO.ORDER_ID = #{orderId}
  636. </if>
  637. <if test="orderNumber != null and orderId == null">
  638. and OO.ORDER_NUMBER = #{orderNumber}
  639. </if>
  640. </where>
  641. </select>
  642. <!-- 通过门岗名称查询门岗Id-->
  643. <select id="selectGatepostIdByGatepostName" parameterType="java.lang.String" resultType="int">
  644. select GATEPOST_ID "gatepostId"
  645. from RMS_GATEPOST
  646. where GATEPOST_NAME = #{gatepostName}
  647. </select>
  648. <!-- 通过运输订单号查找实绩Id -->
  649. <select id="selectEnFactoryResultId" parameterType="string" resultType="java.util.Map">
  650. select * from (select TER.RESULT_ID "resultId",
  651. OO.ORDER_ID "orderId",
  652. OO.ORDER_TYPE "orderTypee", --避免与筛选条件重名
  653. OO.ORDER_TYPE "orderType",
  654. TER.RESULT_TOTAL_ID "resultTotalId",
  655. RC.CAPACITY_NUMBER "capacityNumber",
  656. TER.SEGMEN_SQE "segmentSqe", --进厂的路段顺序号
  657. ter.result_entry_gate_time
  658. from OMSTRUCK_ORDER OO
  659. left join TMSTRUCK_TOTAL_RESULT TTR
  660. on OO.ORDER_ID = TTR.ORDER_ID
  661. left join TMSTRUCK_ENFACTORY_RESULT TER
  662. on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  663. left join RMS_CAPACITY RC
  664. on RC.CAPACITY_ID = OO.CAPACITY_ID
  665. where OO.ORDER_NUMBER = #{orderNumber}
  666. and ter.result_entry_gate_time is null
  667. order by TER.SEGMEN_SQE)
  668. where rownum=1
  669. </select>
  670. <!-- 查找排队序号 -->
  671. <select id="selectNodeNumber" resultType="int" parameterType="string">
  672. select (
  673. <![CDATA[
  674. select count(*)
  675. from QMS_QUEUE_LIST QQL2
  676. join QMS_QUEUE_GRID QQG2
  677. on QQG2.GRID_ID = QQL2.GRID_ID
  678. where QQL2.LIST_NODE_ORDER <= QQL.LIST_NODE_ORDER
  679. and QQL2.GRID_ID = QQL.GRID_ID
  680. and QQL2.DELETED = 0
  681. ]]>
  682. ) "listNodeOrder"
  683. from OMSTRUCK_ORDER OO
  684. left join QMS_QUEUE_LIST QQL
  685. on OO.CAPACITY_ID = QQL.CAPACITY_ID
  686. where OO.ORDER_NUMBER = #{orderNumber}
  687. and QQL.DELETED = 1
  688. </select>
  689. <!--查询销售进厂实绩 -->
  690. <select id="getXSEnFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
  691. select *
  692. from (
  693. select
  694. TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
  695. TER.RESULT_ENTRY_MODE "resultEntryMode",
  696. RG.GATEPOST_NAME "gatepostName",
  697. OO.ORDER_NUMBER "orderNumber",
  698. RC.CAPACITY_NUMBER "capacityNumber",
  699. OO.ORDER_ID "orderId",
  700. ASO.SALE_NUMBER "saleNum",
  701. RS.SUPPLIER_NAME "shipperName",
  702. RCON.CONSIGNEE_COMPANY_NAME "supplierName"
  703. FROM TMSTRUCK_ENFACTORY_RESULT TER
  704. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  705. ON TTR.RESULT_TOTAL_ID = TER.RESULT_TOTAL_ID
  706. LEFT JOIN OMSTRUCK_ORDER OO
  707. ON OO.ORDER_ID = TTR.ORDER_ID
  708. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
  709. ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
  710. LEFT JOIN AMS_SALE_ORDER ASO
  711. ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
  712. LEFT JOIN RMS_GATEPOST RG
  713. ON RG.GATEPOST_ID = TER.GATEPOST_ID
  714. LEFT JOIN RMS_CAPACITY RC
  715. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  716. LEFT JOIN RMS_SUPPLIER RS
  717. ON RS.SUPPLIER_ID = ASO.SHIPPER_ID
  718. LEFT JOIN RMS_CONSIGNEE RCON
  719. ON RCON.CONSIGNEE_ID = ASO.RECEIVE_ID
  720. WHERE TER.RESULT_ENTRY_GATE_TIME IS NOT NULL
  721. AND OO.ORDER_TYPE IN (1, 2, 3)
  722. )
  723. <where>
  724. <if test="saleNum != null">
  725. <foreach collection="saleNum" item="item" open="(" separator="or" close=")">
  726. "saleNum" like '%${item}%'
  727. </foreach>
  728. </if>
  729. <if test="gatepostName != null">
  730. and
  731. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  732. "gatepostName" like '%${item}%'
  733. </foreach>
  734. </if>
  735. <if test="orderNumber != null">
  736. and
  737. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  738. "orderNumber" like '%${item}%'
  739. </foreach>
  740. </if>
  741. <if test="capacityNumber != null">
  742. and
  743. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  744. "capacityNumber" like '%${item}%'
  745. </foreach>
  746. </if>
  747. <if test="shipperName != null">
  748. and
  749. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  750. "shipperName" like '%${item}%'
  751. </foreach>
  752. </if>
  753. <if test="resultEntryMode != null">
  754. and
  755. <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
  756. "resultEntryMode" like '%${item}%'
  757. </foreach>
  758. </if>
  759. <if test="resultEntryGateTime != null">
  760. and
  761. <foreach collection="resultEntryGateTime" item="item" open="(" separator="or" close=")">
  762. "resultEntryGateTime" like '%${item}%'
  763. </foreach>
  764. </if>
  765. <if test="supplierName != null">
  766. and
  767. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  768. "supplierName" like '%${item}%'
  769. </foreach>
  770. </if>
  771. </where>
  772. <include refid="orderByEnterTime"></include>
  773. </select>
  774. <select id="ads">
  775. </select>
  776. <select id="getMaterial" parameterType="int" resultType="java.util.Map">
  777. SELECT RM.MATERIAL_NAME "materialName",
  778. CONCAT(CONCAT(RM.MATERIAL_SPECIFICATION, '('), CONCAT(RM.MATERIAL_MODEL, ')')) "specificationModel",
  779. OM.ORDER_MATERIAL_NUMBER "orderMaterialNumber",
  780. OM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight"
  781. FROM OMSTRUCK_ORDER OO
  782. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OM
  783. ON OO.ORDER_ID = OM.ORDER_ID
  784. LEFT JOIN RMS_MATERIAL RM
  785. ON OM.MATERIAL_ID = RM.MATERIAL_ID
  786. WHERE OO.ORDER_ID = #{orderId}
  787. </select>
  788. <!-- APP查询进厂实绩 -->
  789. <select id="getEnfactoryResultList" resultType="java.util.Map">
  790. SELECT OO.ORDER_NUMBER AS "orderNumber",
  791. TER.RESULT_ENTRY_GATE_TIME AS "resultEntryGateTime",
  792. RC.CAPACITY_NUMBER AS "capacityNumber"
  793. FROM OMSTRUCK_ORDER OO
  794. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  795. ON TTR.ORDER_ID = OO.ORDER_ID
  796. LEFT JOIN TMSTRUCK_ENFACTORY_RESULT TER
  797. ON TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  798. LEFT JOIN RMS_CAPACITY RC
  799. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  800. -- WHERE TER
  801. </select>
  802. <!-- APP通过运输订单id查询进厂实绩 -->
  803. <select id="getEnfactoryMessageByOrderId" parameterType="java.lang.String" resultType="java.util.Map">
  804. SELECT OO.ORDER_NUMBER AS "orderNumber",
  805. RCA.CAPACITY_NUMBER AS "capacityNumber"
  806. FROM OMSTRUCK_ORDER OO
  807. LEFT JOIN RMS_CAPACITY RCA
  808. ON RCA.CAPACITY_ID = OO.CAPACITY_ID
  809. WHERE OO.ORDER_NUMBER = #{orderNumber}
  810. </select>
  811. <!-- 查询内转钢材到异地库进厂实绩 -->
  812. <select id="getSteelNZEnFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
  813. SELECT *
  814. FROM (
  815. SELECT
  816. OO.ORDER_ID "orderId",
  817. AROD.DAYPLAN_NO "dayplanNo",
  818. OO.ORDER_NUMBER "orderNumber",
  819. RG.GATEPOST_NAME "gatepostName",
  820. TER.RESULT_ENTRY_MODE "resultEntryMode",
  821. RC.CAPACITY_NUMBER "capacityNumber",
  822. TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
  823. RS.SHIPPER_NAME "shipperName",
  824. RW.WAREHOUSE_NAME "warehouseName"
  825. FROM OMSTRUCK_ORDER OO
  826. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  827. ON TTR.ORDER_ID = OO.ORDER_ID
  828. LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
  829. ON AROD.DAYPLAN_ID = OO.ORDER_PLAN_ID
  830. LEFT JOIN TMSTRUCK_ENFACTORY_RESULT TER
  831. ON TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  832. LEFT JOIN RMS_GATEPOST RG
  833. ON RG.GATEPOST_ID = TER.GATEPOST_ID
  834. LEFT JOIN RMS_SHIPPER RS
  835. ON RS.SHIPPER_ID = AROD.SHIPPER_ID
  836. LEFT JOIN RMS_WAREHOUSE RW
  837. ON RW.WAREHOUSE_ID = AROD.RECEIVING_UNIT_ID
  838. LEFT JOIN RMS_CAPACITY RC
  839. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  840. WHERE OO.ORDER_TYPE = 4
  841. AND TER.RESULT_ENTRY_GATE_TIME IS NOT NULL
  842. )
  843. <where>
  844. <if test="dayplanNo != null">
  845. <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
  846. "dayplanNo" like '%${item}%'
  847. </foreach>
  848. </if>
  849. <if test="orderNumber != null">
  850. and
  851. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  852. "orderNumber" like '%${item}%'
  853. </foreach>
  854. </if>
  855. <if test="gatepostName != null">
  856. and
  857. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  858. "gatepostName" like '%${item}%'
  859. </foreach>
  860. </if>
  861. <if test="resultEntryMode != null">
  862. and
  863. <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
  864. "resultEntryMode" like '%${item}%'
  865. </foreach>
  866. </if>
  867. <if test="capacityNumber != null">
  868. and
  869. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  870. "capacityNumber" like '%${item}%'
  871. </foreach>
  872. </if>
  873. <if test="resultEntryGateTime != null">
  874. and
  875. <foreach collection="resultEntryGateTime" item="item" open="(" separator="or" close=")">
  876. "resultEntryGateTime" like '%${item}%'
  877. </foreach>
  878. </if>
  879. <if test="shipperName != null">
  880. and
  881. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  882. "shipperName" like '%${item}%'
  883. </foreach>
  884. </if>
  885. <if test="warehouseName != null">
  886. and
  887. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  888. "warehouseName" like '%${item}%'
  889. </foreach>
  890. </if>
  891. </where>
  892. <include refid="orderByEnterTime"></include>
  893. </select>
  894. <!-- 查询内转国产矿进口矿 进厂实绩 -->
  895. <select id="getImportedDomesticNzLoadResult" parameterType="java.util.Map" resultType="java.util.Map">
  896. select *
  897. from (
  898. select TER.RESULT_ID "resultId",
  899. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  900. RM.MATERIAL_NAME "materialName",
  901. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  902. OO.ORDER_NUMBER "orderNumber",
  903. RC.CAPACITY_NUMBER "capacityNumber",
  904. RG.GATEPOST_NAME "gatepostName",
  905. TER.RESULT_ENTRY_MODE "resultEntryMode",
  906. TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
  907. RS.SUPPLIER_NAME "supplierName",
  908. OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
  909. TER.INSERT_TIME "insertTime",
  910. RCON.CONSIGNEE_COMPANY_NAME "consigneeCompanyName"
  911. from TMSTRUCK_ENFACTORY_RESULT TER
  912. left join TMSTRUCK_TOTAL_RESULT TTR
  913. on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  914. left join OMSTRUCK_ORDER OO
  915. on TTR.ORDER_ID = OO.ORDER_ID
  916. left join AMS_PURCHASE_ORDER APO
  917. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  918. left join DIL_BATCH DB
  919. on DB.BATCH_ID = APO.BATCH_ID
  920. left join RMS_CAPACITY RC
  921. on RC.CAPACITY_ID = OO.CAPACITY_ID
  922. left join RMS_SUPPLIER RS
  923. on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
  924. left join RMS_CONSIGNEE RCON
  925. on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
  926. left join OMSTRUCK_ORDER_MATERIAL OOM
  927. on OOM.ORDER_ID = OO.ORDER_ID
  928. left join RMS_MATERIAL RM
  929. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  930. left join RMS_GATEPOST RG
  931. on RG.GATEPOST_ID = TER.GATEPOST_ID
  932. where TER.RESULT_ENTRY_GATE_TIME is not null
  933. and OO.ORDER_TYPE = 9
  934. )
  935. <where>
  936. <if test="purchaseOrderId != null">
  937. <foreach collection="purchaseOrderId" item="item" open="(" separator="or" close=")">
  938. "purchaseOrderId" like '%${item}%'
  939. </foreach>
  940. </if>
  941. <if test="materialName != null">
  942. and
  943. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  944. "materialName" like '%${item}%'
  945. </foreach>
  946. </if>
  947. <if test="resultForeignShipName != null">
  948. and
  949. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  950. "resultForeignShipName" like '%${item}%'
  951. </foreach>
  952. </if>
  953. <if test="orderNumber != null">
  954. and
  955. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  956. "orderNumber" like '%${item}%'
  957. </foreach>
  958. </if>
  959. <if test="capacityNumber != null">
  960. and
  961. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  962. "capacityNumber" like '%${item}%'
  963. </foreach>
  964. </if>
  965. <if test="warehouseName != null">
  966. and
  967. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  968. "warehouseName" like '%${item}%'
  969. </foreach>
  970. </if>
  971. <if test="resultEntryMode != null">
  972. and
  973. <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
  974. "resultEntryMode" like '%${item}%'
  975. </foreach>
  976. </if>
  977. <if test="supplierName != null">
  978. and
  979. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  980. "supplierName" like '%${item}%'
  981. </foreach>
  982. </if>
  983. <if test="orderMaterialWeight != null">
  984. and
  985. <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
  986. "orderMaterialWeight" like '%${item}%'
  987. </foreach>
  988. </if>
  989. </where>
  990. <include refid="orderByEnterTime"></include>
  991. </select>
  992. <!-- 查询内转厂内物资进厂实绩 -->
  993. <select id="getInFactoryMaterialEnFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
  994. select *
  995. from (
  996. select TER.RESULT_ID "resultId",
  997. RM.MATERIAL_NAME "materialName",
  998. OO.ORDER_NUMBER "orderNumber",
  999. RC.CAPACITY_NUMBER "capacityNumber",
  1000. RG.GATEPOST_NAME "gatepostName",
  1001. TER.RESULT_ENTRY_MODE "resultEntryMode",
  1002. TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
  1003. OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
  1004. RW1.WAREHOUSE_NAME "loadingName",
  1005. RW2.WAREHOUSE_NAME "unloadingName"
  1006. from TMSTRUCK_ENFACTORY_RESULT TER
  1007. left join TMSTRUCK_TOTAL_RESULT TTR
  1008. on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1009. LEFT JOIN TMSTRUCK_LOAD_RESULT TLR
  1010. ON TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1011. LEFT JOIN TMSTRUCK_UNLOAD_RESULT TUR
  1012. ON TUR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1013. LEFT JOIN RMS_WAREHOUSE RW1
  1014. ON RW1.WAREHOUSE_ID = TLR.LOADING_ID
  1015. LEFT JOIN RMS_WAREHOUSE RW2
  1016. ON RW2.WAREHOUSE_ID = TUR.RESULT_UNLOAD_PLACE_ID
  1017. left join OMSTRUCK_ORDER OO
  1018. on TTR.ORDER_ID = OO.ORDER_ID
  1019. left join RMS_CAPACITY RC
  1020. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1021. left join OMSTRUCK_ORDER_MATERIAL OOM
  1022. on OOM.ORDER_ID = OO.ORDER_ID
  1023. left join RMS_MATERIAL RM
  1024. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  1025. left join RMS_GATEPOST RG
  1026. on RG.GATEPOST_ID = TER.GATEPOST_ID
  1027. where TER.RESULT_ENTRY_GATE_TIME is not null
  1028. and OO.ORDER_TYPE = 11
  1029. )
  1030. <where>
  1031. <if test="materialName != null">
  1032. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1033. "materialName" like '%${item}%'
  1034. </foreach>
  1035. </if>
  1036. <if test="loadingName != null">
  1037. and
  1038. <foreach collection="loadingName" item="item" open="(" separator="or" close=")">
  1039. "loadingName" like '%${item}%'
  1040. </foreach>
  1041. </if>
  1042. <if test="orderNumber != null">
  1043. and
  1044. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1045. "orderNumber" like '%${item}%'
  1046. </foreach>
  1047. </if>
  1048. <if test="capacityNumber != null">
  1049. and
  1050. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1051. "capacityNumber" like '%${item}%'
  1052. </foreach>
  1053. </if>
  1054. <if test="unloadingName != null">
  1055. and
  1056. <foreach collection="unloadingName" item="item" open="(" separator="or" close=")">
  1057. "unloadingName" like '%${item}%'
  1058. </foreach>
  1059. </if>
  1060. <if test="resultEntryMode != null">
  1061. and
  1062. <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
  1063. "resultEntryMode" like '%${item}%'
  1064. </foreach>
  1065. </if>
  1066. <if test="orderMaterialWeight != null">
  1067. and
  1068. <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
  1069. "orderMaterialWeight" like '%${item}%'
  1070. </foreach>
  1071. </if>
  1072. <if test="loadingName != null">
  1073. and
  1074. <foreach collection="loadingName" item="item" open="(" separator="or" close=")">
  1075. "loadingName" like '%${item}%'
  1076. </foreach>
  1077. </if>
  1078. <if test="resultEntryGateTime != null">
  1079. and
  1080. <foreach collection="resultEntryGateTime" item="item" open="(" separator="or" close=")">
  1081. "resultEntryGateTime" like '%${item}%'
  1082. </foreach>
  1083. </if>
  1084. </where>
  1085. <include refid="orderByEnterTime"></include>
  1086. </select>
  1087. <select id="getBillOrder" parameterType="java.lang.String" resultType="java.util.Map">
  1088. select
  1089. oo.order_number "orderNumber",
  1090. rc.capacity_number "capacityNumber",
  1091. rce.consignee_company_name "consigeeName",
  1092. rcr.carrier_name "carrierName",
  1093. TO_CHAR(SYSDATE,'YYYY-MM-DD') "billDate"
  1094. from omstruck_order oo
  1095. left join
  1096. rms_capacity rc
  1097. on
  1098. rc.capacity_id = oo.capacity_id
  1099. left join
  1100. ams_sale_order_material asom
  1101. on
  1102. asom.sale_order_material_id = oo.order_plan_id
  1103. left join
  1104. ams_sale_order aso
  1105. on
  1106. aso.sale_order_id = asom.sale_order_id
  1107. left join
  1108. rms_consignee rce
  1109. on
  1110. rce.consignee_id = aso.receive_id
  1111. left join
  1112. ams_dispatch_sale_order adso
  1113. on
  1114. adso.sale_order_material_id = asom.sale_order_material_id
  1115. left join
  1116. rms_carrier rcr
  1117. on
  1118. rcr.carrier_id = adso.carrier_id
  1119. where oo.order_number = #{orderNumber}
  1120. </select>
  1121. <select id="getBillOrderMaterial" parameterType="java.lang.String" resultType="java.util.Map" >
  1122. select
  1123. rm.material_name "materialName",
  1124. rm.material_specification "materialSpe",
  1125. rm.material_model "materialModel",
  1126. oom.order_material_number "materialNumber",
  1127. oom.order_material_weight "materialWeight"
  1128. from omstruck_order oo
  1129. left join
  1130. omstruck_order_material oom
  1131. on
  1132. oom.order_id = oo.order_id
  1133. left join
  1134. rms_material rm
  1135. on
  1136. rm.material_id = oom.order_material_id
  1137. where oo.order_number = #{orderNumber}
  1138. </select>
  1139. <!-- 通过id获取零星物资id-->
  1140. <select id="getSporadicSuppliesEnFactoryResult" parameterType="java.util.Map" resultType="java.util.Map">
  1141. select *
  1142. from (
  1143. select TER.RESULT_ID "resultId",
  1144. OO.ORDER_ID "orderId",
  1145. OO.ORDER_NUMBER "orderNumber",
  1146. RC.CAPACITY_NUMBER "capacityNumber",
  1147. RG.GATEPOST_NAME "gatepostName",
  1148. TER.RESULT_ENTRY_MODE "resultEntryMode",
  1149. TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
  1150. RM.MATERIAL_NAME "materialName",
  1151. OOM.ORDER_MATERIAL_NUMBER "materialNumber",
  1152. OOM.ORDER_MATERIAL_WEIGHT "materialWeight"
  1153. from TMSTRUCK_ENFACTORY_RESULT TER
  1154. left join TMSTRUCK_TOTAL_RESULT TTR
  1155. on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1156. left join OMSTRUCK_ORDER OO
  1157. on TTR.ORDER_ID = OO.ORDER_ID
  1158. left join OMSTRUCK_ORDER_MATERIAL OOM
  1159. ON OOM.ORDER_ID=OO.ORDER_ID
  1160. left join RMS_MATERIAL RM
  1161. ON RM.MATERIAL_ID=OOM.MATERIAL_ID
  1162. left join AMSTRUCK_SPORADIC_ORDER ASO
  1163. on OO.ORDER_PLAN_ID = ASO.SPORADIC_ORDER_ID
  1164. left join RMS_GATEPOST RG
  1165. on RG.GATEPOST_ID = TER.GATEPOST_ID
  1166. left join RMS_CAPACITY RC
  1167. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1168. WHERE OO.ORDER_TYPE = #{orderTypee}
  1169. )
  1170. <where>
  1171. <if test="orderNumber != null">
  1172. and
  1173. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1174. "orderNumber" like '%${item}%'
  1175. </foreach>
  1176. </if>
  1177. <if test="capacityNumber != null">
  1178. and
  1179. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1180. "capacityNumber" like '%${item}%'
  1181. </foreach>
  1182. </if>
  1183. <if test="gatepostName != null">
  1184. and
  1185. <foreach collection="gatepostName" item="item" open="(" separator="or" close=")">
  1186. "capacityNumber" like '%${item}%'
  1187. </foreach>
  1188. </if>
  1189. <if test="gatepostName != null">
  1190. and
  1191. <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
  1192. "resultEntryMode" like '%${item}%'
  1193. </foreach>
  1194. </if>
  1195. <if test="resultEntryGateTime != null">
  1196. and
  1197. <foreach collection="resultEntryGateTime" item="item" open="(" separator="or" close=")">
  1198. "resultEntryGateTime" like '%${item}%'
  1199. </foreach>
  1200. </if>
  1201. </where>
  1202. <include refid="orderByEnterTime"></include>
  1203. </select>
  1204. <select id="getCGNZEnFactory" resultType="java.util.Map" parameterType="map">
  1205. select
  1206. *
  1207. from(
  1208. select TER.RESULT_ID "resultId",
  1209. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  1210. RM.MATERIAL_NAME "materialName",
  1211. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  1212. OO.ORDER_NUMBER "orderNumber",
  1213. RC.CAPACITY_NUMBER "capacityNumber",
  1214. RG.GATEPOST_NAME "gatepostName",
  1215. TER.RESULT_ENTRY_MODE "resultEntryMode",
  1216. TER.RESULT_ENTRY_GATE_TIME "resultEntryGateTime",
  1217. RS.SUPPLIER_NAME "supplierName",
  1218. OOM.ORDER_MATERIAL_WEIGHT "orderMaterialWeight",
  1219. TER.INSERT_TIME "insertTime",
  1220. RCON.CONSIGNEE_COMPANY_NAME "consigneeCompanyName"
  1221. from TMSTRUCK_ENFACTORY_RESULT TER
  1222. left join TMSTRUCK_TOTAL_RESULT TTR
  1223. on TER.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  1224. left join OMSTRUCK_ORDER OO
  1225. on TTR.ORDER_ID = OO.ORDER_ID
  1226. left join amstruck_inward_plan aip
  1227. on aip.plan_id = oo.order_plan_id
  1228. left join amstruck_requirement_plan arp
  1229. on arp.plan_id = aip.plan_id
  1230. left join amstruck_inward_requirement air
  1231. on air.requirement_id = arp.requirement_id
  1232. left join AMS_PURCHASE_ORDER APO
  1233. on apo.purchase_order_id = air.purchase_order_id
  1234. left join DIL_BATCH DB
  1235. on DB.BATCH_ID = APO.BATCH_ID
  1236. left join RMS_CAPACITY RC
  1237. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1238. left join RMS_SUPPLIER RS
  1239. on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
  1240. left join RMS_CONSIGNEE RCON
  1241. on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
  1242. left join OMSTRUCK_ORDER_MATERIAL OOM
  1243. on OOM.ORDER_ID = OO.ORDER_ID
  1244. left join RMS_MATERIAL RM
  1245. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  1246. left join RMS_GATEPOST RG
  1247. on RG.GATEPOST_ID = TER.GATEPOST_ID
  1248. where TER.RESULT_ENTRY_GATE_TIME is not null
  1249. and OO.ORDER_TYPE = 10
  1250. )
  1251. <where>
  1252. <if test="purchaseOrderId != null">
  1253. <foreach collection="purchaseOrderId" item="item" open="(" separator="or" close=")">
  1254. "purchaseOrderId" like '%${item}%'
  1255. </foreach>
  1256. </if>
  1257. <if test="materialName != null">
  1258. and
  1259. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  1260. "materialName" like '%${item}%'
  1261. </foreach>
  1262. </if>
  1263. <if test="resultForeignShipName != null">
  1264. and
  1265. <foreach collection="resultForeignShipName" item="item" open="(" separator="or" close=")">
  1266. "resultForeignShipName" like '%${item}%'
  1267. </foreach>
  1268. </if>
  1269. <if test="orderNumber != null">
  1270. and
  1271. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  1272. "orderNumber" like '%${item}%'
  1273. </foreach>
  1274. </if>
  1275. <if test="capacityNumber != null">
  1276. and
  1277. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  1278. "capacityNumber" like '%${item}%'
  1279. </foreach>
  1280. </if>
  1281. <if test="warehouseName != null">
  1282. and
  1283. <foreach collection="warehouseName" item="item" open="(" separator="or" close=")">
  1284. "warehouseName" like '%${item}%'
  1285. </foreach>
  1286. </if>
  1287. <if test="resultEntryMode != null">
  1288. and
  1289. <foreach collection="resultEntryMode" item="item" open="(" separator="or" close=")">
  1290. "resultEntryMode" like '%${item}%'
  1291. </foreach>
  1292. </if>
  1293. <if test="supplierName != null">
  1294. and
  1295. <foreach collection="supplierName" item="item" open="(" separator="or" close=")">
  1296. "supplierName" like '%${item}%'
  1297. </foreach>
  1298. </if>
  1299. <if test="orderMaterialWeight != null">
  1300. and
  1301. <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
  1302. "orderMaterialWeight" like '%${item}%'
  1303. </foreach>
  1304. </if>
  1305. </where>
  1306. <include refid="orderByEnterTime"></include>
  1307. </select>
  1308. <select id="getCgNzOutFactory" resultType="java.util.Map">
  1309. select TLFR.RESULT_ID "resultId",
  1310. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  1311. RM.MATERIAL_NAME "materialName",
  1312. DB.RESULT_FOREIGN_SHIP_NAME "resultForeignShipName",
  1313. OO.ORDER_NUMBER "orderNumber",
  1314. RC.CAPACITY_NUMBER "capacityNumber",
  1315. RG.GATEPOST_NAME "gatepostName",
  1316. TLFR.RESULT_OUT_MODE "resultOutMode",
  1317. TLFR.RESULT_OUT_GATE_TIME "resultOutGateTime",
  1318. TLFR.RESULT_TRUCK_SNAPSHOT_PICTURE "resultTruckSnapshotPicture"
  1319. from TMSTRUCK_LEAVE_FACTORY_RESULT TLFR
  1320. left join TMSTRUCK_TOTAL_RESULT TTR
  1321. on TTR.RESULT_TOTAL_ID = TLFR.RESULT_TOTAL_ID
  1322. left join OMSTRUCK_ORDER OO
  1323. on OO.ORDER_ID = TTR.ORDER_ID
  1324. left join amstruck_inward_plan aip
  1325. on aip.plan_id = oo.order_plan_id
  1326. left join amstruck_requirement_plan arp
  1327. on arp.plan_id = aip.plan_id
  1328. left join amstruck_inward_requirement air
  1329. on air.requirement_id = arp.requirement_id
  1330. left join AMS_PURCHASE_ORDER APO
  1331. on APO.PURCHASE_ORDER_ID = air.PURCHASE_ORDER_ID
  1332. left join DIL_BATCH DB
  1333. on DB.BATCH_ID = APO.BATCH_ID
  1334. left join OMSTRUCK_ORDER_MATERIAL OOM
  1335. on OOM.ORDER_ID = OO.ORDER_ID
  1336. left join RMS_MATERIAL RM
  1337. on RM.MATERIAL_ID = OOM.MATERIAL_ID
  1338. left join RMS_CAPACITY RC
  1339. on RC.CAPACITY_ID = OO.CAPACITY_ID
  1340. left join RMS_GATEPOST RG
  1341. on RG.GATEPOST_ID = TLFR.GATEPOST_ID
  1342. where RESULT_OUT_GATE_TIME is not null
  1343. and OO.ORDER_TYPE = 10
  1344. order by tlfr.result_out_gate_time
  1345. </select>
  1346. </mapper>