RmsBidAreaMapper.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  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.RmsBidAreaMapper">
  4. <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.RmsBidArea">
  5. <id column="BID_AREA_ID" jdbcType="DECIMAL" property="bidAreaId" />
  6. <result column="BID_AREA_PROVINCE" jdbcType="VARCHAR" property="bidAreaProvince" />
  7. <result column="BID_AREA_CITY" jdbcType="VARCHAR" property="bidAreaCity" />
  8. <result column="BID_AREA_COUNTY" jdbcType="VARCHAR" property="bidAreaCounty" />
  9. <result column="BID_AREA_COUNTRY" jdbcType="VARCHAR" property="bidAreaCountry" />
  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. BID_AREA_ID, BID_AREA_PROVINCE, BID_AREA_CITY, BID_AREA_COUNTY, BID_AREA_COUNTRY,
  18. INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
  19. </sql>
  20. <sql id="columns_alias">
  21. t.BID_AREA_ID, t.BID_AREA_PROVINCE, t.BID_AREA_CITY, t.BID_AREA_COUNTY, t.BID_AREA_COUNTRY,
  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 RMS_BID_AREA
  26. </sql>
  27. <sql id="select_alias">
  28. SELECT <include refid="columns_alias" /> FROM RMS_BID_AREA t
  29. </sql>
  30. <sql id="where">
  31. <where>
  32. <if test="bidAreaId != null">
  33. and BID_AREA_ID = #{bidAreaId}
  34. </if>
  35. <if test="bidAreaProvince != null and bidAreaProvince != ''">
  36. and BID_AREA_PROVINCE = #{bidAreaProvince}
  37. </if>
  38. <if test="bidAreaCity != null and bidAreaCity != ''">
  39. and BID_AREA_CITY = #{bidAreaCity}
  40. </if>
  41. <if test="bidAreaCounty != null and bidAreaCounty != ''">
  42. and BID_AREA_COUNTY = #{bidAreaCounty}
  43. </if>
  44. <if test="bidAreaCountry != null and bidAreaCountry != ''">
  45. and BID_AREA_COUNTRY = #{bidAreaCountry}
  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="bidAreaId != null">
  67. and BID_AREA_ID = #{bidAreaId}
  68. </if>
  69. <if test="bidAreaProvince != null and bidAreaProvince != ''">
  70. and BID_AREA_PROVINCE LIKE '%${bidAreaProvince}%'
  71. </if>
  72. <if test="bidAreaCity != null and bidAreaCity != ''">
  73. and BID_AREA_CITY LIKE '%${bidAreaCity}%'
  74. </if>
  75. <if test="bidAreaCounty != null and bidAreaCounty != ''">
  76. and BID_AREA_COUNTY LIKE '%${bidAreaCounty}%'
  77. </if>
  78. <if test="bidAreaCountry != null and bidAreaCountry != ''">
  79. and BID_AREA_COUNTRY LIKE '%${bidAreaCountry}%'
  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.lang.Short">
  99. delete from RMS_BID_AREA
  100. where BID_AREA_ID = #{bidAreaId,jdbcType=DECIMAL}
  101. </delete>
  102. <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
  103. delete from RMS_BID_AREA
  104. where 1!=1
  105. <if test="bidAreaProvince != null and bidAreaProvince != ''">
  106. or BID_AREA_PROVINCE = #{bidAreaProvince}
  107. </if>
  108. <if test="bidAreaCity != null and bidAreaCity != ''">
  109. or BID_AREA_CITY = #{bidAreaCity}
  110. </if>
  111. <if test="bidAreaCounty != null and bidAreaCounty != ''">
  112. or BID_AREA_COUNTY = #{bidAreaCounty}
  113. </if>
  114. <if test="bidAreaCountry != null and bidAreaCountry != ''">
  115. or BID_AREA_COUNTRY = #{bidAreaCountry}
  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.dil.model.RmsBidArea">
  134. insert into RMS_BID_AREA (BID_AREA_ID, BID_AREA_PROVINCE, BID_AREA_CITY,
  135. BID_AREA_COUNTY, BID_AREA_COUNTRY, INSERT_USERNAME,
  136. INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME,
  137. INSERT_UPDATE_REMARK)
  138. values (#{bidAreaId,jdbcType=DECIMAL}, #{bidAreaProvince,jdbcType=VARCHAR}, #{bidAreaCity,jdbcType=VARCHAR},
  139. #{bidAreaCounty,jdbcType=VARCHAR}, #{bidAreaCountry,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.dil.model.RmsBidArea">
  144. insert into RMS_BID_AREA
  145. <trim prefix="(" suffix=")" suffixOverrides=",">
  146. <if test="bidAreaId != null">
  147. BID_AREA_ID,
  148. </if>
  149. <if test="bidAreaProvince != null">
  150. BID_AREA_PROVINCE,
  151. </if>
  152. <if test="bidAreaCity != null">
  153. BID_AREA_CITY,
  154. </if>
  155. <if test="bidAreaCounty != null">
  156. BID_AREA_COUNTY,
  157. </if>
  158. <if test="bidAreaCountry != null">
  159. BID_AREA_COUNTRY,
  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="bidAreaId != null">
  179. #{bidAreaId,jdbcType=DECIMAL},
  180. </if>
  181. <if test="bidAreaProvince != null">
  182. #{bidAreaProvince,jdbcType=VARCHAR},
  183. </if>
  184. <if test="bidAreaCity != null">
  185. #{bidAreaCity,jdbcType=VARCHAR},
  186. </if>
  187. <if test="bidAreaCounty != null">
  188. #{bidAreaCounty,jdbcType=VARCHAR},
  189. </if>
  190. <if test="bidAreaCountry != null">
  191. #{bidAreaCountry,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.dil.model.RmsBidArea">
  211. update RMS_BID_AREA
  212. set BID_AREA_PROVINCE = #{bidAreaProvince,jdbcType=VARCHAR},
  213. BID_AREA_CITY = #{bidAreaCity,jdbcType=VARCHAR},
  214. BID_AREA_COUNTY = #{bidAreaCounty,jdbcType=VARCHAR},
  215. BID_AREA_COUNTRY = #{bidAreaCountry,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 BID_AREA_ID = #{bidAreaId,jdbcType=DECIMAL}
  222. </update>
  223. <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsBidArea">
  224. update RMS_BID_AREA
  225. <set>
  226. <if test="bidAreaProvince != null">
  227. BID_AREA_PROVINCE = #{bidAreaProvince,jdbcType=VARCHAR},
  228. </if>
  229. <if test="bidAreaCity != null">
  230. BID_AREA_CITY = #{bidAreaCity,jdbcType=VARCHAR},
  231. </if>
  232. <if test="bidAreaCounty != null">
  233. BID_AREA_COUNTY = #{bidAreaCounty,jdbcType=VARCHAR},
  234. </if>
  235. <if test="bidAreaCountry != null">
  236. BID_AREA_COUNTRY = #{bidAreaCountry,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 BID_AREA_ID = #{bidAreaId,jdbcType=DECIMAL}
  255. </update>
  256. <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
  257. <include refid="select" />
  258. where BID_AREA_ID = #{bidAreaId,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 RMS_BID_AREA
  270. (BID_AREA_ID,
  271. BID_AREA_PROVINCE, BID_AREA_CITY,
  272. BID_AREA_COUNTY, BID_AREA_COUNTRY,
  273. INSERT_USERNAME, INSERT_TIME,
  274. UPDATE_USERNAME, UPDATE_TIME,
  275. INSERT_UPDATE_REMARK)
  276. ( <foreach collection="list" item="item" separator="union all">
  277. select
  278. #{item.bidAreaId,jdbcType=DECIMAL},
  279. #{item.bidAreaProvince,jdbcType=VARCHAR}, #{item.bidAreaCity,jdbcType=VARCHAR},
  280. #{item.bidAreaCounty,jdbcType=VARCHAR}, #{item.bidAreaCountry,jdbcType=VARCHAR},
  281. #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
  282. #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
  283. #{item.insertUpdateRemark,jdbcType=VARCHAR} from dual
  284. </foreach> )
  285. </insert>
  286. <update id="batchUpdate" parameterType="java.util.List">
  287. update RMS_BID_AREA
  288. set
  289. BID_AREA_ID=
  290. <foreach close="end" collection="list" index="index" item="item" open="case BID_AREA_ID" separator=" ">
  291. when #{item.bidAreaId,jdbcType=DECIMAL} then #{item.bidAreaId,jdbcType=DECIMAL}
  292. </foreach>
  293. ,BID_AREA_PROVINCE=
  294. <foreach close="end" collection="list" index="index" item="item" open="case BID_AREA_ID" separator=" ">
  295. when #{item.bidAreaId,jdbcType=DECIMAL} then #{item.bidAreaProvince,jdbcType=VARCHAR}
  296. </foreach>
  297. ,BID_AREA_CITY=
  298. <foreach close="end" collection="list" index="index" item="item" open="case BID_AREA_ID" separator=" ">
  299. when #{item.bidAreaId,jdbcType=DECIMAL} then #{item.bidAreaCity,jdbcType=VARCHAR}
  300. </foreach>
  301. ,BID_AREA_COUNTY=
  302. <foreach close="end" collection="list" index="index" item="item" open="case BID_AREA_ID" separator=" ">
  303. when #{item.bidAreaId,jdbcType=DECIMAL} then #{item.bidAreaCounty,jdbcType=VARCHAR}
  304. </foreach>
  305. ,BID_AREA_COUNTRY=
  306. <foreach close="end" collection="list" index="index" item="item" open="case BID_AREA_ID" separator=" ">
  307. when #{item.bidAreaId,jdbcType=DECIMAL} then #{item.bidAreaCountry,jdbcType=VARCHAR}
  308. </foreach>
  309. ,INSERT_USERNAME=
  310. <foreach close="end" collection="list" index="index" item="item" open="case BID_AREA_ID" separator=" ">
  311. when #{item.bidAreaId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
  312. </foreach>
  313. ,INSERT_TIME=
  314. <foreach close="end" collection="list" index="index" item="item" open="case BID_AREA_ID" separator=" ">
  315. when #{item.bidAreaId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
  316. </foreach>
  317. ,UPDATE_USERNAME=
  318. <foreach close="end" collection="list" index="index" item="item" open="case BID_AREA_ID" separator=" ">
  319. when #{item.bidAreaId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
  320. </foreach>
  321. ,UPDATE_TIME=
  322. <foreach close="end" collection="list" index="index" item="item" open="case BID_AREA_ID" separator=" ">
  323. when #{item.bidAreaId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
  324. </foreach>
  325. ,INSERT_UPDATE_REMARK=
  326. <foreach close="end" collection="list" index="index" item="item" open="case BID_AREA_ID" separator=" ">
  327. when #{item.bidAreaId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
  328. </foreach>
  329. where BID_AREA_ID in
  330. <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
  331. #{item.bidAreaId,jdbcType=DECIMAL}
  332. </foreach>
  333. </update>
  334. <delete id="batchDelete" parameterType="java.util.List">
  335. delete from RMS_BID_AREA
  336. where BID_AREA_ID in
  337. <foreach close=")" collection="list" item="id" open="(" separator=",">
  338. #{id}
  339. </foreach>
  340. </delete>
  341. <!-- 友情提示!!!-->
  342. <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
  343. <!-- 展示中标区域信息-->
  344. <select id="getCarrierBidAreaList" resultType="java.util.Map">
  345. SELECT
  346. RBA.BID_AREA_ID AS "bidAreaId",
  347. RBA.BID_AREA_PROVINCE AS "bidAreaProvince",
  348. RBA.BID_AREA_CITY AS "bidAreaCity",
  349. RBA.BID_AREA_COUNTY AS "bidAreaCount",
  350. RBA.BID_AREA_COUNTRY AS "bidAreaCountry"
  351. FROM RMS_BID_AREA RBA
  352. </select>
  353. <!-- 根据id查询中标区域信息-->
  354. <select id="getBidAreaById" resultType="java.util.Map">
  355. SELECT
  356. RBA.BID_AREA_PROVINCE AS "bidAreaProvince",
  357. RBA.BID_AREA_CITY AS "bidAreaCity",
  358. RBA.BID_AREA_COUNTY AS "bidAreaCount",
  359. RBA.BID_AREA_COUNTRY AS "bidAreaCountry"
  360. FROM RMS_BID_AREA RBA
  361. WHERE RBA.BID_AREA_ID=#{id}
  362. </select>
  363. </mapper>