StationInfoMapper.xml 16 KB

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