TmstruckReceiveResultMapper.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  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.TmstruckReceiveResultMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.TmstruckReceiveResult">
  5. <id column="RESULT_RECEIVE_ID" jdbcType="DECIMAL" property="resultReceiveId" />
  6. <result column="RESULT_TOTAL_ID" jdbcType="DECIMAL" property="resultTotalId" />
  7. <result column="RESULT_RECEIVE_TIME" jdbcType="TIMESTAMP" property="resultReceiveTime" />
  8. <result column="RECEIVE_SINGER_ID" jdbcType="DECIMAL" property="receiveSingerId" />
  9. <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
  10. <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
  11. <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
  12. <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
  13. <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
  14. <result column="STATUS" jdbcType="DECIMAL" property="status" />
  15. </resultMap>
  16. <sql id="columns">
  17. RESULT_RECEIVE_ID, RESULT_TOTAL_ID, RESULT_RECEIVE_TIME, RECEIVE_SINGER_ID, INSERT_USERNAME,
  18. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, STATUS
  19. </sql>
  20. <sql id="columns_alias">
  21. t.RESULT_RECEIVE_ID, t.RESULT_TOTAL_ID, t.RESULT_RECEIVE_TIME, t.RECEIVE_SINGER_ID,
  22. t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK,
  23. t.STATUS
  24. </sql>
  25. <sql id="select">
  26. SELECT <include refid="columns" /> FROM TMSTRUCK_RECEIVE_RESULT
  27. </sql>
  28. <sql id="select_alias">
  29. SELECT <include refid="columns_alias" /> FROM TMSTRUCK_RECEIVE_RESULT t
  30. </sql>
  31. <sql id="where">
  32. <where>
  33. <if test="resultReceiveId != null">
  34. and RESULT_RECEIVE_ID = #{resultReceiveId}
  35. </if>
  36. <if test="resultTotalId != null">
  37. and RESULT_TOTAL_ID = #{resultTotalId}
  38. </if>
  39. <if test="resultReceiveTime != null">
  40. and TO_CHAR(RESULT_RECEIVE_TIME,'yyyy-MM-dd') = #{resultReceiveTime}
  41. </if>
  42. <if test="receiveSingerId != null">
  43. and RECEIVE_SINGER_ID = #{receiveSingerId}
  44. </if>
  45. <if test="insertUsername != null and insertUsername != ''">
  46. and INSERT_USERNAME = #{insertUsername}
  47. </if>
  48. <if test="insertTime != null">
  49. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  50. </if>
  51. <if test="updateUsername != null and updateUsername != ''">
  52. and UPDATE_USERNAME = #{updateUsername}
  53. </if>
  54. <if test="updateTime != null">
  55. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  56. </if>
  57. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  58. and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  59. </if>
  60. <if test="status != null">
  61. and STATUS = #{status}
  62. </if>
  63. </where>
  64. </sql>
  65. <sql id="whereLike">
  66. <where>
  67. <if test="resultReceiveId != null">
  68. and RESULT_RECEIVE_ID = #{resultReceiveId}
  69. </if>
  70. <if test="resultTotalId != null">
  71. and RESULT_TOTAL_ID = #{resultTotalId}
  72. </if>
  73. <if test="resultReceiveTime != null">
  74. and TO_CHAR(RESULT_RECEIVE_TIME,'yyyy-MM-dd') = #{resultReceiveTime}
  75. </if>
  76. <if test="receiveSingerId != null">
  77. and RECEIVE_SINGER_ID = #{receiveSingerId}
  78. </if>
  79. <if test="insertUsername != null and insertUsername != ''">
  80. and INSERT_USERNAME LIKE '%${insertUsername}%'
  81. </if>
  82. <if test="insertTime != null">
  83. and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
  84. </if>
  85. <if test="updateUsername != null and updateUsername != ''">
  86. and UPDATE_USERNAME LIKE '%${updateUsername}%'
  87. </if>
  88. <if test="updateTime != null">
  89. and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
  90. </if>
  91. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  92. and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
  93. </if>
  94. <if test="status != null">
  95. and STATUS = #{status}
  96. </if>
  97. </where>
  98. </sql>
  99. <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
  100. delete from TMSTRUCK_RECEIVE_RESULT
  101. where RESULT_RECEIVE_ID = #{resultReceiveId,jdbcType=DECIMAL}
  102. </delete>
  103. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  104. delete from TMSTRUCK_RECEIVE_RESULT
  105. where 1!=1
  106. <if test="resultTotalId != null">
  107. or RESULT_TOTAL_ID = #{resultTotalId}
  108. </if>
  109. <if test="resultReceiveTime != null">
  110. or TO_CHAR(RESULT_RECEIVE_TIME,'yyyy-MM-dd') = '#{resultReceiveTime}'
  111. </if>
  112. <if test="receiveSingerId != null">
  113. or RECEIVE_SINGER_ID = #{receiveSingerId}
  114. </if>
  115. <if test="insertUsername != null and insertUsername != ''">
  116. or INSERT_USERNAME = #{insertUsername}
  117. </if>
  118. <if test="insertTime != null">
  119. or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
  120. </if>
  121. <if test="updateUsername != null and updateUsername != ''">
  122. or UPDATE_USERNAME = #{updateUsername}
  123. </if>
  124. <if test="updateTime != null">
  125. or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
  126. </if>
  127. <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
  128. or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
  129. </if>
  130. <if test="status != null">
  131. or STATUS = #{status}
  132. </if>
  133. </delete>
  134. <insert id="insert" parameterType="com.steerinfo.dil.model.TmstruckReceiveResult">
  135. insert into TMSTRUCK_RECEIVE_RESULT (RESULT_RECEIVE_ID, RESULT_TOTAL_ID, RESULT_RECEIVE_TIME,
  136. RECEIVE_SINGER_ID, INSERT_USERNAME, INSERT_TIME,
  137. UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
  138. STATUS)
  139. values (#{resultReceiveId,jdbcType=DECIMAL}, #{resultTotalId,jdbcType=DECIMAL}, #{resultReceiveTime,jdbcType=TIMESTAMP},
  140. #{receiveSingerId,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
  141. #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
  142. #{status,jdbcType=DECIMAL})
  143. </insert>
  144. <insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstruckReceiveResult">
  145. insert into TMSTRUCK_RECEIVE_RESULT
  146. <trim prefix="(" suffix=")" suffixOverrides=",">
  147. <if test="resultReceiveId != null">
  148. RESULT_RECEIVE_ID,
  149. </if>
  150. <if test="resultTotalId != null">
  151. RESULT_TOTAL_ID,
  152. </if>
  153. <if test="resultReceiveTime != null">
  154. RESULT_RECEIVE_TIME,
  155. </if>
  156. <if test="receiveSingerId != null">
  157. RECEIVE_SINGER_ID,
  158. </if>
  159. <if test="insertUsername != null">
  160. INSERT_USERNAME,
  161. </if>
  162. <if test="insertTime != null">
  163. INSERT_TIME,
  164. </if>
  165. <if test="updateUsername != null">
  166. UPDATE_USERNAME,
  167. </if>
  168. <if test="updateTime != null">
  169. UPDATE_TIME,
  170. </if>
  171. <if test="insertUpdateRemark != null">
  172. INSERT_UPDATE_REMARK,
  173. </if>
  174. <if test="status != null">
  175. STATUS,
  176. </if>
  177. </trim>
  178. <trim prefix="values (" suffix=")" suffixOverrides=",">
  179. <if test="resultReceiveId != null">
  180. #{resultReceiveId,jdbcType=DECIMAL},
  181. </if>
  182. <if test="resultTotalId != null">
  183. #{resultTotalId,jdbcType=DECIMAL},
  184. </if>
  185. <if test="resultReceiveTime != null">
  186. #{resultReceiveTime,jdbcType=TIMESTAMP},
  187. </if>
  188. <if test="receiveSingerId != null">
  189. #{receiveSingerId,jdbcType=DECIMAL},
  190. </if>
  191. <if test="insertUsername != null">
  192. #{insertUsername,jdbcType=VARCHAR},
  193. </if>
  194. <if test="insertTime != null">
  195. #{insertTime,jdbcType=TIMESTAMP},
  196. </if>
  197. <if test="updateUsername != null">
  198. #{updateUsername,jdbcType=VARCHAR},
  199. </if>
  200. <if test="updateTime != null">
  201. #{updateTime,jdbcType=TIMESTAMP},
  202. </if>
  203. <if test="insertUpdateRemark != null">
  204. #{insertUpdateRemark,jdbcType=VARCHAR},
  205. </if>
  206. <if test="status != null">
  207. #{status,jdbcType=DECIMAL},
  208. </if>
  209. </trim>
  210. </insert>
  211. <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstruckReceiveResult">
  212. update TMSTRUCK_RECEIVE_RESULT
  213. set RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  214. RESULT_RECEIVE_TIME = #{resultReceiveTime,jdbcType=TIMESTAMP},
  215. RECEIVE_SINGER_ID = #{receiveSingerId,jdbcType=DECIMAL},
  216. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  217. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  218. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  219. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  220. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  221. STATUS = #{status,jdbcType=DECIMAL}
  222. where RESULT_RECEIVE_ID = #{resultReceiveId,jdbcType=DECIMAL}
  223. </update>
  224. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstruckReceiveResult">
  225. update TMSTRUCK_RECEIVE_RESULT
  226. <set>
  227. <if test="resultTotalId != null">
  228. RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  229. </if>
  230. <if test="resultReceiveTime != null">
  231. RESULT_RECEIVE_TIME = #{resultReceiveTime,jdbcType=TIMESTAMP},
  232. </if>
  233. <if test="receiveSingerId != null">
  234. RECEIVE_SINGER_ID = #{receiveSingerId,jdbcType=DECIMAL},
  235. </if>
  236. <if test="insertUsername != null">
  237. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  238. </if>
  239. <if test="insertTime != null">
  240. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  241. </if>
  242. <if test="updateUsername != null">
  243. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  244. </if>
  245. <if test="updateTime != null">
  246. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  247. </if>
  248. <if test="insertUpdateRemark != null">
  249. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  250. </if>
  251. <if test="status != null">
  252. STATUS = #{status,jdbcType=DECIMAL},
  253. </if>
  254. </set>
  255. where RESULT_RECEIVE_ID = #{resultReceiveId,jdbcType=DECIMAL}
  256. </update>
  257. <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
  258. <include refid="select" />
  259. where RESULT_RECEIVE_ID = #{resultReceiveId,jdbcType=DECIMAL}
  260. </select>
  261. <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  262. <include refid="select" />
  263. <include refid="where" />
  264. </select>
  265. <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  266. <include refid="select" />
  267. <include refid="whereLike" />
  268. </select>
  269. <insert id="batchInsert" parameterType="java.util.List">
  270. insert into TMSTRUCK_RECEIVE_RESULT
  271. (RESULT_RECEIVE_ID,
  272. RESULT_TOTAL_ID, RESULT_RECEIVE_TIME,
  273. RECEIVE_SINGER_ID, INSERT_USERNAME,
  274. INSERT_TIME, UPDATE_USERNAME,
  275. UPDATE_TIME, INSERT_UPDATE_REMARK,
  276. STATUS)
  277. ( <foreach collection="list" item="item" separator="union all">
  278. select
  279. #{item.resultReceiveId,jdbcType=DECIMAL},
  280. #{item.resultTotalId,jdbcType=DECIMAL}, #{item.resultReceiveTime,jdbcType=TIMESTAMP},
  281. #{item.receiveSingerId,jdbcType=DECIMAL}, #{item.insertUsername,jdbcType=VARCHAR},
  282. #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
  283. #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
  284. #{item.status,jdbcType=DECIMAL} from dual
  285. </foreach> )
  286. </insert>
  287. <update id="batchUpdate" parameterType="java.util.List">
  288. update TMSTRUCK_RECEIVE_RESULT
  289. set
  290. RESULT_RECEIVE_ID=
  291. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_RECEIVE_ID" separator=" ">
  292. when #{item.resultReceiveId,jdbcType=DECIMAL} then #{item.resultReceiveId,jdbcType=DECIMAL}
  293. </foreach>
  294. ,RESULT_TOTAL_ID=
  295. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_RECEIVE_ID" separator=" ">
  296. when #{item.resultReceiveId,jdbcType=DECIMAL} then #{item.resultTotalId,jdbcType=DECIMAL}
  297. </foreach>
  298. ,RESULT_RECEIVE_TIME=
  299. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_RECEIVE_ID" separator=" ">
  300. when #{item.resultReceiveId,jdbcType=DECIMAL} then #{item.resultReceiveTime,jdbcType=TIMESTAMP}
  301. </foreach>
  302. ,RECEIVE_SINGER_ID=
  303. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_RECEIVE_ID" separator=" ">
  304. when #{item.resultReceiveId,jdbcType=DECIMAL} then #{item.receiveSingerId,jdbcType=DECIMAL}
  305. </foreach>
  306. ,INSERT_USERNAME=
  307. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_RECEIVE_ID" separator=" ">
  308. when #{item.resultReceiveId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  309. </foreach>
  310. ,INSERT_TIME=
  311. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_RECEIVE_ID" separator=" ">
  312. when #{item.resultReceiveId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  313. </foreach>
  314. ,UPDATE_USERNAME=
  315. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_RECEIVE_ID" separator=" ">
  316. when #{item.resultReceiveId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  317. </foreach>
  318. ,UPDATE_TIME=
  319. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_RECEIVE_ID" separator=" ">
  320. when #{item.resultReceiveId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  321. </foreach>
  322. ,INSERT_UPDATE_REMARK=
  323. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_RECEIVE_ID" separator=" ">
  324. when #{item.resultReceiveId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  325. </foreach>
  326. ,STATUS=
  327. <foreach close="end" collection="list" index="index" item="item" open="case RESULT_RECEIVE_ID" separator=" ">
  328. when #{item.resultReceiveId,jdbcType=DECIMAL} then #{item.status,jdbcType=DECIMAL}
  329. </foreach>
  330. where RESULT_RECEIVE_ID in
  331. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  332. #{item.resultReceiveId,jdbcType=DECIMAL}
  333. </foreach>
  334. </update>
  335. <delete id="batchDelete" parameterType="java.util.List">
  336. delete from TMSTRUCK_RECEIVE_RESULT
  337. where RESULT_RECEIVE_ID in
  338. <foreach close=")" collection="list" item="id" open="(" separator=",">
  339. #{id}
  340. </foreach>
  341. </delete>
  342. <!-- 友情提示!!!-->
  343. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  344. <!-- 查询是否已收过货 -->
  345. <select id="getReceiveResult" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
  346. select TRR.RESULT_RECEIVE_ID
  347. from TMSTRUCK_RECEIVE_RESULT TRR
  348. where TRR.RESULT_TOTAL_ID = #{resultTotalId}
  349. </select>
  350. <!--通过总实绩Id 更新 状态码 为 1 已签收-->
  351. <update id="updateByTotalResultId" parameterType="com.steerinfo.dil.model.TmstruckReceiveResult">
  352. update TMSTRUCK_RECEIVE_RESULT
  353. <set>
  354. <if test="resultTotalId != null">
  355. RESULT_TOTAL_ID = #{resultTotalId,jdbcType=DECIMAL},
  356. </if>
  357. <if test="resultReceiveTime != null">
  358. RESULT_RECEIVE_TIME = #{resultReceiveTime,jdbcType=TIMESTAMP},
  359. </if>
  360. <if test="receiveSingerId != null">
  361. RECEIVE_SINGER_ID = #{receiveSingerId,jdbcType=DECIMAL},
  362. </if>
  363. <if test="insertUsername != null">
  364. INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
  365. </if>
  366. <if test="insertTime != null">
  367. INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
  368. </if>
  369. <if test="updateUsername != null">
  370. UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
  371. </if>
  372. <if test="updateTime != null">
  373. UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
  374. </if>
  375. <if test="insertUpdateRemark != null">
  376. INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
  377. </if>
  378. <if test="status != null">
  379. STATUS = #{status,jdbcType=DECIMAL},
  380. </if>
  381. </set>
  382. where RESULT_TOTAL_ID = #{resultTotalId}
  383. </update>
  384. </mapper>