TmstruckLoadResultMapper.xml 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977
  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.TmstruckLoadResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckLoadResult">
  5. <id column="RESULT_ID" jdbcType="DECIMAL" property="resultId"/>
  6. <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId"/>
  7. <result column="RESULT_LOAD_START_TIME" jdbcType="TIMESTAMP" property="resultLoadStartTime"/>
  8. <result column="RESULT_LOAD_END_TIME" jdbcType="TIMESTAMP" property="resultLoadEndTime"/>
  9. <result column="RESULT_LOAD_DURATION" jdbcType="DECIMAL" property="resultLoadDuration"/>
  10. <result column="LOAD_STANDARD_TIME_ID" jdbcType="DECIMAL" property="loadStandardTimeId"/>
  11. <result column="LOADER_ID" jdbcType="DECIMAL" property="loaderId"/>
  12. <result column="RESULT_ISCLEAR" jdbcType="VARCHAR" property="resultIsclear"/>
  13. <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName"/>
  14. <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime"/>
  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="STATUS" jdbcType="DECIMAL" property="status"/>
  21. <result column="RESULT_MEASURED_TONNAGE" jdbcType="DECIMAL" property="resultMeasuredTonnage"/>
  22. <result column="LOADING_ID" jdbcType="DECIMAL" property="loadingId"/>
  23. <result column="MATERIAL_ID" jdbcType="DECIMAL" property="materialId"/>
  24. </resultMap>
  25. <sql id="columns">
  26. RESULT_ID, RESULT_TOTAL_ID, RESULT_LOAD_START_TIME, RESULT_LOAD_END_TIME, RESULT_LOAD_DURATION,
  27. LOAD_STANDARD_TIME_ID, LOADER_ID, RESULT_ISCLEAR, DELETE_NAME, DELETE_TIME, INSERT_USERNAME,
  28. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, STATUS, RESULT_MEASURED_TONNAGE,
  29. LOADING_ID, MATERIAL_ID
  30. </sql>
  31. <sql id="columns_alias">
  32. t.RESULT_ID, t.RESULT_TOTAL_ID, t.RESULT_LOAD_START_TIME, t.RESULT_LOAD_END_TIME,
  33. t.RESULT_LOAD_DURATION, t.LOAD_STANDARD_TIME_ID, t.LOADER_ID, t.RESULT_ISCLEAR, t.DELETE_NAME,
  34. t.DELETE_TIME, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME,
  35. t.INSERT_UPDATE_REMARK, t.STATUS, t.RESULT_MEASURED_TONNAGE, t.LOADING_ID, t.MATERIAL_ID
  36. </sql>
  37. <sql id="select">
  38. SELECT
  39. <include refid="columns"/>
  40. FROM TMSTRUCK_LOAD_RESULT
  41. </sql>
  42. <sql id="select_alias">
  43. SELECT
  44. <include refid="columns_alias"/>
  45. FROM TMSTRUCK_LOAD_RESULT t
  46. </sql>
  47. <sql id="where">
  48. <where>
  49. <if test="resultId != null">
  50. and RESULT_ID = #{resultId}
  51. </if>
  52. <if test="resultTotalId != null">
  53. and RESULT_TOTAL_ID = #{resultTotalId}
  54. </if>
  55. <if test="resultLoadStartTime != null">
  56. and TO_CHAR(RESULT_LOAD_START_TIME,'yyyy-MM-dd') = #{resultLoadStartTime}
  57. </if>
  58. <if test="resultLoadEndTime != null">
  59. and TO_CHAR(RESULT_LOAD_END_TIME,'yyyy-MM-dd') = #{resultLoadEndTime}
  60. </if>
  61. <if test="resultLoadDuration != null">
  62. and RESULT_LOAD_DURATION = #{resultLoadDuration}
  63. </if>
  64. <if test="loadStandardTimeId != null">
  65. and LOAD_STANDARD_TIME_ID = #{loadStandardTimeId}
  66. </if>
  67. <if test="loaderId != null">
  68. and LOADER_ID = #{loaderId}
  69. </if>
  70. <if test="resultIsclear != null and resultIsclear != ''">
  71. and RESULT_ISCLEAR = #{resultIsclear}
  72. </if>
  73. <if test="deleteName != null and deleteName != ''">
  74. and DELETE_NAME = #{deleteName}
  75. </if>
  76. <if test="deleteTime != null">
  77. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  78. </if>
  79. <if test="insertUsername != null and insertUsername != ''">
  80. and INSERT_USERNAME = #{insertUsername}
  81. </if>
  82. <if test="insertTime != null">
  83. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  84. </if>
  85. <if test="updateUsername != null and updateUsername != ''">
  86. and UPDATE_USERNAME = #{updateUsername}
  87. </if>
  88. <if test="updateTime != null">
  89. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  90. </if>
  91. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  92. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  93. </if>
  94. <if test="status != null">
  95. and STATUS = #{status}
  96. </if>
  97. <if test="resultMeasuredTonnage != null">
  98. and RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage}
  99. </if>
  100. <if test="loadingId != null">
  101. and LOADING_ID = #{loadingId}
  102. </if>
  103. <if test="materialId != null">
  104. and MATERIAL_ID = #{materialId}
  105. </if>
  106. </where>
  107. </sql>
  108. <sql id="whereLike">
  109. <where>
  110. <if test="resultId != null">
  111. and RESULT_ID = #{resultId}
  112. </if>
  113. <if test="resultTotalId != null">
  114. and RESULT_TOTAL_ID = #{resultTotalId}
  115. </if>
  116. <if test="resultLoadStartTime != null">
  117. and TO_CHAR(RESULT_LOAD_START_TIME,'yyyy-MM-dd') = #{resultLoadStartTime}
  118. </if>
  119. <if test="resultLoadEndTime != null">
  120. and TO_CHAR(RESULT_LOAD_END_TIME,'yyyy-MM-dd') = #{resultLoadEndTime}
  121. </if>
  122. <if test="resultLoadDuration != null">
  123. and RESULT_LOAD_DURATION = #{resultLoadDuration}
  124. </if>
  125. <if test="loadStandardTimeId != null">
  126. and LOAD_STANDARD_TIME_ID = #{loadStandardTimeId}
  127. </if>
  128. <if test="loaderId != null">
  129. and LOADER_ID = #{loaderId}
  130. </if>
  131. <if test="resultIsclear != null and resultIsclear != ''">
  132. and RESULT_ISCLEAR LIKE '%${resultIsclear}%'
  133. </if>
  134. <if test="deleteName != null and deleteName != ''">
  135. and DELETE_NAME LIKE '%${deleteName}%'
  136. </if>
  137. <if test="deleteTime != null">
  138. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  139. </if>
  140. <if test="insertUsername != null and insertUsername != ''">
  141. and INSERT_USERNAME LIKE '%${insertUsername}%'
  142. </if>
  143. <if test="insertTime != null">
  144. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  145. </if>
  146. <if test="updateUsername != null and updateUsername != ''">
  147. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  148. </if>
  149. <if test="updateTime != null">
  150. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  151. </if>
  152. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  153. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  154. </if>
  155. <if test="status != null">
  156. and STATUS = #{status}
  157. </if>
  158. <if test="resultMeasuredTonnage != null">
  159. and RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage}
  160. </if>
  161. <if test="loadingId != null">
  162. and LOADING_ID = #{loadingId}
  163. </if>
  164. <if test="materialId != null">
  165. and MATERIAL_ID = #{materialId}
  166. </if>
  167. </where>
  168. </sql>
  169. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  170. delete
  171. from TMSTRUCK_LOAD_RESULT
  172. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  173. </delete>
  174. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  175. delete from TMSTRUCK_LOAD_RESULT
  176. where 1!=1
  177. <if test="resultTotalId != null">
  178. or RESULT_TOTAL_ID = #{resultTotalId}
  179. </if>
  180. <if test="resultLoadStartTime != null">
  181. or TO_CHAR(RESULT_LOAD_START_TIME,'yyyy-MM-dd') = '#{resultLoadStartTime}'
  182. </if>
  183. <if test="resultLoadEndTime != null">
  184. or TO_CHAR(RESULT_LOAD_END_TIME,'yyyy-MM-dd') = '#{resultLoadEndTime}'
  185. </if>
  186. <if test="resultLoadDuration != null">
  187. or RESULT_LOAD_DURATION = #{resultLoadDuration}
  188. </if>
  189. <if test="loadStandardTimeId != null">
  190. or LOAD_STANDARD_TIME_ID = #{loadStandardTimeId}
  191. </if>
  192. <if test="loaderId != null">
  193. or LOADER_ID = #{loaderId}
  194. </if>
  195. <if test="resultIsclear != null and resultIsclear != ''">
  196. or RESULT_ISCLEAR = #{resultIsclear}
  197. </if>
  198. <if test="deleteName != null and deleteName != ''">
  199. or DELETE_NAME = #{deleteName}
  200. </if>
  201. <if test="deleteTime != null">
  202. or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
  203. </if>
  204. <if test="insertUsername != null and insertUsername != ''">
  205. or INSERT_USERNAME = #{insertUsername}
  206. </if>
  207. <if test="insertTime != null">
  208. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  209. </if>
  210. <if test="updateUsername != null and updateUsername != ''">
  211. or UPDATE_USERNAME = #{updateUsername}
  212. </if>
  213. <if test="updateTime != null">
  214. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  215. </if>
  216. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  217. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  218. </if>
  219. <if test="status != null">
  220. or STATUS = #{status}
  221. </if>
  222. <if test="resultMeasuredTonnage != null">
  223. or RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage}
  224. </if>
  225. <if test="loadingId != null">
  226. or LOADING_ID = #{loadingId}
  227. </if>
  228. <if test="materialId != null">
  229. or MATERIAL_ID = #{materialId}
  230. </if>
  231. </delete>
  232. <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
  233. insert into TMSTRUCK_LOAD_RESULT (RESULT_ID, RESULT_TOTAL_ID, RESULT_LOAD_START_TIME,
  234. RESULT_LOAD_END_TIME, RESULT_LOAD_DURATION,
  235. LOAD_STANDARD_TIME_ID, LOADER_ID, RESULT_ISCLEAR,
  236. DELETE_NAME, DELETE_TIME, INSERT_USERNAME,
  237. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
  238. INSERT_UPDATE_REMARK, STATUS, RESULT_MEASURED_TONNAGE,
  239. LOADING_ID, MATERIAL_ID)
  240. values (#{resultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL},
  241. #{resultLoadStartTime,jdbcType=TIMESTAMP},
  242. #{resultLoadEndTime,jdbcType=TIMESTAMP}, #{resultLoadDuration,jdbcType=DECIMAL},
  243. #{loadStandardTimeId,jdbcType=DECIMAL}, #{loaderId,jdbcType=DECIMAL}, #{resultIsclear,jdbcType=VARCHAR},
  244. #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP}, #{insertUsername,jdbcType=VARCHAR},
  245. #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
  246. #{insertUpdateRemark,jdbcType=VARCHAR}, #{status,jdbcType=DECIMAL},
  247. #{resultMeasuredTonnage,jdbcType=DECIMAL},
  248. #{loadingId,jdbcType=DECIMAL}, #{materialId,jdbcType=DECIMAL})
  249. </insert>
  250. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
  251. insert into TMSTRUCK_LOAD_RESULT
  252. <trim prefix="(" suffix=")" suffixOverrides=",">
  253. <if test="resultId != null">
  254. RESULT_ID,
  255. </if>
  256. <if test="resultTotalId != null">
  257. RESULT_TOTAL_ID,
  258. </if>
  259. <if test="resultLoadStartTime != null">
  260. RESULT_LOAD_START_TIME,
  261. </if>
  262. <if test="resultLoadEndTime != null">
  263. RESULT_LOAD_END_TIME,
  264. </if>
  265. <if test="resultLoadDuration != null">
  266. RESULT_LOAD_DURATION,
  267. </if>
  268. <if test="loadStandardTimeId != null">
  269. LOAD_STANDARD_TIME_ID,
  270. </if>
  271. <if test="loaderId != null">
  272. LOADER_ID,
  273. </if>
  274. <if test="resultIsclear != null">
  275. RESULT_ISCLEAR,
  276. </if>
  277. <if test="deleteName != null">
  278. DELETE_NAME,
  279. </if>
  280. <if test="deleteTime != null">
  281. DELETE_TIME,
  282. </if>
  283. <if test="insertUsername != null">
  284. INSERT_USERNAME,
  285. </if>
  286. <if test="insertTime != null">
  287. INSERT_TIME,
  288. </if>
  289. <if test="updateUsername != null">
  290. UPDATE_USERNAME,
  291. </if>
  292. <if test="updateTime != null">
  293. UPDATE_TIME,
  294. </if>
  295. <if test="insertUpdateRemark != null">
  296. INSERT_UPDATE_REMARK,
  297. </if>
  298. <if test="status != null">
  299. STATUS,
  300. </if>
  301. <if test="resultMeasuredTonnage != null">
  302. RESULT_MEASURED_TONNAGE,
  303. </if>
  304. <if test="loadingId != null">
  305. LOADING_ID,
  306. </if>
  307. <if test="materialId != null">
  308. MATERIAL_ID,
  309. </if>
  310. </trim>
  311. <trim prefix="values (" suffix=")" suffixOverrides=",">
  312. <if test="resultId != null">
  313. #{resultId,jdbcType=DECIMAL},
  314. </if>
  315. <if test="resultTotalId != null">
  316. #{resultTotalId,jdbcType=DECIMAL},
  317. </if>
  318. <if test="resultLoadStartTime != null">
  319. #{resultLoadStartTime,jdbcType=TIMESTAMP},
  320. </if>
  321. <if test="resultLoadEndTime != null">
  322. #{resultLoadEndTime,jdbcType=TIMESTAMP},
  323. </if>
  324. <if test="resultLoadDuration != null">
  325. #{resultLoadDuration,jdbcType=DECIMAL},
  326. </if>
  327. <if test="loadStandardTimeId != null">
  328. #{loadStandardTimeId,jdbcType=DECIMAL},
  329. </if>
  330. <if test="loaderId != null">
  331. #{loaderId,jdbcType=DECIMAL},
  332. </if>
  333. <if test="resultIsclear != null">
  334. #{resultIsclear,jdbcType=VARCHAR},
  335. </if>
  336. <if test="deleteName != null">
  337. #{deleteName,jdbcType=VARCHAR},
  338. </if>
  339. <if test="deleteTime != null">
  340. #{deleteTime,jdbcType=TIMESTAMP},
  341. </if>
  342. <if test="insertUsername != null">
  343. #{insertUsername,jdbcType=VARCHAR},
  344. </if>
  345. <if test="insertTime != null">
  346. #{insertTime,jdbcType=TIMESTAMP},
  347. </if>
  348. <if test="updateUsername != null">
  349. #{updateUsername,jdbcType=VARCHAR},
  350. </if>
  351. <if test="updateTime != null">
  352. #{updateTime,jdbcType=TIMESTAMP},
  353. </if>
  354. <if test="insertUpdateRemark != null">
  355. #{insertUpdateRemark,jdbcType=VARCHAR},
  356. </if>
  357. <if test="status != null">
  358. #{status,jdbcType=DECIMAL},
  359. </if>
  360. <if test="resultMeasuredTonnage != null">
  361. #{resultMeasuredTonnage,jdbcType=DECIMAL},
  362. </if>
  363. <if test="loadingId != null">
  364. #{loadingId,jdbcType=DECIMAL},
  365. </if>
  366. <if test="materialId != null">
  367. #{materialId,jdbcType=DECIMAL},
  368. </if>
  369. </trim>
  370. </insert>
  371. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
  372. update TMSTRUCK_LOAD_RESULT
  373. set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  374. RESULT_LOAD_START_TIME = #{resultLoadStartTime,jdbcType=TIMESTAMP},
  375. RESULT_LOAD_END_TIME = #{resultLoadEndTime,jdbcType=TIMESTAMP},
  376. RESULT_LOAD_DURATION = #{resultLoadDuration,jdbcType=DECIMAL},
  377. LOAD_STANDARD_TIME_ID = #{loadStandardTimeId,jdbcType=DECIMAL},
  378. LOADER_ID = #{loaderId,jdbcType=DECIMAL},
  379. RESULT_ISCLEAR = #{resultIsclear,jdbcType=VARCHAR},
  380. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  381. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  382. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  383. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  384. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  385. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  386. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  387. STATUS = #{status,jdbcType=DECIMAL},
  388. RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage,jdbcType=DECIMAL},
  389. LOADING_ID = #{loadingId,jdbcType=DECIMAL},
  390. MATERIAL_ID = #{materialId,jdbcType=DECIMAL}
  391. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  392. </update>
  393. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckLoadResult">
  394. update TMSTRUCK_LOAD_RESULT
  395. <set>
  396. <if test="resultTotalId != null">
  397. RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  398. </if>
  399. <if test="resultLoadStartTime != null">
  400. RESULT_LOAD_START_TIME = #{resultLoadStartTime,jdbcType=TIMESTAMP},
  401. </if>
  402. <if test="resultLoadEndTime != null">
  403. RESULT_LOAD_END_TIME = #{resultLoadEndTime,jdbcType=TIMESTAMP},
  404. </if>
  405. <if test="resultLoadDuration != null">
  406. RESULT_LOAD_DURATION = #{resultLoadDuration,jdbcType=DECIMAL},
  407. </if>
  408. <if test="loadStandardTimeId != null">
  409. LOAD_STANDARD_TIME_ID = #{loadStandardTimeId,jdbcType=DECIMAL},
  410. </if>
  411. <if test="loaderId != null">
  412. LOADER_ID = #{loaderId,jdbcType=DECIMAL},
  413. </if>
  414. <if test="resultIsclear != null">
  415. RESULT_ISCLEAR = #{resultIsclear,jdbcType=VARCHAR},
  416. </if>
  417. <if test="deleteName != null">
  418. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  419. </if>
  420. <if test="deleteTime != null">
  421. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  422. </if>
  423. <if test="insertUsername != null">
  424. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  425. </if>
  426. <if test="insertTime != null">
  427. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  428. </if>
  429. <if test="updateUsername != null">
  430. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  431. </if>
  432. <if test="updateTime != null">
  433. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  434. </if>
  435. <if test="insertUpdateRemark != null">
  436. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  437. </if>
  438. <if test="status != null">
  439. STATUS = #{status,jdbcType=DECIMAL},
  440. </if>
  441. <if test="resultMeasuredTonnage != null">
  442. RESULT_MEASURED_TONNAGE = #{resultMeasuredTonnage,jdbcType=DECIMAL},
  443. </if>
  444. <if test="loadingId != null">
  445. LOADING_ID = #{loadingId,jdbcType=DECIMAL},
  446. </if>
  447. <if test="materialId != null">
  448. MATERIAL_ID = #{materialId,jdbcType=DECIMAL},
  449. </if>
  450. </set>
  451. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  452. </update>
  453. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  454. <include refid="select"/>
  455. where RESULT_ID = #{resultId,jdbcType=DECIMAL}
  456. </select>
  457. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  458. <include refid="select"/>
  459. <include refid="where"/>
  460. </select>
  461. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  462. <include refid="select"/>
  463. <include refid="whereLike"/>
  464. </select>
  465. <insert id="batchInsert" parameterType="java.util.List">
  466. insert into TMSTRUCK_LOAD_RESULT
  467. (RESULT_ID,
  468. RESULT_TOTAL_ID, RESULT_LOAD_START_TIME,
  469. RESULT_LOAD_END_TIME, RESULT_LOAD_DURATION,
  470. LOAD_STANDARD_TIME_ID, LOADER_ID,
  471. RESULT_ISCLEAR, DELETE_NAME, DELETE_TIME,
  472. INSERT_USERNAME, INSERT_TIME,
  473. UPDATE_USERNAME, UPDATE_TIME,
  474. INSERT_UPDATE_REMARK, STATUS, RESULT_MEASURED_TONNAGE,
  475. LOADING_ID, MATERIAL_ID)
  476. ( <foreach collection="list" item="item" separator="union all">
  477. select
  478. #{item.resultId,jdbcType=DECIMAL},
  479. #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultLoadStartTime,jdbcType=TIMESTAMP},
  480. #{item.resultLoadEndTime,jdbcType=TIMESTAMP}, #{item.resultLoadDuration,jdbcType=DECIMAL},
  481. #{item.loadStandardTimeId,jdbcType=DECIMAL}, #{item.loaderId,jdbcType=DECIMAL},
  482. #{item.resultIsclear,jdbcType=VARCHAR}, #{item.deleteName,jdbcType=VARCHAR},
  483. #{item.deleteTime,jdbcType=TIMESTAMP},
  484. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  485. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  486. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.status,jdbcType=DECIMAL},
  487. #{item.resultMeasuredTonnage,jdbcType=DECIMAL},
  488. #{item.loadingId,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL} from dual
  489. </foreach> )
  490. </insert>
  491. <update id="batchUpdate" parameterType="java.util.List">
  492. update TMSTRUCK_LOAD_RESULT
  493. set
  494. RESULT_ID=
  495. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  496. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultId,jdbcType=DECIMAL}
  497. </foreach>
  498. ,RESULT_TOTAL_ID=
  499. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  500. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
  501. </foreach>
  502. ,RESULT_LOAD_START_TIME=
  503. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  504. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoadStartTime,jdbcType=TIMESTAMP}
  505. </foreach>
  506. ,RESULT_LOAD_END_TIME=
  507. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  508. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoadEndTime,jdbcType=TIMESTAMP}
  509. </foreach>
  510. ,RESULT_LOAD_DURATION=
  511. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  512. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultLoadDuration,jdbcType=DECIMAL}
  513. </foreach>
  514. ,LOAD_STANDARD_TIME_ID=
  515. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  516. when #{item.resultId,jdbcType=DECIMAL} then #{item.loadStandardTimeId,jdbcType=DECIMAL}
  517. </foreach>
  518. ,LOADER_ID=
  519. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  520. when #{item.resultId,jdbcType=DECIMAL} then #{item.loaderId,jdbcType=DECIMAL}
  521. </foreach>
  522. ,RESULT_ISCLEAR=
  523. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  524. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultIsclear,jdbcType=VARCHAR}
  525. </foreach>
  526. ,DELETE_NAME=
  527. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  528. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
  529. </foreach>
  530. ,DELETE_TIME=
  531. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  532. when #{item.resultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
  533. </foreach>
  534. ,INSERT_USERNAME=
  535. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  536. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  537. </foreach>
  538. ,INSERT_TIME=
  539. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  540. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  541. </foreach>
  542. ,UPDATE_USERNAME=
  543. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  544. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  545. </foreach>
  546. ,UPDATE_TIME=
  547. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  548. when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  549. </foreach>
  550. ,INSERT_UPDATE_REMARK=
  551. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  552. when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  553. </foreach>
  554. ,STATUS=
  555. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  556. when #{item.resultId,jdbcType=DECIMAL} then #{item.status,jdbcType=DECIMAL}
  557. </foreach>
  558. ,RESULT_MEASURED_TONNAGE=
  559. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  560. when #{item.resultId,jdbcType=DECIMAL} then #{item.resultMeasuredTonnage,jdbcType=DECIMAL}
  561. </foreach>
  562. ,LOADING_ID=
  563. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  564. when #{item.resultId,jdbcType=DECIMAL} then #{item.loadingId,jdbcType=DECIMAL}
  565. </foreach>
  566. ,MATERIAL_ID=
  567. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
  568. when #{item.resultId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=DECIMAL}
  569. </foreach>
  570. where RESULT_ID in
  571. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  572. #{item.resultId,jdbcType=DECIMAL}
  573. </foreach>
  574. </update>
  575. <delete id="batchDelete" parameterType="java.util.List">
  576. delete from TMSTRUCK_LOAD_RESULT
  577. where RESULT_ID in
  578. <foreach close=")" collection="list" item="id" open="(" separator=",">
  579. #{id}
  580. </foreach>
  581. </delete>
  582. <!-- 友情提示!!!-->
  583. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  584. <sql id="orderBy">
  585. <if test="orderField != null and orderField != ''">
  586. order by "${orderField}"
  587. <if test="orderType != null and orderType != ''">
  588. ${orderType}
  589. </if>
  590. </if>
  591. </sql>
  592. <!-- 获取所有装车实绩 -->
  593. <select id="getCGJKLoadResult" parameterType="java.util.Map" resultType="java.util.LinkedHashMap">
  594. select *
  595. from (
  596. select TLR.RESULT_ID "resultId",
  597. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  598. RM.MATERIAL_NAME "materialName",
  599. OO.ORDER_NUMBER "orderNumber",
  600. RC.CAPACITY_NUMBER "capacityNumber",
  601. TLR.RESULT_MEASURED_TONNAGE "resultMeasuredTonnage",
  602. TLR.RESULT_ISCLEAR "resultIsclear",
  603. TLR.RESULT_LOAD_START_TIME "resultLoadStartTime",
  604. TLR.INSERT_UPDATE_REMARK "insertUpdateRemark",
  605. TLR.INSERT_TIME "insertTime",
  606. RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
  607. RS.SUPPLIER_NAME "supplierName"
  608. from TMSTRUCK_LOAD_RESULT TLR
  609. left join TMSTRUCK_TOTAL_RESULT TTR
  610. on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  611. left join OMSTRUCK_ORDER OO
  612. on TTR.ORDER_ID = OO.ORDER_ID
  613. left join OMSTRUCK_ORDER_MATERIAL OOM
  614. on OO.ORDER_ID = OOM.ORDER_ID
  615. left join AMS_PURCHASE_ORDER APO
  616. on OO.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
  617. left join DIL_BATCH DB
  618. on DB.BATCH_ID = APO.BATCH_ID
  619. left join RMS_MATERIAL RM
  620. on OOM.MATERIAL_ID = RM.MATERIAL_ID
  621. left join RMS_DRIVER_CAPACITY RDC
  622. on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
  623. left join RMS_CAPACITY RC
  624. on RC.CAPACITY_ID = RDC.CAPACITY_ID
  625. left join RMS_SUPPLIER RS
  626. on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
  627. left join RMS_CONSIGNEE RCON
  628. on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
  629. where TLR.STATUS = #{status} and OO.ORDER_TYPE = #{orderTypee}
  630. )
  631. <where>
  632. <if test="purchaseOrderId != null">
  633. <foreach collection="purchaseOrderId" item="item" open="(" separator="or" close=")">
  634. "purchaseOrderId" like '%${item}%'
  635. </foreach>
  636. </if>
  637. <if test="materialName != null">
  638. and
  639. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  640. "materialName" like '%${item}%'
  641. </foreach>
  642. </if>
  643. <if test="orderNumber != null">
  644. and
  645. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  646. "orderNumber" like '%${item}%'
  647. </foreach>
  648. </if>
  649. <if test="capacityNumber != null">
  650. and
  651. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  652. "capacityNumber" like '%${item}%'
  653. </foreach>
  654. </if>
  655. <if test="orderMaterialWeight != null">
  656. and
  657. <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
  658. "orderMaterialWeight" like '%${item}%'
  659. </foreach>
  660. </if>
  661. <if test="resultIsclear != null">
  662. and
  663. <foreach collection="resultIsclear" item="item" open="(" separator="or" close=")">
  664. "resultIsclear" like '%${item}%'
  665. </foreach>
  666. </if>
  667. <if test="resultLoadStartTime != null">
  668. and
  669. <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
  670. "resultLoadStartTime" like '%${item}%'
  671. </foreach>
  672. </if>
  673. <if test="insertUpdateRemark != null">
  674. and
  675. <foreach collection="insertUpdateRemark" item="item" open="(" separator="or" close=")">
  676. "insertUpdateRemark" like '%${item}%'
  677. </foreach>
  678. </if>
  679. </where>
  680. <include refid="orderBy"></include>
  681. <if test="orderField == null ">
  682. order by "resultLoadStartTime" desc
  683. </if>
  684. </select>
  685. <!-- 通过Id获取装车实绩 数据 用于修改-->
  686. <select id="getLoadResultById" parameterType="int" resultType="java.util.LinkedHashMap">
  687. select TLR.RESULT_ISCLEAR "resultIsclear",
  688. TLR.RESULT_LOAD_START_TIME "resultLoadStartTime",
  689. TLR.INSERT_UPDATE_REMARK "insertUpdateRemark"
  690. from TMSTRUCK_LOAD_RESULT TLR
  691. where RESULT_ID = #{resultId}
  692. </select>
  693. <!-- 通过发站查询所属港口 -->
  694. <select id="getPortIdBySendStationId" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
  695. select RAS.OWNED_PORT_ID
  696. from RMSTRAIN_ARRIVAL_SEND RAS
  697. where RAS.ARRIVAL_ID = #{sendStationId}
  698. </select>
  699. <!-- 通过运输订单查询批次 -->
  700. <select id="getBatchIdByOrderId" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
  701. select APO.BATCH_ID
  702. from OMSTRUCK_ORDER OO
  703. left join AMS_PURCHASE_ORDER APO
  704. on APO.PURCHASE_ORDER_ID = OO.ORDER_PLAN_ID
  705. where OO.ORDER_ID = #{orderId}
  706. </select>
  707. <!--通过运输订单号查找运输订单类型-->
  708. <select id="selectOrderTypeByOrderNumber" resultType="java.lang.Integer" parameterType="java.lang.String">
  709. select OO.ORDER_TYPE "orderType"
  710. from OMSTRUCK_ORDER OO
  711. where OO.ORDER_NUMBER = #{oderNumber}
  712. </select>
  713. <!-- 根据运输订单号查找 -->
  714. <select id="selectResultIdByOrderNumber" resultType="java.lang.Integer" parameterType="java.lang.String">
  715. select WOSR.RESULT_ID "resultId"
  716. from OMSTRUCK_ORDER OO
  717. left join WMSP_OUTBOUND_RESULT WOR
  718. on OO.ORDER_ID = WOR.BILL_LADING_ID
  719. left join WMSP_OUTBOUND_SCAN_RESULT WOSR
  720. on WOSR.OUTBOUND_RESULT_ID = WOR.RESULT_ID
  721. WHERE OO.ORDER_NUMBER = #{orderNumber}
  722. and WOSR.RESULT_CHECK = 1
  723. </select>
  724. <!-- 根据实绩id查找扫描时间 -->
  725. <select id="selectLoadTimeByResultId" resultType="java.util.Map" parameterType="java.lang.Integer">
  726. select WOSR.RESULT_LOAD_TIME "loadTime"
  727. from WMSP_OUTBOUND_SCAN_RESULT WOSR
  728. where WOSR.RESULT_ID = #{resultId}
  729. </select>
  730. <!-- 根据扫描实绩id查询装卸工id -->
  731. <select id="selecLoadIdByresultId" resultType="java.lang.Integer">
  732. select WOSR.LOAD_ID "loadId"
  733. from WMSP_OUTBOUND_SCAN_RESULT WOSR
  734. where WOSR.RESULT_ID = #{resultId}
  735. </select>
  736. <!-- 销售装车实绩查询-->
  737. <select id="selectLoadResultForSale" resultType="java.util.Map" parameterType="java.lang.Integer">
  738. SELECT (SELECT ORDER_MATERIAL_NUMBER
  739. FROM OMSTRUCK_ORDER_MATERIAL OOM
  740. WHERE OOM.ORDER_ID = OO.ORDER_ID
  741. AND TLR.MATERIAL_ID = OOM.MATERIAL_ID) "orderMaterialNumber",
  742. TLR.RESULT_LOAD_START_TIME "startTime",
  743. TLR.RESULT_LOAD_END_TIME "endTime",
  744. TLR.RESULT_LOAD_DURATION "loadDuration",
  745. RM.MATERIAL_NAME "materialName",
  746. RP.PERSONNEL_NAME "name",
  747. RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
  748. OO.ORDER_NUMBER "orderNumber",
  749. ASO.SALE_NUMBER "saleNumber",
  750. RC.CAPACITY_NUMBER "capacityNumber"
  751. FROM TMSTRUCK_LOAD_RESULT TLR
  752. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON TTR.RESULT_TOTAL_ID = TLR.RESULT_TOTAL_ID
  753. LEFT JOIN OMSTRUCK_ORDER OO ON OO.ORDER_ID = TTR.ORDER_ID
  754. LEFT JOIN RMS_MATERIAL_STEEL RMS ON RMS.MATERIAL_STEEL_ID = TLR.MATERIAL_ID
  755. LEFT JOIN RMS_MATERIAL RM ON RM.MATERIAL_ID = RMS.MATERIAL_ID
  756. LEFT JOIN RMS_PERSONNEL RP ON TLR.LOADER_ID = RP.PERSONNEL_ID
  757. LEFT JOIN AMS_SALE_ORDER ASO ON OO.ORDER_PLAN_ID = ASO.SALE_ORDER_ID
  758. LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_ID = ASO.SALE_ORDER_ID
  759. LEFT JOIN RMS_CAPACITY RC ON RC.CAPACITY_ID = OO.CAPACITY_ID
  760. where TLR.STATUS = #{status}
  761. and OO.ORDER_TYPE = 1
  762. </select>
  763. <!--通过运输订单号查找物资id-->
  764. <select id="selectMaterialIdByOrderNumber" parameterType="java.lang.String" resultType="java.util.Map">
  765. SELECT
  766. OOM.MATERIAL_ID "materialId"
  767. FROM
  768. OMSTRUCK_ORDER OO
  769. LEFT JOIN OMSTRUCK_ORDER_MATERIAL OOM ON OO.ORDER_ID = OOM.ORDER_ID
  770. WHERE
  771. <if test="orderNumber != null">
  772. OO.ORDER_NUMBER = #{orderNumber}
  773. </if>
  774. <if test="orderId != null">
  775. and OO.ORDER_ID = #{orderId}
  776. </if>
  777. </select>
  778. <!-- 通过订单ID 和物资Id 查询装车实绩ID 可能会有多条-->
  779. <select id="getLoadResultIdList" parameterType="java.util.Map" resultType="java.lang.Integer">
  780. select TLR.RESULT_ID
  781. from OMSTRUCK_ORDER OO
  782. left join TMSTRUCK_TOTAL_RESULT TTR
  783. on TTR.ORDER_ID = OO.ORDER_ID
  784. left join TMSTRUCK_LOAD_RESULT TLR
  785. on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  786. where OO.ORDER_ID = #{orderId}
  787. and TLR.MATERIAL_ID = #{materialId}
  788. </select>
  789. <!--通过运输订单号查找装车实绩id-->
  790. <select id="selectLoadResultIdByOrderNumber" resultType="java.lang.Integer" parameterType="java.util.Map">
  791. SELECT TLR.RESULT_ID "loadResultId",
  792. TLR.RESULT_LOAD_START_TIME "startTime"
  793. FROM OMSTRUCK_ORDER OO
  794. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  795. ON OO.ORDER_ID = TTR.ORDER_ID
  796. LEFT JOIN TMSTRUCK_LOAD_RESULT TLR
  797. ON TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  798. WHERE OO.ORDER_NUMBER = #{orderNumber}
  799. </select>
  800. <!--内转物流查询汽车装车实绩 -->
  801. <select id="selectLoadResultForConverted" resultType="java.util.LinkedHashMap">
  802. select APO.PURCHASE_ORDER_NO "orderNo",
  803. TLR.INSERT_TIME "insertTime",
  804. RC.CAPACITY_NUMBER "capacityNumber",
  805. TLR.RESULT_MEASURED_TONNAGE "toggage",
  806. RAS.ARRIVAL_NAME "arrivelName",
  807. DB.RESULT_FOREIGN_SHIP_NAME "foreignShipName",
  808. OO.ORDER_NUMBER "orderNumber",
  809. RM.MATERIAL_NAME "materialName"
  810. from TMSTRUCK_LOAD_RESULT TLR
  811. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  812. ON TTR.RESULT_TOTAL_ID = TLR.RESULT_TOTAL_ID
  813. LEFT JOIN OMSTRUCK_ORDER OO
  814. ON OO.ORDER_ID = TTR.ORDER_ID
  815. left join AMS_PURCHASE_ORDER APO
  816. ON oo.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
  817. LEFT JOIN DIL_BATCH DB
  818. ON DB.BATCH_ID = APO.BATCH_ID
  819. LEFT JOIN RMS_MATERIAL RM
  820. ON RM.MATERIAL_ID = TLR.MATERIAL_ID
  821. LEFT JOIN RMS_CAPACITY RC
  822. ON OO.CAPACITY_ID = RC.CAPACITY_ID
  823. LEFT JOIN TMSTRAIN_LOADING_RESULT TLR2
  824. ON TLR2.PURCHASE_ORDER_RAIL_PLAN_ID = OO.ORDER_PLAN_ID
  825. LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS
  826. ON RAS.ARRIVAL_ID = TLR.LOADING_ID
  827. </select>
  828. <!-- 根据实绩id渲染数据 -->
  829. <select id="selectLoadResultByResultId" resultType="java.lang.Integer">
  830. SELECT TLR.LOADING_ID "loadingId",
  831. TLR.MATERIAL_ID "materialId",
  832. TLR.RESULT_TOTAL_ID "totalId"
  833. FROM TMSTRUCK_LOAD_RESULT TLR
  834. WHERE TLR.RESULT_ID = #{resultId}
  835. </select>
  836. <!--通过车牌号号查找物资id和运力id以及总实绩id-->
  837. <select id="selectMaterialIdAndCapacityId" resultType="java.util.Map" parameterType="java.lang.Integer">
  838. select OOM.MATERIAL_ID "materialId",
  839. OO.CAPACITY_ID "capacityId",
  840. TTR.RESULT_TOTAL_ID "resultTotalId"
  841. from TMSTRUCK_TOTAL_RESULT TTR
  842. left join OMSTRUCK_ORDER OO
  843. on OO.ORDER_ID = TTR.ORDER_ID
  844. left join OMSTRUCK_ORDER_MATERIAL OOM
  845. on OOM.ORDER_ID = OO.ORDER_ID
  846. LEFT JOIN RMS_CAPACITY RC
  847. ON RC.CAPACITY_ID = OO.CAPACITY_ID
  848. where RC.CAPACITY_NUMBER = #{capacityNumber}
  849. </select>
  850. <!--根据id查找用户名 -->
  851. <select id="selectPersonNameByPersonnelId" resultType="java.lang.String" parameterType="java.lang.Integer">
  852. select RP.PERSONNEL_NAME "personnelName"
  853. from RMS_PERSONNEL RP
  854. where RP.PERSONNEL_ID = #{personnelId}
  855. </select>
  856. <select id="selectMaterialTypeByMaterialId" parameterType="java.lang.Integer" resultType="java.lang.Integer">
  857. select RMT.MATERIAL_TYPE_ID "materialTypeId"
  858. FROM RMS_MATERIAL RM
  859. LEFT JOIN RMS_MATERIAL_TYPE RMT
  860. ON RMT.MATERIAL_TYPE_ID = RM.MATERIAL_TYPE_ID
  861. where RM.MATERIAL_ID = #{materialId}
  862. </select>
  863. <!-- 查询销售装车实绩 -->
  864. <select id="getXSLoadResult" parameterType="java.util.Map" resultType="java.util.Map">
  865. select *
  866. from (
  867. select TLR.RESULT_ID "resultId",
  868. APO.PURCHASE_ORDER_NO "purchaseOrderNo",
  869. RM.MATERIAL_NAME "materialName",
  870. OO.ORDER_NUMBER "orderNumber",
  871. RC.CAPACITY_NUMBER "capacityNumber",
  872. TLR.RESULT_MEASURED_TONNAGE "resultMeasuredTonnage",
  873. TLR.RESULT_ISCLEAR "resultIsclear",
  874. TLR.RESULT_LOAD_START_TIME "resultLoadStartTime",
  875. TLR.INSERT_UPDATE_REMARK "insertUpdateRemark",
  876. TLR.INSERT_TIME "insertTime",
  877. RCON. CONSIGNEE_COMPANY_NAME "consigneeCompanyName",
  878. RS.SUPPLIER_NAME "supplierName"
  879. from TMSTRUCK_LOAD_RESULT TLR
  880. left join TMSTRUCK_TOTAL_RESULT TTR
  881. on TLR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  882. left join OMSTRUCK_ORDER OO
  883. on TTR.ORDER_ID = OO.ORDER_ID
  884. left join OMSTRUCK_ORDER_MATERIAL OOM
  885. on OO.ORDER_ID = OOM.ORDER_ID
  886. left join AMS_PURCHASE_ORDER APO
  887. on OO.ORDER_PLAN_ID = APO.PURCHASE_ORDER_ID
  888. left join DIL_BATCH DB
  889. on DB.BATCH_ID = APO.BATCH_ID
  890. left join RMS_MATERIAL RM
  891. on OOM.MATERIAL_ID = RM.MATERIAL_ID
  892. left join RMS_DRIVER_CAPACITY RDC
  893. on RDC.DRIVER_CAPACITY_ID = OO.DRIVER_CAPACITY_ID
  894. left join RMS_CAPACITY RC
  895. on RC.CAPACITY_ID = RDC.CAPACITY_ID
  896. left join RMS_SUPPLIER RS
  897. on RS.SUPPLIER_ID = APO.SUPPLIER_UNIT_ID
  898. left join RMS_CONSIGNEE RCON
  899. on RCON.CONSIGNEE_ID = APO.RECEIVE_UNIT_ID
  900. where TLR.STATUS = #{status} and OO.ORDER_TYPE = #{orderTypee}
  901. )
  902. <where>
  903. <if test="purchaseOrderId != null">
  904. <foreach collection="purchaseOrderId" item="item" open="(" separator="or" close=")">
  905. "purchaseOrderId" like '%${item}%'
  906. </foreach>
  907. </if>
  908. <if test="materialName != null">
  909. and
  910. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  911. "materialName" like '%${item}%'
  912. </foreach>
  913. </if>
  914. <if test="orderNumber != null">
  915. and
  916. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  917. "orderNumber" like '%${item}%'
  918. </foreach>
  919. </if>
  920. <if test="capacityNumber != null">
  921. and
  922. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  923. "capacityNumber" like '%${item}%'
  924. </foreach>
  925. </if>
  926. <if test="orderMaterialWeight != null">
  927. and
  928. <foreach collection="orderMaterialWeight" item="item" open="(" separator="or" close=")">
  929. "orderMaterialWeight" like '%${item}%'
  930. </foreach>
  931. </if>
  932. <if test="resultIsclear != null">
  933. and
  934. <foreach collection="resultIsclear" item="item" open="(" separator="or" close=")">
  935. "resultIsclear" like '%${item}%'
  936. </foreach>
  937. </if>
  938. <if test="resultLoadStartTime != null">
  939. and
  940. <foreach collection="resultLoadStartTime" item="item" open="(" separator="or" close=")">
  941. "resultLoadStartTime" like '%${item}%'
  942. </foreach>
  943. </if>
  944. <if test="insertUpdateRemark != null">
  945. and
  946. <foreach collection="insertUpdateRemark" item="item" open="(" separator="or" close=")">
  947. "insertUpdateRemark" like '%${item}%'
  948. </foreach>
  949. </if>
  950. </where>
  951. <include refid="orderBy"></include>
  952. <if test="orderField == null ">
  953. order by "resultLoadStartTime" desc
  954. </if>
  955. </select>
  956. </mapper>