TmstruckTimeTaskResultMapper.xml 34 KB

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