TmstruckTimeTaskResultMapper.xml 37 KB

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