TmstruckReceiptResultChildMapper.xml 14 KB

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