StationInfoMapper.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  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.platform.yijia.dao.StationInfoMapper">
  4. <resultMap id="BaseResultMap" type="com.platform.yijia.pojo.StationInfo">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. -->
  9. <id column="station_id" jdbcType="INTEGER" property="stationId" />
  10. <result column="station_name" jdbcType="VARCHAR" property="stationName" />
  11. <result column="station_address" jdbcType="VARCHAR" property="stationAddress" />
  12. <result column="oil_gun_num" jdbcType="INTEGER" property="oilGunNum" />
  13. <result column="contacts" jdbcType="VARCHAR" property="contacts" />
  14. <result column="phone" jdbcType="VARCHAR" property="phone" />
  15. <result column="station_group_id" jdbcType="INTEGER" property="stationGroupId" />
  16. <result column="station_group_name" jdbcType="VARCHAR" property="stationGroupName" />
  17. <result column="station_longitude" jdbcType="VARCHAR" property="stationLongitude" />
  18. <result column="station_latitude" jdbcType="VARCHAR" property="stationLatitude" />
  19. <result column="station_pic" jdbcType="VARCHAR" property="stationPic" />
  20. <result column="mno" jdbcType="INTEGER" property="mno" />
  21. <result column="app_id" jdbcType="VARCHAR" property="appId" />
  22. </resultMap>
  23. <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.platform.yijia.pojo.StationInfo">
  24. <!--
  25. WARNING - @mbg.generated
  26. This element is automatically generated by MyBatis Generator, do not modify.
  27. -->
  28. <result column="station_pic" jdbcType="LONGVARBINARY" property="stationPic" />
  29. </resultMap>
  30. <sql id="Example_Where_Clause">
  31. <!--
  32. WARNING - @mbg.generated
  33. This element is automatically generated by MyBatis Generator, do not modify.
  34. -->
  35. <where>
  36. <foreach collection="oredCriteria" item="criteria" separator="or">
  37. <if test="criteria.valid">
  38. <trim prefix="(" prefixOverrides="and" suffix=")">
  39. <foreach collection="criteria.criteria" item="criterion">
  40. <choose>
  41. <when test="criterion.noValue">
  42. and ${criterion.condition}
  43. </when>
  44. <when test="criterion.singleValue">
  45. and ${criterion.condition} #{criterion.value}
  46. </when>
  47. <when test="criterion.betweenValue">
  48. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  49. </when>
  50. <when test="criterion.listValue">
  51. and ${criterion.condition}
  52. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  53. #{listItem}
  54. </foreach>
  55. </when>
  56. </choose>
  57. </foreach>
  58. </trim>
  59. </if>
  60. </foreach>
  61. </where>
  62. </sql>
  63. <sql id="Update_By_Example_Where_Clause">
  64. <!--
  65. WARNING - @mbg.generated
  66. This element is automatically generated by MyBatis Generator, do not modify.
  67. -->
  68. <where>
  69. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  70. <if test="criteria.valid">
  71. <trim prefix="(" prefixOverrides="and" suffix=")">
  72. <foreach collection="criteria.criteria" item="criterion">
  73. <choose>
  74. <when test="criterion.noValue">
  75. and ${criterion.condition}
  76. </when>
  77. <when test="criterion.singleValue">
  78. and ${criterion.condition} #{criterion.value}
  79. </when>
  80. <when test="criterion.betweenValue">
  81. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  82. </when>
  83. <when test="criterion.listValue">
  84. and ${criterion.condition}
  85. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  86. #{listItem}
  87. </foreach>
  88. </when>
  89. </choose>
  90. </foreach>
  91. </trim>
  92. </if>
  93. </foreach>
  94. </where>
  95. </sql>
  96. <sql id="Base_Column_List">
  97. <!--
  98. WARNING - @mbg.generated
  99. This element is automatically generated by MyBatis Generator, do not modify.
  100. -->
  101. station_id, station_name, station_address, oil_gun_num, contacts, phone, station_group_id,
  102. station_group_name, station_longitude, station_latitude, mno
  103. </sql>
  104. <sql id="Blob_Column_List">
  105. <!--
  106. WARNING - @mbg.generated
  107. This element is automatically generated by MyBatis Generator, do not modify.
  108. -->
  109. station_pic
  110. </sql>
  111. <select id="selectByExampleWithBLOBs" parameterType="com.platform.yijia.pojo.StationInfoExample" resultMap="ResultMapWithBLOBs">
  112. <!--
  113. WARNING - @mbg.generated
  114. This element is automatically generated by MyBatis Generator, do not modify.
  115. -->
  116. select
  117. <if test="distinct">
  118. distinct
  119. </if>
  120. <include refid="Base_Column_List" />
  121. ,
  122. <include refid="Blob_Column_List" />
  123. from station_info
  124. <if test="_parameter != null">
  125. <include refid="Example_Where_Clause" />
  126. </if>
  127. <if test="orderByClause != null">
  128. order by ${orderByClause}
  129. </if>
  130. </select>
  131. <select id="selectByExample" parameterType="com.platform.yijia.pojo.StationInfoExample" resultMap="BaseResultMap">
  132. <!--
  133. WARNING - @mbg.generated
  134. This element is automatically generated by MyBatis Generator, do not modify.
  135. -->
  136. select
  137. <if test="distinct">
  138. distinct
  139. </if>
  140. <include refid="Base_Column_List" />
  141. ,
  142. <include refid="Blob_Column_List" />
  143. from station_info
  144. <if test="_parameter != null">
  145. <include refid="Example_Where_Clause" />
  146. </if>
  147. <if test="orderByClause != null">
  148. order by ${orderByClause}
  149. </if>
  150. </select>
  151. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
  152. <!--
  153. WARNING - @mbg.generated
  154. This element is automatically generated by MyBatis Generator, do not modify.
  155. -->
  156. select
  157. <include refid="Base_Column_List" />
  158. ,
  159. <include refid="Blob_Column_List" />
  160. from station_info
  161. where station_id = #{stationId,jdbcType=INTEGER}
  162. </select>
  163. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  164. <!--
  165. WARNING - @mbg.generated
  166. This element is automatically generated by MyBatis Generator, do not modify.
  167. -->
  168. delete from station_info
  169. where station_id = #{stationId,jdbcType=INTEGER}
  170. </delete>
  171. <delete id="deleteByExample" parameterType="com.platform.yijia.pojo.StationInfoExample">
  172. <!--
  173. WARNING - @mbg.generated
  174. This element is automatically generated by MyBatis Generator, do not modify.
  175. -->
  176. delete from station_info
  177. <if test="_parameter != null">
  178. <include refid="Example_Where_Clause" />
  179. </if>
  180. </delete>
  181. <insert id="insert" parameterType="com.platform.yijia.pojo.StationInfo">
  182. <!--
  183. WARNING - @mbg.generated
  184. This element is automatically generated by MyBatis Generator, do not modify.
  185. -->
  186. insert into station_info (station_id, station_name, station_address,
  187. oil_gun_num, contacts, phone,
  188. station_group_id, station_group_name, station_longitude,
  189. station_latitude, mno, station_pic
  190. )
  191. values (#{stationId,jdbcType=INTEGER}, #{stationName,jdbcType=VARCHAR}, #{stationAddress,jdbcType=VARCHAR},
  192. #{oilGunNum,jdbcType=INTEGER}, #{contacts,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
  193. #{stationGroupId,jdbcType=INTEGER}, #{stationGroupName,jdbcType=VARCHAR}, #{stationLongitude,jdbcType=VARCHAR},
  194. #{stationLatitude,jdbcType=VARCHAR}, #{mno,jdbcType=INTEGER}, #{stationPic,jdbcType=LONGVARBINARY}
  195. )
  196. </insert>
  197. <insert id="insertSelective" parameterType="com.platform.yijia.pojo.StationInfo">
  198. <!--
  199. WARNING - @mbg.generated
  200. This element is automatically generated by MyBatis Generator, do not modify.
  201. -->
  202. insert into station_info
  203. <trim prefix="(" suffix=")" suffixOverrides=",">
  204. <if test="stationId != null">
  205. station_id,
  206. </if>
  207. <if test="stationName != null">
  208. station_name,
  209. </if>
  210. <if test="stationAddress != null">
  211. station_address,
  212. </if>
  213. <if test="oilGunNum != null">
  214. oil_gun_num,
  215. </if>
  216. <if test="contacts != null">
  217. contacts,
  218. </if>
  219. <if test="phone != null">
  220. phone,
  221. </if>
  222. <if test="stationGroupId != null">
  223. station_group_id,
  224. </if>
  225. <if test="stationGroupName != null">
  226. station_group_name,
  227. </if>
  228. <if test="stationLongitude != null">
  229. station_longitude,
  230. </if>
  231. <if test="stationLatitude != null">
  232. station_latitude,
  233. </if>
  234. <if test="mno != null">
  235. mno,
  236. </if>
  237. <if test="stationPic != null">
  238. station_pic,
  239. </if>
  240. </trim>
  241. <trim prefix="values (" suffix=")" suffixOverrides=",">
  242. <if test="stationId != null">
  243. #{stationId,jdbcType=INTEGER},
  244. </if>
  245. <if test="stationName != null">
  246. #{stationName,jdbcType=VARCHAR},
  247. </if>
  248. <if test="stationAddress != null">
  249. #{stationAddress,jdbcType=VARCHAR},
  250. </if>
  251. <if test="oilGunNum != null">
  252. #{oilGunNum,jdbcType=INTEGER},
  253. </if>
  254. <if test="contacts != null">
  255. #{contacts,jdbcType=VARCHAR},
  256. </if>
  257. <if test="phone != null">
  258. #{phone,jdbcType=VARCHAR},
  259. </if>
  260. <if test="stationGroupId != null">
  261. #{stationGroupId,jdbcType=INTEGER},
  262. </if>
  263. <if test="stationGroupName != null">
  264. #{stationGroupName,jdbcType=VARCHAR},
  265. </if>
  266. <if test="stationLongitude != null">
  267. #{stationLongitude,jdbcType=VARCHAR},
  268. </if>
  269. <if test="stationLatitude != null">
  270. #{stationLatitude,jdbcType=VARCHAR},
  271. </if>
  272. <if test="mno != null">
  273. #{mno,jdbcType=INTEGER},
  274. </if>
  275. <if test="stationPic != null">
  276. #{stationPic,jdbcType=LONGVARBINARY},
  277. </if>
  278. </trim>
  279. </insert>
  280. <select id="countByExample" parameterType="com.platform.yijia.pojo.StationInfoExample" resultType="java.lang.Long">
  281. <!--
  282. WARNING - @mbg.generated
  283. This element is automatically generated by MyBatis Generator, do not modify.
  284. -->
  285. select count(*) from station_info
  286. <if test="_parameter != null">
  287. <include refid="Example_Where_Clause" />
  288. </if>
  289. </select>
  290. <update id="updateByExampleSelective" parameterType="map">
  291. <!--
  292. WARNING - @mbg.generated
  293. This element is automatically generated by MyBatis Generator, do not modify.
  294. -->
  295. update station_info
  296. <set>
  297. <if test="record.stationId != null">
  298. station_id = #{record.stationId,jdbcType=INTEGER},
  299. </if>
  300. <if test="record.stationName != null">
  301. station_name = #{record.stationName,jdbcType=VARCHAR},
  302. </if>
  303. <if test="record.stationAddress != null">
  304. station_address = #{record.stationAddress,jdbcType=VARCHAR},
  305. </if>
  306. <if test="record.oilGunNum != null">
  307. oil_gun_num = #{record.oilGunNum,jdbcType=INTEGER},
  308. </if>
  309. <if test="record.contacts != null">
  310. contacts = #{record.contacts,jdbcType=VARCHAR},
  311. </if>
  312. <if test="record.phone != null">
  313. phone = #{record.phone,jdbcType=VARCHAR},
  314. </if>
  315. <if test="record.stationGroupId != null">
  316. station_group_id = #{record.stationGroupId,jdbcType=INTEGER},
  317. </if>
  318. <if test="record.stationGroupName != null">
  319. station_group_name = #{record.stationGroupName,jdbcType=VARCHAR},
  320. </if>
  321. <if test="record.stationLongitude != null">
  322. station_longitude = #{record.stationLongitude,jdbcType=VARCHAR},
  323. </if>
  324. <if test="record.stationLatitude != null">
  325. station_latitude = #{record.stationLatitude,jdbcType=VARCHAR},
  326. </if>
  327. <if test="record.mno != null">
  328. mno = #{record.mno,jdbcType=INTEGER},
  329. </if>
  330. <if test="record.stationPic != null">
  331. station_pic = #{record.stationPic,jdbcType=LONGVARBINARY},
  332. </if>
  333. </set>
  334. <if test="_parameter != null">
  335. <include refid="Update_By_Example_Where_Clause" />
  336. </if>
  337. </update>
  338. <update id="updateByExampleWithBLOBs" parameterType="map">
  339. <!--
  340. WARNING - @mbg.generated
  341. This element is automatically generated by MyBatis Generator, do not modify.
  342. -->
  343. update station_info
  344. set station_id = #{record.stationId,jdbcType=INTEGER},
  345. station_name = #{record.stationName,jdbcType=VARCHAR},
  346. station_address = #{record.stationAddress,jdbcType=VARCHAR},
  347. oil_gun_num = #{record.oilGunNum,jdbcType=INTEGER},
  348. contacts = #{record.contacts,jdbcType=VARCHAR},
  349. phone = #{record.phone,jdbcType=VARCHAR},
  350. station_group_id = #{record.stationGroupId,jdbcType=INTEGER},
  351. station_group_name = #{record.stationGroupName,jdbcType=VARCHAR},
  352. station_longitude = #{record.stationLongitude,jdbcType=VARCHAR},
  353. station_latitude = #{record.stationLatitude,jdbcType=VARCHAR},
  354. mno = #{record.mno,jdbcType=INTEGER},
  355. station_pic = #{record.stationPic,jdbcType=LONGVARBINARY}
  356. <if test="_parameter != null">
  357. <include refid="Update_By_Example_Where_Clause" />
  358. </if>
  359. </update>
  360. <update id="updateByExample" parameterType="map">
  361. <!--
  362. WARNING - @mbg.generated
  363. This element is automatically generated by MyBatis Generator, do not modify.
  364. -->
  365. update station_info
  366. set station_id = #{record.stationId,jdbcType=INTEGER},
  367. station_name = #{record.stationName,jdbcType=VARCHAR},
  368. station_address = #{record.stationAddress,jdbcType=VARCHAR},
  369. oil_gun_num = #{record.oilGunNum,jdbcType=INTEGER},
  370. contacts = #{record.contacts,jdbcType=VARCHAR},
  371. phone = #{record.phone,jdbcType=VARCHAR},
  372. station_group_id = #{record.stationGroupId,jdbcType=INTEGER},
  373. station_group_name = #{record.stationGroupName,jdbcType=VARCHAR},
  374. station_longitude = #{record.stationLongitude,jdbcType=VARCHAR},
  375. station_latitude = #{record.stationLatitude,jdbcType=VARCHAR},
  376. mno = #{record.mno,jdbcType=INTEGER}
  377. <if test="_parameter != null">
  378. <include refid="Update_By_Example_Where_Clause" />
  379. </if>
  380. </update>
  381. <update id="updateByPrimaryKeySelective" parameterType="com.platform.yijia.pojo.StationInfo">
  382. <!--
  383. WARNING - @mbg.generated
  384. This element is automatically generated by MyBatis Generator, do not modify.
  385. -->
  386. update station_info
  387. <set>
  388. <if test="stationName != null">
  389. station_name = #{stationName,jdbcType=VARCHAR},
  390. </if>
  391. <if test="stationAddress != null">
  392. station_address = #{stationAddress,jdbcType=VARCHAR},
  393. </if>
  394. <if test="oilGunNum != null">
  395. oil_gun_num = #{oilGunNum,jdbcType=INTEGER},
  396. </if>
  397. <if test="contacts != null">
  398. contacts = #{contacts,jdbcType=VARCHAR},
  399. </if>
  400. <if test="phone != null">
  401. phone = #{phone,jdbcType=VARCHAR},
  402. </if>
  403. <if test="stationGroupId != null">
  404. station_group_id = #{stationGroupId,jdbcType=INTEGER},
  405. </if>
  406. <if test="stationGroupName != null">
  407. station_group_name = #{stationGroupName,jdbcType=VARCHAR},
  408. </if>
  409. <if test="stationLongitude != null">
  410. station_longitude = #{stationLongitude,jdbcType=VARCHAR},
  411. </if>
  412. <if test="stationLatitude != null">
  413. station_latitude = #{stationLatitude,jdbcType=VARCHAR},
  414. </if>
  415. <if test="mno != null">
  416. mno = #{mno,jdbcType=INTEGER},
  417. </if>
  418. <if test="stationPic != null">
  419. station_pic = #{stationPic,jdbcType=LONGVARBINARY},
  420. </if>
  421. </set>
  422. where station_id = #{stationId,jdbcType=INTEGER}
  423. </update>
  424. <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.platform.yijia.pojo.StationInfo">
  425. <!--
  426. WARNING - @mbg.generated
  427. This element is automatically generated by MyBatis Generator, do not modify.
  428. -->
  429. update station_info
  430. set station_name = #{stationName,jdbcType=VARCHAR},
  431. station_address = #{stationAddress,jdbcType=VARCHAR},
  432. oil_gun_num = #{oilGunNum,jdbcType=INTEGER},
  433. contacts = #{contacts,jdbcType=VARCHAR},
  434. phone = #{phone,jdbcType=VARCHAR},
  435. station_group_id = #{stationGroupId,jdbcType=INTEGER},
  436. station_group_name = #{stationGroupName,jdbcType=VARCHAR},
  437. station_longitude = #{stationLongitude,jdbcType=VARCHAR},
  438. station_latitude = #{stationLatitude,jdbcType=VARCHAR},
  439. mno = #{mno,jdbcType=INTEGER},
  440. station_pic = #{stationPic,jdbcType=LONGVARBINARY}
  441. where station_id = #{stationId,jdbcType=INTEGER}
  442. </update>
  443. <update id="updateByPrimaryKey" parameterType="com.platform.yijia.pojo.StationInfo">
  444. <!--
  445. WARNING - @mbg.generated
  446. This element is automatically generated by MyBatis Generator, do not modify.
  447. -->
  448. update station_info
  449. set station_name = #{stationName,jdbcType=VARCHAR},
  450. station_address = #{stationAddress,jdbcType=VARCHAR},
  451. oil_gun_num = #{oilGunNum,jdbcType=INTEGER},
  452. contacts = #{contacts,jdbcType=VARCHAR},
  453. phone = #{phone,jdbcType=VARCHAR},
  454. station_group_id = #{stationGroupId,jdbcType=INTEGER},
  455. station_group_name = #{stationGroupName,jdbcType=VARCHAR},
  456. station_longitude = #{stationLongitude,jdbcType=VARCHAR},
  457. station_latitude = #{stationLatitude,jdbcType=VARCHAR},
  458. mno = #{mno,jdbcType=INTEGER}
  459. where station_id = #{stationId,jdbcType=INTEGER}
  460. </update>
  461. <!--查询油站的优惠方式-->
  462. <select id="getStationDiscountWay" parameterType="String" resultType="String">
  463. SELECT
  464. discount_setting AS discountSetting
  465. FROM
  466. station_pay
  467. <where>
  468. <if test="stationId !='' and stationId != null" >
  469. station_id = #{stationId}
  470. </if>
  471. </where>
  472. </select>
  473. <!--查询油站小程序AppId和AppSecret-->
  474. <select id="getStationAppIdAndAppSecret" parameterType="String" resultType="Map">
  475. SELECT
  476. app_id AS appId,
  477. app_secret AS appSecret
  478. FROM
  479. station_info
  480. <where>
  481. <if test="stationId !='' and stationId != null" >
  482. station_id = #{stationId}
  483. </if>
  484. </where>
  485. </select>
  486. </mapper>