TmsPleaseApproveMapper.xml 15 KB

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