TmstruckTimeTaskResultMapper.xml 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003
  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.TmstruckTimeTaskResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckTimeTaskResult">
  5. <id column="TIME_TASK_RESULT_ID" jdbcType="DECIMAL" property="timeTaskResultId" />
  6. <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
  7. <result column="RESULT_VALUE" jdbcType="DECIMAL" property="resultValue" />
  8. <result column="RESULT_UOM_ID" jdbcType="DECIMAL" property="resultUomId" />
  9. <result column="RESULT_TIME_TYPE" jdbcType="DECIMAL" property="resultTimeType" />
  10. <result column="RESULT_TIME" jdbcType="TIMESTAMP" property="resultTime" />
  11. <result column="RESULT_START_NODE_ID" jdbcType="DECIMAL" property="resultStartNodeId" />
  12. <result column="RESULT_START_LONGITUDE_VAL" jdbcType="VARCHAR" property="resultStartLongitudeVal" />
  13. <result column="RESULT_START_LATITUDE_VAL" jdbcType="VARCHAR" property="resultStartLatitudeVal" />
  14. <result column="RESULT_END_NODE_ID" jdbcType="DECIMAL" property="resultEndNodeId" />
  15. <result column="RESULT_END_LONGITUDE_VAL" jdbcType="VARCHAR" property="resultEndLongitudeVal" />
  16. <result column="RESULT_END_LATITUDE_VAL" jdbcType="VARCHAR" property="resultEndLatitudeVal" />
  17. <result column="RESULT_MEMO" jdbcType="VARCHAR" property="resultMemo" />
  18. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  19. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  20. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  21. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  22. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  23. <result column="DELETE_NAME" jdbcType="VARCHAR" property="deleteName" />
  24. <result column="DELETE_TIME" jdbcType="TIMESTAMP" property="deleteTime" />
  25. <result column="RESULT_ABOUT_TIME" jdbcType="VARCHAR" property="resultAboutTime" />
  26. <result column="RESULT_BALANCE_TIME" jdbcType="DECIMAL" property="resultBalanceTime" />
  27. </resultMap>
  28. <sql id="columns">
  29. TIME_TASK_RESULT_ID, RESULT_TOTAL_ID, RESULT_VALUE, RESULT_UOM_ID, RESULT_TIME_TYPE,
  30. RESULT_TIME, RESULT_START_NODE_ID, RESULT_START_LONGITUDE_VAL, RESULT_START_LATITUDE_VAL,
  31. RESULT_END_NODE_ID, RESULT_END_LONGITUDE_VAL, RESULT_END_LATITUDE_VAL, RESULT_MEMO,
  32. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  33. DELETE_NAME, DELETE_TIME, RESULT_ABOUT_TIME, RESULT_BALANCE_TIME
  34. </sql>
  35. <sql id="columns_alias">
  36. t.TIME_TASK_RESULT_ID, t.RESULT_TOTAL_ID, t.RESULT_VALUE, t.RESULT_UOM_ID, t.RESULT_TIME_TYPE,
  37. t.RESULT_TIME, t.RESULT_START_NODE_ID, t.RESULT_START_LONGITUDE_VAL, t.RESULT_START_LATITUDE_VAL,
  38. t.RESULT_END_NODE_ID, t.RESULT_END_LONGITUDE_VAL, t.RESULT_END_LATITUDE_VAL, t.RESULT_MEMO,
  39. t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK,
  40. t.DELETE_NAME, t.DELETE_TIME, t.RESULT_ABOUT_TIME, t.RESULT_BALANCE_TIME
  41. </sql>
  42. <sql id="select">
  43. SELECT <include refid="columns" /> FROM TMSTRUCK_TIME_TASK_RESULT
  44. </sql>
  45. <sql id="select_alias">
  46. SELECT <include refid="columns_alias" /> FROM TMSTRUCK_TIME_TASK_RESULT t
  47. </sql>
  48. <sql id="where">
  49. <where>
  50. <if test="timeTaskResultId != null">
  51. and TIME_TASK_RESULT_ID = #{timeTaskResultId}
  52. </if>
  53. <if test="resultTotalId != null">
  54. and RESULT_TOTAL_ID = #{resultTotalId}
  55. </if>
  56. <if test="resultValue != null">
  57. and RESULT_VALUE = #{resultValue}
  58. </if>
  59. <if test="resultUomId != null">
  60. and RESULT_UOM_ID = #{resultUomId}
  61. </if>
  62. <if test="resultTimeType != null">
  63. and RESULT_TIME_TYPE = #{resultTimeType}
  64. </if>
  65. <if test="resultTime != null">
  66. and TO_CHAR(RESULT_TIME,'yyyy-MM-dd') = #{resultTime}
  67. </if>
  68. <if test="resultStartNodeId != null">
  69. and RESULT_START_NODE_ID = #{resultStartNodeId}
  70. </if>
  71. <if test="resultStartLongitudeVal != null and resultStartLongitudeVal != ''">
  72. and RESULT_START_LONGITUDE_VAL = #{resultStartLongitudeVal}
  73. </if>
  74. <if test="resultStartLatitudeVal != null and resultStartLatitudeVal != ''">
  75. and RESULT_START_LATITUDE_VAL = #{resultStartLatitudeVal}
  76. </if>
  77. <if test="resultEndNodeId != null">
  78. and RESULT_END_NODE_ID = #{resultEndNodeId}
  79. </if>
  80. <if test="resultEndLongitudeVal != null and resultEndLongitudeVal != ''">
  81. and RESULT_END_LONGITUDE_VAL = #{resultEndLongitudeVal}
  82. </if>
  83. <if test="resultEndLatitudeVal != null and resultEndLatitudeVal != ''">
  84. and RESULT_END_LATITUDE_VAL = #{resultEndLatitudeVal}
  85. </if>
  86. <if test="resultMemo != null and resultMemo != ''">
  87. and RESULT_MEMO = #{resultMemo}
  88. </if>
  89. <if test="insertUsername != null and insertUsername != ''">
  90. and INSERT_USERNAME = #{insertUsername}
  91. </if>
  92. <if test="insertTime != null">
  93. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  94. </if>
  95. <if test="updateUsername != null and updateUsername != ''">
  96. and UPDATE_USERNAME = #{updateUsername}
  97. </if>
  98. <if test="updateTime != null">
  99. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  100. </if>
  101. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  102. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  103. </if>
  104. <if test="deleteName != null and deleteName != ''">
  105. and DELETE_NAME = #{deleteName}
  106. </if>
  107. <if test="deleteTime != null">
  108. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  109. </if>
  110. <if test="resultAboutTime != null and resultAboutTime != ''">
  111. and RESULT_ABOUT_TIME = #{resultAboutTime}
  112. </if>
  113. <if test="resultBalanceTime != null">
  114. and RESULT_BALANCE_TIME = #{resultBalanceTime}
  115. </if>
  116. </where>
  117. </sql>
  118. <sql id="whereLike">
  119. <where>
  120. <if test="timeTaskResultId != null">
  121. and TIME_TASK_RESULT_ID = #{timeTaskResultId}
  122. </if>
  123. <if test="resultTotalId != null">
  124. and RESULT_TOTAL_ID = #{resultTotalId}
  125. </if>
  126. <if test="resultValue != null">
  127. and RESULT_VALUE = #{resultValue}
  128. </if>
  129. <if test="resultUomId != null">
  130. and RESULT_UOM_ID = #{resultUomId}
  131. </if>
  132. <if test="resultTimeType != null">
  133. and RESULT_TIME_TYPE = #{resultTimeType}
  134. </if>
  135. <if test="resultTime != null">
  136. and TO_CHAR(RESULT_TIME,'yyyy-MM-dd') = #{resultTime}
  137. </if>
  138. <if test="resultStartNodeId != null">
  139. and RESULT_START_NODE_ID = #{resultStartNodeId}
  140. </if>
  141. <if test="resultStartLongitudeVal != null and resultStartLongitudeVal != ''">
  142. and RESULT_START_LONGITUDE_VAL LIKE '%${resultStartLongitudeVal}%'
  143. </if>
  144. <if test="resultStartLatitudeVal != null and resultStartLatitudeVal != ''">
  145. and RESULT_START_LATITUDE_VAL LIKE '%${resultStartLatitudeVal}%'
  146. </if>
  147. <if test="resultEndNodeId != null">
  148. and RESULT_END_NODE_ID = #{resultEndNodeId}
  149. </if>
  150. <if test="resultEndLongitudeVal != null and resultEndLongitudeVal != ''">
  151. and RESULT_END_LONGITUDE_VAL LIKE '%${resultEndLongitudeVal}%'
  152. </if>
  153. <if test="resultEndLatitudeVal != null and resultEndLatitudeVal != ''">
  154. and RESULT_END_LATITUDE_VAL LIKE '%${resultEndLatitudeVal}%'
  155. </if>
  156. <if test="resultMemo != null and resultMemo != ''">
  157. and RESULT_MEMO LIKE '%${resultMemo}%'
  158. </if>
  159. <if test="insertUsername != null and insertUsername != ''">
  160. and INSERT_USERNAME LIKE '%${insertUsername}%'
  161. </if>
  162. <if test="insertTime != null">
  163. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  164. </if>
  165. <if test="updateUsername != null and updateUsername != ''">
  166. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  167. </if>
  168. <if test="updateTime != null">
  169. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  170. </if>
  171. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  172. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  173. </if>
  174. <if test="deleteName != null and deleteName != ''">
  175. and DELETE_NAME LIKE '%${deleteName}%'
  176. </if>
  177. <if test="deleteTime != null">
  178. and TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = #{deleteTime}
  179. </if>
  180. <if test="resultAboutTime != null and resultAboutTime != ''">
  181. and RESULT_ABOUT_TIME LIKE '%${resultAboutTime}%'
  182. </if>
  183. <if test="resultBalanceTime != null">
  184. and RESULT_BALANCE_TIME = #{resultBalanceTime}
  185. </if>
  186. </where>
  187. </sql>
  188. <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
  189. delete from TMSTRUCK_TIME_TASK_RESULT
  190. where TIME_TASK_RESULT_ID = #{timeTaskResultId,jdbcType=DECIMAL}
  191. </delete>
  192. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  193. delete from TMSTRUCK_TIME_TASK_RESULT
  194. where 1!=1
  195. <if test="resultTotalId != null">
  196. or RESULT_TOTAL_ID = #{resultTotalId}
  197. </if>
  198. <if test="resultValue != null">
  199. or RESULT_VALUE = #{resultValue}
  200. </if>
  201. <if test="resultUomId != null">
  202. or RESULT_UOM_ID = #{resultUomId}
  203. </if>
  204. <if test="resultTimeType != null">
  205. or RESULT_TIME_TYPE = #{resultTimeType}
  206. </if>
  207. <if test="resultTime != null">
  208. or TO_CHAR(RESULT_TIME,'yyyy-MM-dd') = '#{resultTime}'
  209. </if>
  210. <if test="resultStartNodeId != null">
  211. or RESULT_START_NODE_ID = #{resultStartNodeId}
  212. </if>
  213. <if test="resultStartLongitudeVal != null and resultStartLongitudeVal != ''">
  214. or RESULT_START_LONGITUDE_VAL = #{resultStartLongitudeVal}
  215. </if>
  216. <if test="resultStartLatitudeVal != null and resultStartLatitudeVal != ''">
  217. or RESULT_START_LATITUDE_VAL = #{resultStartLatitudeVal}
  218. </if>
  219. <if test="resultEndNodeId != null">
  220. or RESULT_END_NODE_ID = #{resultEndNodeId}
  221. </if>
  222. <if test="resultEndLongitudeVal != null and resultEndLongitudeVal != ''">
  223. or RESULT_END_LONGITUDE_VAL = #{resultEndLongitudeVal}
  224. </if>
  225. <if test="resultEndLatitudeVal != null and resultEndLatitudeVal != ''">
  226. or RESULT_END_LATITUDE_VAL = #{resultEndLatitudeVal}
  227. </if>
  228. <if test="resultMemo != null and resultMemo != ''">
  229. or RESULT_MEMO = #{resultMemo}
  230. </if>
  231. <if test="insertUsername != null and insertUsername != ''">
  232. or INSERT_USERNAME = #{insertUsername}
  233. </if>
  234. <if test="insertTime != null">
  235. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  236. </if>
  237. <if test="updateUsername != null and updateUsername != ''">
  238. or UPDATE_USERNAME = #{updateUsername}
  239. </if>
  240. <if test="updateTime != null">
  241. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  242. </if>
  243. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  244. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  245. </if>
  246. <if test="deleteName != null and deleteName != ''">
  247. or DELETE_NAME = #{deleteName}
  248. </if>
  249. <if test="deleteTime != null">
  250. or TO_CHAR(DELETE_TIME,'yyyy-MM-dd') = '#{deleteTime}'
  251. </if>
  252. <if test="resultAboutTime != null and resultAboutTime != ''">
  253. or RESULT_ABOUT_TIME = #{resultAboutTime}
  254. </if>
  255. <if test="resultBalanceTime != null">
  256. or RESULT_BALANCE_TIME = #{resultBalanceTime}
  257. </if>
  258. </delete>
  259. <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckTimeTaskResult">
  260. insert into TMSTRUCK_TIME_TASK_RESULT (TIME_TASK_RESULT_ID, RESULT_TOTAL_ID,
  261. RESULT_VALUE, RESULT_UOM_ID, RESULT_TIME_TYPE,
  262. RESULT_TIME, RESULT_START_NODE_ID, RESULT_START_LONGITUDE_VAL,
  263. RESULT_START_LATITUDE_VAL, RESULT_END_NODE_ID,
  264. RESULT_END_LONGITUDE_VAL, RESULT_END_LATITUDE_VAL,
  265. RESULT_MEMO, INSERT_USERNAME, INSERT_TIME,
  266. UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  267. DELETE_NAME, DELETE_TIME, RESULT_ABOUT_TIME,
  268. RESULT_BALANCE_TIME)
  269. values (#{timeTaskResultId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL},
  270. #{resultValue,jdbcType=DECIMAL}, #{resultUomId,jdbcType=DECIMAL}, #{resultTimeType,jdbcType=DECIMAL},
  271. #{resultTime,jdbcType=TIMESTAMP}, #{resultStartNodeId,jdbcType=DECIMAL}, #{resultStartLongitudeVal,jdbcType=VARCHAR},
  272. #{resultStartLatitudeVal,jdbcType=VARCHAR}, #{resultEndNodeId,jdbcType=DECIMAL},
  273. #{resultEndLongitudeVal,jdbcType=VARCHAR}, #{resultEndLatitudeVal,jdbcType=VARCHAR},
  274. #{resultMemo,jdbcType=VARCHAR}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  275. #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
  276. #{deleteName,jdbcType=VARCHAR}, #{deleteTime,jdbcType=TIMESTAMP}, #{resultAboutTime,jdbcType=VARCHAR},
  277. #{resultBalanceTime,jdbcType=DECIMAL})
  278. </insert>
  279. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckTimeTaskResult">
  280. insert into TMSTRUCK_TIME_TASK_RESULT
  281. <trim prefix="(" suffix=")" suffixOverrides=",">
  282. <if test="timeTaskResultId != null">
  283. TIME_TASK_RESULT_ID,
  284. </if>
  285. <if test="resultTotalId != null">
  286. RESULT_TOTAL_ID,
  287. </if>
  288. <if test="resultValue != null">
  289. RESULT_VALUE,
  290. </if>
  291. <if test="resultUomId != null">
  292. RESULT_UOM_ID,
  293. </if>
  294. <if test="resultTimeType != null">
  295. RESULT_TIME_TYPE,
  296. </if>
  297. <if test="resultTime != null">
  298. RESULT_TIME,
  299. </if>
  300. <if test="resultStartNodeId != null">
  301. RESULT_START_NODE_ID,
  302. </if>
  303. <if test="resultStartLongitudeVal != null">
  304. RESULT_START_LONGITUDE_VAL,
  305. </if>
  306. <if test="resultStartLatitudeVal != null">
  307. RESULT_START_LATITUDE_VAL,
  308. </if>
  309. <if test="resultEndNodeId != null">
  310. RESULT_END_NODE_ID,
  311. </if>
  312. <if test="resultEndLongitudeVal != null">
  313. RESULT_END_LONGITUDE_VAL,
  314. </if>
  315. <if test="resultEndLatitudeVal != null">
  316. RESULT_END_LATITUDE_VAL,
  317. </if>
  318. <if test="resultMemo != null">
  319. RESULT_MEMO,
  320. </if>
  321. <if test="insertUsername != null">
  322. INSERT_USERNAME,
  323. </if>
  324. <if test="insertTime != null">
  325. INSERT_TIME,
  326. </if>
  327. <if test="updateUsername != null">
  328. UPDATE_USERNAME,
  329. </if>
  330. <if test="updateTime != null">
  331. UPDATE_TIME,
  332. </if>
  333. <if test="insertUpdateRemark != null">
  334. INSERT_UPDATE_REMARK,
  335. </if>
  336. <if test="deleteName != null">
  337. DELETE_NAME,
  338. </if>
  339. <if test="deleteTime != null">
  340. DELETE_TIME,
  341. </if>
  342. <if test="resultAboutTime != null">
  343. RESULT_ABOUT_TIME,
  344. </if>
  345. <if test="resultBalanceTime != null">
  346. RESULT_BALANCE_TIME,
  347. </if>
  348. </trim>
  349. <trim prefix="values (" suffix=")" suffixOverrides=",">
  350. <if test="timeTaskResultId != null">
  351. #{timeTaskResultId,jdbcType=DECIMAL},
  352. </if>
  353. <if test="resultTotalId != null">
  354. #{resultTotalId,jdbcType=DECIMAL},
  355. </if>
  356. <if test="resultValue != null">
  357. #{resultValue,jdbcType=DECIMAL},
  358. </if>
  359. <if test="resultUomId != null">
  360. #{resultUomId,jdbcType=DECIMAL},
  361. </if>
  362. <if test="resultTimeType != null">
  363. #{resultTimeType,jdbcType=DECIMAL},
  364. </if>
  365. <if test="resultTime != null">
  366. #{resultTime,jdbcType=TIMESTAMP},
  367. </if>
  368. <if test="resultStartNodeId != null">
  369. #{resultStartNodeId,jdbcType=DECIMAL},
  370. </if>
  371. <if test="resultStartLongitudeVal != null">
  372. #{resultStartLongitudeVal,jdbcType=VARCHAR},
  373. </if>
  374. <if test="resultStartLatitudeVal != null">
  375. #{resultStartLatitudeVal,jdbcType=VARCHAR},
  376. </if>
  377. <if test="resultEndNodeId != null">
  378. #{resultEndNodeId,jdbcType=DECIMAL},
  379. </if>
  380. <if test="resultEndLongitudeVal != null">
  381. #{resultEndLongitudeVal,jdbcType=VARCHAR},
  382. </if>
  383. <if test="resultEndLatitudeVal != null">
  384. #{resultEndLatitudeVal,jdbcType=VARCHAR},
  385. </if>
  386. <if test="resultMemo != null">
  387. #{resultMemo,jdbcType=VARCHAR},
  388. </if>
  389. <if test="insertUsername != null">
  390. #{insertUsername,jdbcType=VARCHAR},
  391. </if>
  392. <if test="insertTime != null">
  393. #{insertTime,jdbcType=TIMESTAMP},
  394. </if>
  395. <if test="updateUsername != null">
  396. #{updateUsername,jdbcType=VARCHAR},
  397. </if>
  398. <if test="updateTime != null">
  399. #{updateTime,jdbcType=TIMESTAMP},
  400. </if>
  401. <if test="insertUpdateRemark != null">
  402. #{insertUpdateRemark,jdbcType=VARCHAR},
  403. </if>
  404. <if test="deleteName != null">
  405. #{deleteName,jdbcType=VARCHAR},
  406. </if>
  407. <if test="deleteTime != null">
  408. #{deleteTime,jdbcType=TIMESTAMP},
  409. </if>
  410. <if test="resultAboutTime != null">
  411. #{resultAboutTime,jdbcType=VARCHAR},
  412. </if>
  413. <if test="resultBalanceTime != null">
  414. #{resultBalanceTime,jdbcType=DECIMAL},
  415. </if>
  416. </trim>
  417. </insert>
  418. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckTimeTaskResult">
  419. update TMSTRUCK_TIME_TASK_RESULT
  420. set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  421. RESULT_VALUE = #{resultValue,jdbcType=DECIMAL},
  422. RESULT_UOM_ID = #{resultUomId,jdbcType=DECIMAL},
  423. RESULT_TIME_TYPE = #{resultTimeType,jdbcType=DECIMAL},
  424. RESULT_TIME = #{resultTime,jdbcType=TIMESTAMP},
  425. RESULT_START_NODE_ID = #{resultStartNodeId,jdbcType=DECIMAL},
  426. RESULT_START_LONGITUDE_VAL = #{resultStartLongitudeVal,jdbcType=VARCHAR},
  427. RESULT_START_LATITUDE_VAL = #{resultStartLatitudeVal,jdbcType=VARCHAR},
  428. RESULT_END_NODE_ID = #{resultEndNodeId,jdbcType=DECIMAL},
  429. RESULT_END_LONGITUDE_VAL = #{resultEndLongitudeVal,jdbcType=VARCHAR},
  430. RESULT_END_LATITUDE_VAL = #{resultEndLatitudeVal,jdbcType=VARCHAR},
  431. RESULT_MEMO = #{resultMemo,jdbcType=VARCHAR},
  432. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  433. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  434. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  435. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  436. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  437. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  438. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  439. RESULT_ABOUT_TIME = #{resultAboutTime,jdbcType=VARCHAR},
  440. RESULT_BALANCE_TIME = #{resultBalanceTime,jdbcType=DECIMAL}
  441. where TIME_TASK_RESULT_ID = #{timeTaskResultId,jdbcType=DECIMAL}
  442. </update>
  443. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckTimeTaskResult">
  444. update TMSTRUCK_TIME_TASK_RESULT
  445. <set>
  446. <if test="resultTotalId != null">
  447. RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  448. </if>
  449. <if test="resultValue != null">
  450. RESULT_VALUE = #{resultValue,jdbcType=DECIMAL},
  451. </if>
  452. <if test="resultUomId != null">
  453. RESULT_UOM_ID = #{resultUomId,jdbcType=DECIMAL},
  454. </if>
  455. <if test="resultTimeType != null">
  456. RESULT_TIME_TYPE = #{resultTimeType,jdbcType=DECIMAL},
  457. </if>
  458. <if test="resultTime != null">
  459. RESULT_TIME = #{resultTime,jdbcType=TIMESTAMP},
  460. </if>
  461. <if test="resultStartNodeId != null">
  462. RESULT_START_NODE_ID = #{resultStartNodeId,jdbcType=DECIMAL},
  463. </if>
  464. <if test="resultStartLongitudeVal != null">
  465. RESULT_START_LONGITUDE_VAL = #{resultStartLongitudeVal,jdbcType=VARCHAR},
  466. </if>
  467. <if test="resultStartLatitudeVal != null">
  468. RESULT_START_LATITUDE_VAL = #{resultStartLatitudeVal,jdbcType=VARCHAR},
  469. </if>
  470. <if test="resultEndNodeId != null">
  471. RESULT_END_NODE_ID = #{resultEndNodeId,jdbcType=DECIMAL},
  472. </if>
  473. <if test="resultEndLongitudeVal != null">
  474. RESULT_END_LONGITUDE_VAL = #{resultEndLongitudeVal,jdbcType=VARCHAR},
  475. </if>
  476. <if test="resultEndLatitudeVal != null">
  477. RESULT_END_LATITUDE_VAL = #{resultEndLatitudeVal,jdbcType=VARCHAR},
  478. </if>
  479. <if test="resultMemo != null">
  480. RESULT_MEMO = #{resultMemo,jdbcType=VARCHAR},
  481. </if>
  482. <if test="insertUsername != null">
  483. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  484. </if>
  485. <if test="insertTime != null">
  486. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  487. </if>
  488. <if test="updateUsername != null">
  489. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  490. </if>
  491. <if test="updateTime != null">
  492. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  493. </if>
  494. <if test="insertUpdateRemark != null">
  495. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  496. </if>
  497. <if test="deleteName != null">
  498. DELETE_NAME = #{deleteName,jdbcType=VARCHAR},
  499. </if>
  500. <if test="deleteTime != null">
  501. DELETE_TIME = #{deleteTime,jdbcType=TIMESTAMP},
  502. </if>
  503. <if test="resultAboutTime != null">
  504. RESULT_ABOUT_TIME = #{resultAboutTime,jdbcType=VARCHAR},
  505. </if>
  506. <if test="resultBalanceTime != null">
  507. RESULT_BALANCE_TIME = #{resultBalanceTime,jdbcType=DECIMAL},
  508. </if>
  509. </set>
  510. where TIME_TASK_RESULT_ID = #{timeTaskResultId,jdbcType=DECIMAL}
  511. </update>
  512. <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
  513. <include refid="select" />
  514. where TIME_TASK_RESULT_ID = #{timeTaskResultId,jdbcType=DECIMAL}
  515. </select>
  516. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  517. <include refid="select" />
  518. <include refid="where" />
  519. </select>
  520. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  521. <include refid="select" />
  522. <include refid="whereLike" />
  523. </select>
  524. <insert id="batchInsert" parameterType="java.util.List">
  525. insert into TMSTRUCK_TIME_TASK_RESULT
  526. (TIME_TASK_RESULT_ID,
  527. RESULT_TOTAL_ID, RESULT_VALUE, RESULT_UOM_ID,
  528. RESULT_TIME_TYPE, RESULT_TIME,
  529. RESULT_START_NODE_ID, RESULT_START_LONGITUDE_VAL,
  530. RESULT_START_LATITUDE_VAL, RESULT_END_NODE_ID,
  531. RESULT_END_LONGITUDE_VAL, RESULT_END_LATITUDE_VAL,
  532. RESULT_MEMO, INSERT_USERNAME, INSERT_TIME,
  533. UPDATE_USERNAME, UPDATE_TIME,
  534. INSERT_UPDATE_REMARK, DELETE_NAME,
  535. DELETE_TIME, RESULT_ABOUT_TIME,
  536. RESULT_BALANCE_TIME)
  537. ( <foreach collection="list" item="item" separator="union all">
  538. select
  539. #{item.timeTaskResultId,jdbcType=DECIMAL},
  540. #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultValue,jdbcType=DECIMAL}, #{item.resultUomId,jdbcType=DECIMAL},
  541. #{item.resultTimeType,jdbcType=DECIMAL}, #{item.resultTime,jdbcType=TIMESTAMP},
  542. #{item.resultStartNodeId,jdbcType=DECIMAL}, #{item.resultStartLongitudeVal,jdbcType=VARCHAR},
  543. #{item.resultStartLatitudeVal,jdbcType=VARCHAR}, #{item.resultEndNodeId,jdbcType=DECIMAL},
  544. #{item.resultEndLongitudeVal,jdbcType=VARCHAR}, #{item.resultEndLatitudeVal,jdbcType=VARCHAR},
  545. #{item.resultMemo,jdbcType=VARCHAR}, #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  546. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  547. #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.deleteName,jdbcType=VARCHAR},
  548. #{item.deleteTime,jdbcType=TIMESTAMP}, #{item.resultAboutTime,jdbcType=VARCHAR},
  549. #{item.resultBalanceTime,jdbcType=DECIMAL} from dual
  550. </foreach> )
  551. </insert>
  552. <update id="batchUpdate" parameterType="java.util.List">
  553. update TMSTRUCK_TIME_TASK_RESULT
  554. set
  555. TIME_TASK_RESULT_ID=
  556. <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
  557. when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.timeTaskResultId,jdbcType=DECIMAL}
  558. </foreach>
  559. ,RESULT_TOTAL_ID=
  560. <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
  561. when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
  562. </foreach>
  563. ,RESULT_VALUE=
  564. <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
  565. when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultValue,jdbcType=DECIMAL}
  566. </foreach>
  567. ,RESULT_UOM_ID=
  568. <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
  569. when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultUomId,jdbcType=DECIMAL}
  570. </foreach>
  571. ,RESULT_TIME_TYPE=
  572. <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
  573. when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultTimeType,jdbcType=DECIMAL}
  574. </foreach>
  575. ,RESULT_TIME=
  576. <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
  577. when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultTime,jdbcType=TIMESTAMP}
  578. </foreach>
  579. ,RESULT_START_NODE_ID=
  580. <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
  581. when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultStartNodeId,jdbcType=DECIMAL}
  582. </foreach>
  583. ,RESULT_START_LONGITUDE_VAL=
  584. <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
  585. when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultStartLongitudeVal,jdbcType=VARCHAR}
  586. </foreach>
  587. ,RESULT_START_LATITUDE_VAL=
  588. <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
  589. when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultStartLatitudeVal,jdbcType=VARCHAR}
  590. </foreach>
  591. ,RESULT_END_NODE_ID=
  592. <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
  593. when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultEndNodeId,jdbcType=DECIMAL}
  594. </foreach>
  595. ,RESULT_END_LONGITUDE_VAL=
  596. <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
  597. when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultEndLongitudeVal,jdbcType=VARCHAR}
  598. </foreach>
  599. ,RESULT_END_LATITUDE_VAL=
  600. <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
  601. when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultEndLatitudeVal,jdbcType=VARCHAR}
  602. </foreach>
  603. ,RESULT_MEMO=
  604. <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
  605. when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultMemo,jdbcType=VARCHAR}
  606. </foreach>
  607. ,INSERT_USERNAME=
  608. <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
  609. when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  610. </foreach>
  611. ,INSERT_TIME=
  612. <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
  613. when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  614. </foreach>
  615. ,UPDATE_USERNAME=
  616. <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
  617. when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  618. </foreach>
  619. ,UPDATE_TIME=
  620. <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
  621. when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  622. </foreach>
  623. ,INSERT_UPDATE_REMARK=
  624. <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
  625. when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  626. </foreach>
  627. ,DELETE_NAME=
  628. <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
  629. when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.deleteName,jdbcType=VARCHAR}
  630. </foreach>
  631. ,DELETE_TIME=
  632. <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
  633. when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.deleteTime,jdbcType=TIMESTAMP}
  634. </foreach>
  635. ,RESULT_ABOUT_TIME=
  636. <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
  637. when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultAboutTime,jdbcType=VARCHAR}
  638. </foreach>
  639. ,RESULT_BALANCE_TIME=
  640. <foreach close="end" collection="list" index="index" item="item" open="case TIME_TASK_RESULT_ID" separator=" ">
  641. when #{item.timeTaskResultId,jdbcType=DECIMAL} then #{item.resultBalanceTime,jdbcType=DECIMAL}
  642. </foreach>
  643. where TIME_TASK_RESULT_ID in
  644. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  645. #{item.timeTaskResultId,jdbcType=DECIMAL}
  646. </foreach>
  647. </update>
  648. <delete id="batchDelete" parameterType="java.util.List">
  649. delete from TMSTRUCK_TIME_TASK_RESULT
  650. where TIME_TASK_RESULT_ID in
  651. <foreach close=")" collection="list" item="id" open="(" separator=",">
  652. #{id}
  653. </foreach>
  654. </delete>
  655. <!-- 友情提示!!!-->
  656. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  657. <!-- 通过运输订单号查询总实绩ID -->
  658. <select id="getResultTotalIdByOrderNum" resultType="java.util.Map">
  659. SELECT TTR.RESULT_TOTAL_ID "resultTotalId"
  660. FROM OMSTRUCK_ORDER OO
  661. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  662. ON TTR.ORDER_ID = OO.ORDER_ID
  663. WHERE OO.ORDER_NUMBER = #{orderNumber}
  664. </select>
  665. <!-- 查询上一次结束时间 -->
  666. <select id="getLastTimeout" parameterType="java.math.BigDecimal" resultType="java.util.Map">
  667. select *
  668. from(
  669. SELECT TTTR.RESULT_TIME "resultTime"
  670. FROM TMSTRUCK_TIME_TASK_RESULT TTTR
  671. WHERE TTTR.RESULT_TOTAL_ID = #{resultTotalId}
  672. AND TTTR.RESULT_TIME_TYPE = 5
  673. ORDER BY "resultTime" DESC
  674. )
  675. where rownum = 1
  676. </select>
  677. <select id="getLastTimeEnd" parameterType="java.math.BigDecimal" resultType="java.util.Map">
  678. select *
  679. from(
  680. SELECT TTTR.RESULT_TIME "resultTime"
  681. FROM TMSTRUCK_TIME_TASK_RESULT TTTR
  682. WHERE TTTR.RESULT_TOTAL_ID = #{resultTotalId}
  683. AND TTTR.RESULT_TIME_TYPE = 7
  684. ORDER BY "resultTime" DESC
  685. )
  686. where rownum = 1
  687. </select>
  688. <!-- 查询用车单位确认开始时间-->
  689. <select id="getStartTime" parameterType="java.math.BigDecimal" resultType="java.util.Map">
  690. SELECT TTTR.RESULT_TIME "resultTime"
  691. FROM TMSTRUCK_TIME_TASK_RESULT TTTR
  692. WHERE TTTR.RESULT_TOTAL_ID = #{resultTotalId}
  693. AND TTTR.RESULT_TIME_TYPE = 0
  694. </select>
  695. <!-- 查询所有确认暂停结束时间-->
  696. <select id="getAllTimeout" resultType="java.util.Map">
  697. SELECT TTTR.RESULT_VALUE "resultValue"
  698. FROM TMSTRUCK_TIME_TASK_RESULT TTTR
  699. WHERE TTTR.RESULT_TOTAL_ID = #{resultTotalId}
  700. AND TTTR.RESULT_TIME_TYPE = 7
  701. </select>
  702. <sql id="orderBy">
  703. <if test="orderField != null and orderField != ''">
  704. order by "${orderField}"
  705. </if>
  706. </sql>
  707. <!-- 查询计时作业 -->
  708. <select id="getAllTimeTaskResult" resultType="java.util.Map">
  709. select * from (select RC.CAPACITY_NUMBER "capacityNumber",
  710. OO.ORDER_ID "orderId",
  711. OO.ORDER_NUMBER "orderNumber",
  712. TTTR.RESULT_VALUE AS "resultTime",
  713. AIR.REQUIREMENT_ESTIMATED_DURATION "planTimeDuration",
  714. (CASE WHEN
  715. AIR.REQUIREMENT_ESTIMATED_DURATION is null
  716. then '未填写预计时长,无法比较'
  717. WHEN AIR.REQUIREMENT_ESTIMATED_DURATION is NOT null
  718. then (AIR.REQUIREMENT_ESTIMATED_DURATION - TTTR.RESULT_VALUE) || ''
  719. end) "dValue",
  720. RCT.CAPACITY_TYPE_NAME "capacityTypeName",
  721. TTTR.result_balance_time "aboutTime",
  722. TTTR.INSERT_TIME "insertTime",
  723. SU.USER_NAME "personName",
  724. AIR.INSERT_UPDATE_REMARK "requirementRemark",
  725. (
  726. SELECT TTTR2.RESULT_TIME
  727. FROM TMSTRUCK_TIME_TASK_RESULT TTTR2
  728. WHERE TTTR2.RESULT_TOTAL_ID = TTTR.RESULT_TOTAL_ID
  729. AND TTTR2.RESULT_TIME_TYPE = 1
  730. ) "startTime",
  731. (
  732. SELECT TTTR2.RESULT_TIME
  733. FROM TMSTRUCK_TIME_TASK_RESULT TTTR2
  734. WHERE TTTR2.RESULT_TOTAL_ID = TTTR.RESULT_TOTAL_ID
  735. AND TTTR2.RESULT_TIME_TYPE = 3
  736. ) "endTime",
  737. (
  738. SELECT count(TTTR2.RESULT_VALUE)
  739. FROM TMSTRUCK_TIME_TASK_RESULT TTTR2
  740. WHERE TTTR2.RESULT_TOTAL_ID = TTTR.RESULT_TOTAL_ID
  741. AND TTTR2.RESULT_TIME_TYPE = 7
  742. ) "pauseTime",
  743. RM.MATERIAL_NAME "materialName",
  744. RS.SHIPPER_NAME "shipperName",
  745. RW.WAREHOUSE_NAME "unloadPointName",
  746. RW2.WAREHOUSE_NAME "loadPointName",
  747. TWR.RESULT_GROSS_WEIGHT_TIME "grossWeightTime",
  748. TWR.RESULT_TARE_WEIGHT_TIME "tareWeightTime"
  749. from OMSTRUCK_ORDER OO
  750. LEFT JOIN AMSTRUCK_INWARD_PLAN AIP
  751. ON AIP.PLAN_ID=OO.ORDER_PLAN_ID
  752. LEFT JOIN AMSTRUCK_REQUIREMENT_PLAN ARP
  753. ON ARP.PLAN_ID=AIP.PLAN_ID
  754. LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT AIR
  755. ON AIR.REQUIREMENT_ID=ARP.REQUIREMENT_ID
  756. LEFT JOIN AMSTRUCK_REQUIREMENT_MATERIAL ARM
  757. ON ARM.REQUIREMENT_ID=AIR.REQUIREMENT_ID
  758. LEFT JOIN RMS_WAREHOUSE RW
  759. ON ARM.REQUIREMENT_UNLOAD_UNIT_ID =RW.WAREHOUSE_ID
  760. LEFT JOIN RMS_WAREHOUSE RW2
  761. ON RW2.WAREHOUSE_ID=ARM.REQUIREMENT_PLATFORM_ID
  762. LEFT JOIN RMS_MATERIAL RM
  763. ON RM.MATERIAL_ID=ARM.MATERIAL_ID
  764. LEFT JOIN RMS_SHIPPER RS
  765. ON RS.SHIPPER_ID = AIR.REQUIREMENT_SHIPPER_ID
  766. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  767. ON TTR.ORDER_ID=OO.ORDER_ID
  768. LEFT JOIN TMSTRUCK_TIME_TASK_RESULT TTTR
  769. ON TTR.RESULT_TOTAL_ID=TTTR.RESULT_TOTAL_ID
  770. LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
  771. ON TWR.RESULT_TOTAL_ID = TTR.RESULT_TOTAL_ID
  772. LEFT JOIN SSO.SYS_USER SU
  773. ON SU.USER_ID =TTTR.INSERT_USERNAME
  774. LEFT JOIN RMS_UNIT_OF_MEASURE RUOM
  775. ON TTTR.RESULT_UOM_ID=RUOM.UNIT_OF_MEASURE_ID
  776. LEFT JOIN RMS_CAPACITY RC
  777. ON RC.CAPACITY_ID=OO.CAPACITY_ID
  778. LEFT JOIN RMS_CAPACITY_TYPE RCT
  779. ON RCT.CAPACITY_TYPE_ID=AIR.CAPACITY_TYPE_ID
  780. where TTTR.RESULT_TIME_TYPE = 3 AND TTTR.RESULT_VALUE IS NOT NULL
  781. <if test="orderType!=null and orderType != 26">
  782. AND OO.ORDER_TYPE in (#{orderType},11)
  783. </if>
  784. <if test="orderType!=null and orderType == 26">
  785. AND OO.ORDER_TYPE = #{orderType}
  786. </if>
  787. <if test="con!=null and con != ''">
  788. AND RC.CAPACITY_NUMBER || RM.MATERIAL_NAME || RS.SHIPPER_NAME LIKE CONCAT('%',CONCAT(#{con},'%'))
  789. </if>
  790. <if test="userId!=null">
  791. AND instr(AIR.INSERT_USERNAME,#{userId}) > 0
  792. </if>
  793. <if test="oneDate != null">
  794. and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TTTR.INSERT_TIME
  795. </if>
  796. <if test="startDate != null">
  797. and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= TTTR.INSERT_TIME
  798. and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= TTTR.INSERT_TIME
  799. </if>)
  800. <where>
  801. <if test="orderNumber != null">
  802. <foreach collection="orderNumber" item="item" open="(" separator="or" close=")">
  803. "orderNumber" like '%${item}%'
  804. </foreach>
  805. </if>
  806. <if test="capacityNumber != null">
  807. and
  808. <foreach collection="capacityNumber" item="item" open="(" separator="or" close=")">
  809. "capacityNumber" like '%${item}%'
  810. </foreach>
  811. </if>
  812. <if test="driverName != null">
  813. and
  814. <foreach collection="driverName" item="item" open="(" separator="or" close=")">
  815. "driverName" like '%${item}%'
  816. </foreach>
  817. </if>
  818. <if test="capacityTypeName != null">
  819. and
  820. <foreach collection="capacityTypeName" item="item" open="(" separator="or" close=")">
  821. "capacityTypeName" like '%${item}%'
  822. </foreach>
  823. </if>
  824. <if test="materialName != null">
  825. and
  826. <foreach collection="materialName" item="item" open="(" separator="or" close=")">
  827. "materialName" like '%${item}%'
  828. </foreach>
  829. </if>
  830. <if test="shipperName != null">
  831. and
  832. <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
  833. "shipperName" like '%${item}%'
  834. </foreach>
  835. </if>
  836. <if test="startTime != null">
  837. and
  838. <foreach collection="startTime" item="item" open="(" separator="or" close=")">
  839. to_char("startTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
  840. </foreach>
  841. </if>
  842. <if test="endTime != null">
  843. and
  844. <foreach collection="endTime" item="item" open="(" separator="or" close=")">
  845. to_char("endTime",'yyyy-mm-dd hh24:mi:ss') like '%${item}%'
  846. </foreach>
  847. </if>
  848. <if test="timingTime != null">
  849. and
  850. <foreach collection="timingTime" item="item" open="(" separator="or" close=")">
  851. "timingTime" like '%${item}%'
  852. </foreach>
  853. </if>
  854. <if test="allTimeout != null">
  855. and
  856. <foreach collection="allTimeout" item="item" open="(" separator="or" close=")">
  857. "allTimeout" like '%${item}%'
  858. </foreach>
  859. </if>
  860. </where>
  861. <include refid="orderBy"></include>
  862. <if test="orderField == null">
  863. order by "insertTime" desc
  864. </if>
  865. </select>
  866. <!-- 根据运输订单id查找实绩是否已经计时结束-->
  867. <select id="CountTimeTaskByOrderId" resultType="java.lang.Integer" parameterType="java.math.BigDecimal">
  868. select COUNT(*)
  869. from OMSTRUCK_ORDER OO
  870. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  871. ON TTR.ORDER_ID=OO.ORDER_ID
  872. LEFT JOIN TMSTRUCK_TIME_TASK_RESULT TTTR
  873. ON TTR.RESULT_TOTAL_ID=TTTR.RESULT_TOTAL_ID
  874. WHERE OO.ORDER_ID=#{orderId} and TTTR.RESULT_TIME_TYPE=3 and TTTR.RESULT_VALUE IS not NULL
  875. </select>
  876. <select id="selectInwardDueTimeByOrderId" resultType="java.util.Map" parameterType="java.math.BigDecimal">
  877. select AIR.DUE_DATE "dueTime",
  878. AIR.INSERT_UPDATE_REMARK "remark"
  879. from OMSTRUCK_ORDER OO
  880. left join AMSTRUCK_INWARD_PLAN AIP
  881. on AIP.PLAN_ID=OO.ORDER_PLAN_ID
  882. left join AMSTRUCK_REQUIREMENT_PLAN ARP
  883. on ARP.PLAN_ID=AIP.PLAN_ID
  884. left join AMSTRUCK_INWARD_REQUIREMENT AIR
  885. on AIR.REQUIREMENT_ID=ARP.REQUIREMENT_ID
  886. where OO.ORDER_ID=#{orderId}
  887. </select>
  888. <!--获取需求信息-->
  889. <select id="getRequirementInfo" resultType="java.util.Map" parameterType="decimal">
  890. select DISTINCT
  891. AIR.CAPACITY_TYPE_ID "capacityTypeId" ,
  892. AIR.REQUIREMENT_TYPE "requirementType",
  893. RCT.CAPACITY_TYPE_NAME "capacityTypeName",
  894. AIR.insert_update_remark "insertUpdateRemark"
  895. from OMSTRUCK_ORDER OO
  896. left join AMSTRUCK_INWARD_PLAN AIP
  897. on aip.PLAN_ID = OO.ORDER_PLAN_ID
  898. LEFT JOIN AMSTRUCK_REQUIREMENT_PLAN ARP
  899. ON ARP.PLAN_ID = AIP.PLAN_ID
  900. LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT AIR
  901. ON AIR.REQUIREMENT_ID = ARP.REQUIREMENT_ID
  902. LEFT JOIN RMS_CAPACITY_TYPE RCT
  903. ON AIR.CAPACITY_TYPE_ID = RCT.CAPACITY_TYPE_ID
  904. where oo.ORDER_ID = #{orderId1}
  905. fetch next 1 rows only
  906. </select>
  907. <!-- 查找计时开始时间-->
  908. <select id="getStartTimeTask" resultType="java.util.Map" parameterType="java.util.Map">
  909. select TTTR.TIME_TASK_RESULT_ID "timeTaskResultId",
  910. TTTR.RESULT_TIME "resultTime"
  911. from OMSTRUCK_ORDER OO
  912. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  913. ON OO.ORDER_ID=TTR.ORDER_ID
  914. LEFT JOIN TMSTRUCK_TIME_TASK_RESULT TTTR
  915. ON TTTR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
  916. WHERE TTTR.RESULT_TIME_TYPE = #{resultType} and OO.ORDER_NUMBER = #{orderNumber}
  917. </select>
  918. <!-- 查找计时总时长-->
  919. <select id="getResultValue" resultType="java.util.Map" parameterType="java.lang.String">
  920. select TTTR.RESULT_VALUE "resultValue",
  921. TTTR.TIME_TASK_RESULT_ID "timeTaskResultId",
  922. OO.ORDER_ID "orderId"
  923. from OMSTRUCK_ORDER OO
  924. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  925. ON OO.ORDER_ID=TTR.ORDER_ID
  926. LEFT JOIN TMSTRUCK_TIME_TASK_RESULT TTTR
  927. ON TTR.RESULT_TOTAL_ID= TTTR.RESULT_TOTAL_ID
  928. WHERE TTTR.RESULT_TIME_TYPE= 3 AND OO.ORDER_NUMBER=#{orderNumber}
  929. </select>
  930. <select id="getShipperName" resultType="java.lang.String">
  931. SELECT RS.SHIPPER_NAME || rs.INSERT_USERNAME
  932. from OMSTRUCK_ORDER OO
  933. LEFT JOIN AMSTRUCK_INWARD_PLAN AIP
  934. ON AIP.PLAN_ID=OO.ORDER_PLAN_ID
  935. LEFT JOIN AMSTRUCK_REQUIREMENT_PLAN ARP
  936. ON ARP.PLAN_ID=AIP.PLAN_ID
  937. LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT AIR
  938. ON AIR.REQUIREMENT_ID=ARP.REQUIREMENT_ID
  939. LEFT JOIN RMS_SHIPPER RS
  940. ON RS.SHIPPER_ID = AIR.REQUIREMENT_SHIPPER_ID
  941. where RS.SHIPPER_NAME is not null AND OO.ORDER_NUMBER=#{orderNumber}
  942. FETCH NEXT 1 rows only
  943. </select>
  944. <select id="CountStartTaskByOrderId" resultType="java.lang.Integer">
  945. select COUNT(*)
  946. from OMSTRUCK_ORDER OO
  947. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  948. ON TTR.ORDER_ID=OO.ORDER_ID
  949. LEFT JOIN TMSTRUCK_TIME_TASK_RESULT TTTR
  950. ON TTR.RESULT_TOTAL_ID=TTTR.RESULT_TOTAL_ID
  951. WHERE OO.ORDER_ID=#{orderId} and TTTR.RESULT_TIME_TYPE=1
  952. </select>
  953. <select id="getLastStep" resultType="java.lang.Integer">
  954. select TTTR.RESULT_TIME_TYPE
  955. from OMSTRUCK_ORDER OO
  956. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR
  957. ON TTR.ORDER_ID=OO.ORDER_ID
  958. LEFT JOIN TMSTRUCK_TIME_TASK_RESULT TTTR
  959. ON TTR.RESULT_TOTAL_ID=TTTR.RESULT_TOTAL_ID
  960. WHERE OO.ORDER_ID=#{orderId}
  961. ORDER BY TTTR.RESULT_TIME DESC
  962. FETCH NEXT 1 ROWS ONLY
  963. </select>
  964. <delete id="deleteErrorTimeTaskResult">
  965. DELETE FROM TMSTRUCK_TIME_TASK_RESULT
  966. WHERE TIME_TASK_RESULT_ID IN
  967. (
  968. SELECT MIN(TIME_TASK_RESULT_ID)
  969. FROM TMSTRUCK_TIME_TASK_RESULT
  970. WHERE RESULT_TOTAL_ID IN
  971. (
  972. SELECT RESULT_TOTAL_ID
  973. FROM TMSTRUCK_TIME_TASK_RESULT WHERE RESULT_TIME_TYPE = 3
  974. GROUP BY RESULT_TOTAL_ID HAVING COUNT(TIME_TASK_RESULT_ID) > 1
  975. )
  976. GROUP BY RESULT_TOTAL_ID
  977. )
  978. </delete>
  979. <select id="checkOrderType" resultType="java.lang.Integer">
  980. SELECT COUNT(AIR.REQUIREMENT_ID)
  981. FROM OMSTRUCK_ORDER OO
  982. LEFT JOIN TMSTRUCK_TOTAL_RESULT TTR ON OO.ORDER_ID=TTR.ORDER_ID
  983. LEFT JOIN AMSTRUCK_INWARD_PLAN AIP ON AIP .PLAN_ID = OO .ORDER_PLAN_ID
  984. LEFT JOIN AMSTRUCK_REQUIREMENT_PLAN ARP ON ARP.PLAN_ID = AIP.PLAN_ID
  985. LEFT JOIN AMSTRUCK_INWARD_REQUIREMENT AIR ON AIR.REQUIREMENT_ID = ARP.REQUIREMENT_ID
  986. WHERE (AIR.INSERT_UPDATE_REMARK like '%计时且过计量%' OR OO .ORDER_TYPE in (21,26))
  987. AND OO .ORDER_ID = #{orderId}
  988. </select>
  989. </mapper>