StationInfoMapper.xml 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  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. <id column="dept_id" jdbcType="INTEGER" property="stationId" />
  6. <id column="parent_id" jdbcType="INTEGER" property="groupId" />
  7. <result column="dept_name" jdbcType="VARCHAR" property="stationName" />
  8. <result column="city" jdbcType="VARCHAR" property="city" />
  9. <result column="dept_address" jdbcType="VARCHAR" property="stationAddress" />
  10. <result column="oil_gun_num" jdbcType="INTEGER" property="oilGunNum" />
  11. <result column="leader" jdbcType="VARCHAR" property="contacts" />
  12. <result column="ji_bie" jdbcType="VARCHAR" property="jiBie"/>
  13. <result column="phone" jdbcType="VARCHAR" property="phone" />
  14. <result column="station_longitude" jdbcType="VARCHAR" property="stationLongitude" />
  15. <result column="station_latitude" jdbcType="VARCHAR" property="stationLatitude" />
  16. <result column="station_pic" jdbcType="VARCHAR" property="stationPic" />
  17. <result column="image1" jdbcType="VARCHAR" property="image1" />
  18. <result column="image2" jdbcType="VARCHAR" property="image2" />
  19. <result column="image3" jdbcType="VARCHAR" property="image3" />
  20. <result column="image4" jdbcType="VARCHAR" property="image4" />
  21. <result column="image5" jdbcType="VARCHAR" property="image5" />
  22. <result column="notice" jdbcType="VARCHAR" property="notice" />
  23. <result column="mno" jdbcType="INTEGER" property="mno" />
  24. <result column="print_setting" jdbcType="VARCHAR" property="printSetting" />
  25. <result column="ws_print_flag" jdbcType="VARCHAR" property="wsPrintFlag" />
  26. <result column="discount_setting" jdbcType="VARCHAR" property="discountSetting" />
  27. <result column="card_enabled_flag" jdbcType="VARCHAR" property="cardEnabledFlag" />
  28. <result column="integral_flag" jdbcType="VARCHAR" property="integralFlag" />
  29. <result column="label_flag" jdbcType="VARCHAR" property="labelFlag" />
  30. <result column="integral_print_flag" jdbcType="VARCHAR" property="integralPrintFlag" />
  31. <result column="integral_rule_flag" jdbcType="VARCHAR" property="integralRuleFlag" />
  32. <result column="coupon_flag" jdbcType="VARCHAR" property="couponFlag" />
  33. <result column="coupon_enabled_flag" jdbcType="VARCHAR" property="couponEnabledFlag" />
  34. <result column="card_rule_flag_group" jdbcType="VARCHAR" property="cardRuleFlagGroup" />
  35. <result column="card_enabled_flag_group" jdbcType="VARCHAR" property="cardEnabledFlagGroup" />
  36. <result column="integral_flag_group" jdbcType="VARCHAR" property="integralFlagGroup" />
  37. <result column="integral_rule_flag_group" jdbcType="VARCHAR" property="integralRuleFlagGroup" />
  38. <result column="is_lng_flag" jdbcType="VARCHAR" property="isLngFlag" />
  39. <result column="is_lng_flag_group" jdbcType="VARCHAR" property="isLngFlagGroup" />
  40. <result column="coupon_flag_group" jdbcType="VARCHAR" property="couponFlagGroup" />
  41. <result column="coupon_enabled_flag_group" jdbcType="VARCHAR" property="couponEnabledFlagGroup" />
  42. <result column="single_station_flag" jdbcType="VARCHAR" property="singleStationFlag" />
  43. <result column="card_rule_flag" jdbcType="VARCHAR" property="cardRuleFlag" />
  44. <result column="print_device_type" jdbcType="VARCHAR" property="printDeviceType" />
  45. <result column="app_id" jdbcType="VARCHAR" property="appId" />
  46. <result column="gzh_app_id" jdbcType="VARCHAR" property="gzhAppId" />
  47. </resultMap>
  48. <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.platform.yijia.pojo.StationInfo">
  49. <result column="station_pic" jdbcType="LONGVARBINARY" property="stationPic" />
  50. </resultMap>
  51. <!--油站轮播图片信息返回结果-->
  52. <!-- <resultMap id="StationPicResultMap" type="com.platform.yijia.pojo.StationPic">-->
  53. <!-- <id column="id" jdbcType="INTEGER" property="id" />-->
  54. <!-- <result column="name" jdbcType="VARCHAR" property="name" />-->
  55. <!-- <result column="url" jdbcType="VARCHAR" property="url" />-->
  56. <!-- <result column="station_id" jdbcType="INTEGER" property="stationId" />-->
  57. <!-- <result column="station_name" jdbcType="VARCHAR" property="stationName" />-->
  58. <!-- <result column="parent_id" jdbcType="VARCHAR" property="parentId" />-->
  59. <!-- </resultMap>-->
  60. <!--查询油站轮播图片信息-->
  61. <select id="getStationPicList" resultMap="BaseResultMap" parameterType="com.platform.yijia.pojo.StationInfo">
  62. SELECT
  63. dept_id,
  64. dept_name,
  65. notice,
  66. image1,
  67. image2,
  68. image3,
  69. image4,
  70. image5
  71. FROM
  72. sys_dept
  73. <where>
  74. <if test="stationId !=null and stationId !=''">
  75. AND dept_id = #{stationId}
  76. </if>
  77. </where>
  78. </select>
  79. <!--获取油站的某个油品的价格和营销方案信息-->
  80. <select id="selectStationOilPriceAndDiscountSetting" parameterType="Map" resultType="Map">
  81. SELECT
  82. T1.dept_id AS stationId,
  83. T1.parent_id AS groupId,
  84. T1.discount_setting AS discountSetting,
  85. T1.card_enabled_flag AS cardEnabledFlag,
  86. T3.card_rule_flag AS cardRuleFlag,
  87. T2.oil_price AS oilPrice,
  88. T4.settlement_type AS settlementType,
  89. T4.settlement_price AS settlementPrice,
  90. T4.driver_price_type AS driverPriceType,
  91. T4.driver_price AS driverPrice
  92. FROM sys_dept AS T1
  93. LEFT JOIN station_oil_price AS T2 ON T1.dept_id = T2.station_id
  94. LEFT JOIN sys_dept AS T3 ON T1.parent_id = T3.dept_id
  95. LEFT JOIN station_settlement_price AS T4 ON T2.station_id = T4.station_id
  96. <where>
  97. <if test="stationId !='' and stationId != null" >
  98. T1.dept_id = #{stationId}
  99. </if>
  100. <if test="oilName !=null and oilName !=''">
  101. AND T2.oil_name = #{oilName}
  102. </if>
  103. </where>
  104. </select>
  105. <!--根据小程序ID获取油站列表信息 -->
  106. <select id="getStationListByAppId" parameterType="com.platform.yijia.pojo.StationInfo" resultMap="BaseResultMap">
  107. SELECT
  108. T1.dept_id,
  109. T1.parent_id,
  110. T1.dept_name,
  111. T1.city,
  112. T1.dept_address,
  113. T1.station_longitude,
  114. T1.station_latitude,
  115. T1.station_pic
  116. FROM sys_dept AS T1
  117. <where>
  118. <if test="appId !='' and appId != null" >
  119. T1.app_id = #{appId}
  120. </if>
  121. </where>
  122. ORDER BY T1.dept_id
  123. </select>
  124. <!--获取油站信息-->
  125. <select id="selectStationInfo" parameterType="com.platform.yijia.pojo.StationInfo" resultMap="BaseResultMap">
  126. SELECT
  127. T1.dept_id,
  128. T1.parent_id,
  129. T1.ji_bie,
  130. T1.dept_name,
  131. T1.dept_address,
  132. T1.city,
  133. T1.oil_gun_num,
  134. T1.leader,
  135. T1.station_longitude,
  136. T1.station_latitude,
  137. T1.station_pic,
  138. T1.mno,
  139. T1.notice,
  140. T1.image1,
  141. T1.image2,
  142. T1.image3,
  143. T1.image4,
  144. T1.image5,
  145. T1.ws_print_flag,
  146. T1.print_setting,
  147. T1.discount_setting,
  148. T1.integral_print_flag,
  149. T1.print_device_type,
  150. T1.card_enabled_flag,
  151. T1.integral_flag,
  152. T1.label_flag,
  153. T1.is_lng_flag,
  154. T1.balance,
  155. T1.coupon_flag,
  156. T1.coupon_enabled_flag,
  157. T2.card_enabled_flag AS card_enabled_flag_group,
  158. T2.card_rule_flag AS card_rule_flag_group,
  159. T2.integral_flag AS integral_flag_group,
  160. T2.integral_rule_flag AS integral_rule_flag_group,
  161. T2.is_lng_flag AS is_lng_flag_group,
  162. T2.coupon_flag AS coupon_flag_group,
  163. T2.coupon_enabled_flag AS coupon_enabled_flag_group
  164. FROM sys_dept AS T1
  165. LEFT JOIN sys_dept AS T2 ON T1.parent_id = T2.dept_id
  166. <where>
  167. <if test="stationId !='' and stationId != null" >
  168. T1.dept_id = #{stationId}
  169. </if>
  170. </where>
  171. </select>
  172. <sql id="Example_Where_Clause">
  173. <!--
  174. WARNING - @mbg.generated
  175. This element is automatically generated by MyBatis Generator, do not modify.
  176. -->
  177. <where>
  178. <foreach collection="oredCriteria" item="criteria" separator="or">
  179. <if test="criteria.valid">
  180. <trim prefix="(" prefixOverrides="and" suffix=")">
  181. <foreach collection="criteria.criteria" item="criterion">
  182. <choose>
  183. <when test="criterion.noValue">
  184. and ${criterion.condition}
  185. </when>
  186. <when test="criterion.singleValue">
  187. and ${criterion.condition} #{criterion.value}
  188. </when>
  189. <when test="criterion.betweenValue">
  190. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  191. </when>
  192. <when test="criterion.listValue">
  193. and ${criterion.condition}
  194. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  195. #{listItem}
  196. </foreach>
  197. </when>
  198. </choose>
  199. </foreach>
  200. </trim>
  201. </if>
  202. </foreach>
  203. </where>
  204. </sql>
  205. <sql id="Update_By_Example_Where_Clause">
  206. <!--
  207. WARNING - @mbg.generated
  208. This element is automatically generated by MyBatis Generator, do not modify.
  209. -->
  210. <where>
  211. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  212. <if test="criteria.valid">
  213. <trim prefix="(" prefixOverrides="and" suffix=")">
  214. <foreach collection="criteria.criteria" item="criterion">
  215. <choose>
  216. <when test="criterion.noValue">
  217. and ${criterion.condition}
  218. </when>
  219. <when test="criterion.singleValue">
  220. and ${criterion.condition} #{criterion.value}
  221. </when>
  222. <when test="criterion.betweenValue">
  223. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  224. </when>
  225. <when test="criterion.listValue">
  226. and ${criterion.condition}
  227. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  228. #{listItem}
  229. </foreach>
  230. </when>
  231. </choose>
  232. </foreach>
  233. </trim>
  234. </if>
  235. </foreach>
  236. </where>
  237. </sql>
  238. <sql id="Base_Column_List">
  239. <!--
  240. WARNING - @mbg.generated
  241. This element is automatically generated by MyBatis Generator, do not modify.
  242. -->
  243. dept_id, parent_id, dept_name, dept_address, city, oil_gun_num, leader, phone,
  244. station_longitude, station_latitude, mno
  245. </sql>
  246. <sql id="Blob_Column_List">
  247. <!--
  248. WARNING - @mbg.generated
  249. This element is automatically generated by MyBatis Generator, do not modify.
  250. -->
  251. station_pic
  252. </sql>
  253. <select id="selectByExampleWithBLOBs" parameterType="com.platform.yijia.pojo.StationInfoExample" resultMap="ResultMapWithBLOBs">
  254. <!--
  255. WARNING - @mbg.generated
  256. This element is automatically generated by MyBatis Generator, do not modify.
  257. -->
  258. select
  259. <if test="distinct">
  260. distinct
  261. </if>
  262. <include refid="Base_Column_List" />
  263. ,
  264. <include refid="Blob_Column_List" />
  265. from sys_dept
  266. <if test="_parameter != null">
  267. <include refid="Example_Where_Clause" />
  268. </if>
  269. <if test="orderByClause != null">
  270. order by ${orderByClause}
  271. </if>
  272. </select>
  273. <select id="selectByExample" parameterType="com.platform.yijia.pojo.StationInfoExample" resultMap="BaseResultMap">
  274. <!--
  275. WARNING - @mbg.generated
  276. This element is automatically generated by MyBatis Generator, do not modify.
  277. -->
  278. select
  279. <if test="distinct">
  280. distinct
  281. </if>
  282. <include refid="Base_Column_List" />
  283. ,
  284. <include refid="Blob_Column_List" />
  285. from sys_dept
  286. <if test="_parameter != null">
  287. <include refid="Example_Where_Clause" />
  288. </if>
  289. <if test="orderByClause != null">
  290. order by ${orderByClause}
  291. </if>
  292. </select>
  293. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
  294. <!--
  295. WARNING - @mbg.generated
  296. This element is automatically generated by MyBatis Generator, do not modify.
  297. -->
  298. select
  299. <include refid="Base_Column_List" />
  300. ,
  301. <include refid="Blob_Column_List" />
  302. from sys_dept
  303. where dept_id = #{stationId,jdbcType=INTEGER}
  304. </select>
  305. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  306. <!--
  307. WARNING - @mbg.generated
  308. This element is automatically generated by MyBatis Generator, do not modify.
  309. -->
  310. delete from sys_dept
  311. where dept_id = #{stationId,jdbcType=INTEGER}
  312. </delete>
  313. <delete id="deleteByExample" parameterType="com.platform.yijia.pojo.StationInfoExample">
  314. <!--
  315. WARNING - @mbg.generated
  316. This element is automatically generated by MyBatis Generator, do not modify.
  317. -->
  318. delete from sys_dept
  319. <if test="_parameter != null">
  320. <include refid="Example_Where_Clause" />
  321. </if>
  322. </delete>
  323. <insert id="insert" parameterType="com.platform.yijia.pojo.StationInfo">
  324. <!--
  325. WARNING - @mbg.generated
  326. This element is automatically generated by MyBatis Generator, do not modify.
  327. -->
  328. insert into sys_dept (dept_id, dept_name, dept_address,
  329. oil_gun_num, leader, phone, station_longitude,
  330. station_latitude, mno, station_pic
  331. )
  332. values (#{stationId,jdbcType=INTEGER}, #{stationName,jdbcType=VARCHAR}, #{stationAddress,jdbcType=VARCHAR},
  333. #{oilGunNum,jdbcType=INTEGER}, #{contacts,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
  334. #{stationLongitude,jdbcType=VARCHAR},
  335. #{stationLatitude,jdbcType=VARCHAR}, #{mno,jdbcType=INTEGER}, #{stationPic,jdbcType=LONGVARBINARY}
  336. )
  337. </insert>
  338. <insert id="insertSelective" parameterType="com.platform.yijia.pojo.StationInfo">
  339. <!--
  340. WARNING - @mbg.generated
  341. This element is automatically generated by MyBatis Generator, do not modify.
  342. -->
  343. insert into sys_dept
  344. <trim prefix="(" suffix=")" suffixOverrides=",">
  345. <if test="stationId != null">
  346. dept_id,
  347. </if>
  348. <if test="stationName != null">
  349. dept_name,
  350. </if>
  351. <if test="stationAddress != null">
  352. dept_address,
  353. </if>
  354. <if test="oilGunNum != null">
  355. oil_gun_num,
  356. </if>
  357. <if test="leader != null">
  358. leader,
  359. </if>
  360. <if test="phone != null">
  361. phone,
  362. </if>
  363. <if test="stationLongitude != null">
  364. station_longitude,
  365. </if>
  366. <if test="stationLatitude != null">
  367. station_latitude,
  368. </if>
  369. <if test="mno != null">
  370. mno,
  371. </if>
  372. <if test="stationPic != null">
  373. station_pic,
  374. </if>
  375. </trim>
  376. <trim prefix="values (" suffix=")" suffixOverrides=",">
  377. <if test="stationId != null">
  378. #{stationId,jdbcType=INTEGER},
  379. </if>
  380. <if test="stationName != null">
  381. #{stationName,jdbcType=VARCHAR},
  382. </if>
  383. <if test="stationAddress != null">
  384. #{stationAddress,jdbcType=VARCHAR},
  385. </if>
  386. <if test="oilGunNum != null">
  387. #{oilGunNum,jdbcType=INTEGER},
  388. </if>
  389. <if test="contacts != null">
  390. #{contacts,jdbcType=VARCHAR},
  391. </if>
  392. <if test="phone != null">
  393. #{phone,jdbcType=VARCHAR},
  394. </if>
  395. <if test="stationLongitude != null">
  396. #{stationLongitude,jdbcType=VARCHAR},
  397. </if>
  398. <if test="stationLatitude != null">
  399. #{stationLatitude,jdbcType=VARCHAR},
  400. </if>
  401. <if test="mno != null">
  402. #{mno,jdbcType=INTEGER},
  403. </if>
  404. <if test="stationPic != null">
  405. #{stationPic,jdbcType=LONGVARBINARY},
  406. </if>
  407. </trim>
  408. </insert>
  409. <select id="countByExample" parameterType="com.platform.yijia.pojo.StationInfoExample" resultType="java.lang.Long">
  410. <!--
  411. WARNING - @mbg.generated
  412. This element is automatically generated by MyBatis Generator, do not modify.
  413. -->
  414. select count(*) from sys_dept
  415. <if test="_parameter != null">
  416. <include refid="Example_Where_Clause" />
  417. </if>
  418. </select>
  419. <update id="updateByExampleSelective" parameterType="map">
  420. <!--
  421. WARNING - @mbg.generated
  422. This element is automatically generated by MyBatis Generator, do not modify.
  423. -->
  424. update sys_dept
  425. <set>
  426. <if test="record.stationId != null">
  427. dept_id = #{record.stationId,jdbcType=INTEGER},
  428. </if>
  429. <if test="record.stationName != null">
  430. dept_name = #{record.stationName,jdbcType=VARCHAR},
  431. </if>
  432. <if test="record.stationAddress != null">
  433. dept_address = #{record.stationAddress,jdbcType=VARCHAR},
  434. </if>
  435. <if test="record.oilGunNum != null">
  436. oil_gun_num = #{record.oilGunNum,jdbcType=INTEGER},
  437. </if>
  438. <if test="record.contacts != null">
  439. leader = #{record.contacts,jdbcType=VARCHAR},
  440. </if>
  441. <if test="record.phone != null">
  442. phone = #{record.phone,jdbcType=VARCHAR},
  443. </if>
  444. <if test="record.stationLongitude != null">
  445. station_longitude = #{record.stationLongitude,jdbcType=VARCHAR},
  446. </if>
  447. <if test="record.stationLatitude != null">
  448. station_latitude = #{record.stationLatitude,jdbcType=VARCHAR},
  449. </if>
  450. <if test="record.mno != null">
  451. mno = #{record.mno,jdbcType=INTEGER},
  452. </if>
  453. <if test="record.stationPic != null">
  454. station_pic = #{record.stationPic,jdbcType=LONGVARBINARY},
  455. </if>
  456. </set>
  457. <if test="_parameter != null">
  458. <include refid="Update_By_Example_Where_Clause" />
  459. </if>
  460. </update>
  461. <update id="updateByExampleWithBLOBs" parameterType="map">
  462. <!--
  463. WARNING - @mbg.generated
  464. This element is automatically generated by MyBatis Generator, do not modify.
  465. -->
  466. update sys_dept
  467. set dept_id = #{record.stationId,jdbcType=INTEGER},
  468. dept_name = #{record.stationName,jdbcType=VARCHAR},
  469. dept_address = #{record.stationAddress,jdbcType=VARCHAR},
  470. oil_gun_num = #{record.oilGunNum,jdbcType=INTEGER},
  471. leader = #{record.contacts,jdbcType=VARCHAR},
  472. phone = #{record.phone,jdbcType=VARCHAR},
  473. station_longitude = #{record.stationLongitude,jdbcType=VARCHAR},
  474. station_latitude = #{record.stationLatitude,jdbcType=VARCHAR},
  475. mno = #{record.mno,jdbcType=INTEGER},
  476. station_pic = #{record.stationPic,jdbcType=LONGVARBINARY}
  477. <if test="_parameter != null">
  478. <include refid="Update_By_Example_Where_Clause" />
  479. </if>
  480. </update>
  481. <update id="updateByExample" parameterType="map">
  482. <!--
  483. WARNING - @mbg.generated
  484. This element is automatically generated by MyBatis Generator, do not modify.
  485. -->
  486. update sys_dept
  487. set dept_id = #{record.stationId,jdbcType=INTEGER},
  488. dept_name = #{record.stationName,jdbcType=VARCHAR},
  489. dept_address = #{record.stationAddress,jdbcType=VARCHAR},
  490. oil_gun_num = #{record.oilGunNum,jdbcType=INTEGER},
  491. leader = #{record.contacts,jdbcType=VARCHAR},
  492. phone = #{record.phone,jdbcType=VARCHAR},
  493. station_longitude = #{record.stationLongitude,jdbcType=VARCHAR},
  494. station_latitude = #{record.stationLatitude,jdbcType=VARCHAR},
  495. mno = #{record.mno,jdbcType=INTEGER}
  496. <if test="_parameter != null">
  497. <include refid="Update_By_Example_Where_Clause" />
  498. </if>
  499. </update>
  500. <update id="updateByPrimaryKeySelective" parameterType="com.platform.yijia.pojo.StationInfo">
  501. <!--
  502. WARNING - @mbg.generated
  503. This element is automatically generated by MyBatis Generator, do not modify.
  504. -->
  505. update sys_dept
  506. <set>
  507. <if test="stationName != null">
  508. dept_name = #{stationName,jdbcType=VARCHAR},
  509. </if>
  510. <if test="stationAddress != null">
  511. dept_address = #{stationAddress,jdbcType=VARCHAR},
  512. </if>
  513. <if test="oilGunNum != null">
  514. oil_gun_num = #{oilGunNum,jdbcType=INTEGER},
  515. </if>
  516. <if test="contacts != null">
  517. leader = #{contacts,jdbcType=VARCHAR},
  518. </if>
  519. <if test="phone != null">
  520. phone = #{phone,jdbcType=VARCHAR},
  521. </if>
  522. <if test="stationLongitude != null">
  523. station_longitude = #{stationLongitude,jdbcType=VARCHAR},
  524. </if>
  525. <if test="stationLatitude != null">
  526. station_latitude = #{stationLatitude,jdbcType=VARCHAR},
  527. </if>
  528. <if test="mno != null">
  529. mno = #{mno,jdbcType=INTEGER},
  530. </if>
  531. <if test="stationPic != null">
  532. station_pic = #{stationPic,jdbcType=LONGVARBINARY},
  533. </if>
  534. </set>
  535. where dept_id = #{stationId,jdbcType=INTEGER}
  536. </update>
  537. <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.platform.yijia.pojo.StationInfo">
  538. <!--
  539. WARNING - @mbg.generated
  540. This element is automatically generated by MyBatis Generator, do not modify.
  541. -->
  542. update sys_dept
  543. set dept_name = #{stationName,jdbcType=VARCHAR},
  544. dept_address = #{stationAddress,jdbcType=VARCHAR},
  545. oil_gun_num = #{oilGunNum,jdbcType=INTEGER},
  546. leader = #{contacts,jdbcType=VARCHAR},
  547. phone = #{phone,jdbcType=VARCHAR},
  548. station_longitude = #{stationLongitude,jdbcType=VARCHAR},
  549. station_latitude = #{stationLatitude,jdbcType=VARCHAR},
  550. mno = #{mno,jdbcType=INTEGER},
  551. station_pic = #{stationPic,jdbcType=LONGVARBINARY}
  552. where dept_id = #{stationId,jdbcType=INTEGER}
  553. </update>
  554. <update id="updateByPrimaryKey" parameterType="com.platform.yijia.pojo.StationInfo">
  555. <!--
  556. WARNING - @mbg.generated
  557. This element is automatically generated by MyBatis Generator, do not modify.
  558. -->
  559. update sys_dept
  560. set dept_name = #{stationName,jdbcType=VARCHAR},
  561. dept_address = #{stationAddress,jdbcType=VARCHAR},
  562. oil_gun_num = #{oilGunNum,jdbcType=INTEGER},
  563. leader = #{contacts,jdbcType=VARCHAR},
  564. phone = #{phone,jdbcType=VARCHAR},
  565. station_longitude = #{stationLongitude,jdbcType=VARCHAR},
  566. station_latitude = #{stationLatitude,jdbcType=VARCHAR},
  567. mno = #{mno,jdbcType=INTEGER}
  568. where dept_id = #{stationId,jdbcType=INTEGER}
  569. </update>
  570. <!--查询油站的公告-->
  571. <select id="getStationNoticeInfo" parameterType="Integer" resultType="map">
  572. SELECT
  573. notice AS notice
  574. FROM
  575. station_pay
  576. <where>
  577. <if test="stationId !='' and stationId != null" >
  578. station_id = #{stationId}
  579. </if>
  580. </where>
  581. </select>
  582. <!--查询油站的优惠方式-->
  583. <select id="getStationDiscountWay" parameterType="String" resultType="String">
  584. SELECT
  585. discount_setting AS discountSetting
  586. FROM
  587. sys_dept
  588. <where>
  589. <if test="stationId !='' and stationId != null" >
  590. station_id = #{stationId}
  591. </if>
  592. </where>
  593. </select>
  594. <!--查询油站小程序AppId和AppSecret-->
  595. <select id="getStationAppIdAndAppSecret" parameterType="Integer" resultType="Map">
  596. SELECT
  597. mno AS mno,
  598. dept_name AS stationName,
  599. app_id AS appId,
  600. app_secret AS appSecret,
  601. gzh_app_id AS gzhAppId,
  602. gzh_app_secret AS gzhAppSecret,
  603. ali_app_id AS aliAppId,
  604. ali_public_key AS aliPublicKey,
  605. ali_private_key AS aliPrivateKey,
  606. ali_encrypt_key AS aliEncryptKey,
  607. merchant_no AS merchantNo,
  608. terminal_id AS terminalId,
  609. yun_key AS yunKey,
  610. mno_array AS mnoArray,
  611. mno_proportion AS mnoProportion,
  612. mno_status AS mnoStatus
  613. FROM
  614. sys_dept
  615. <where>
  616. <if test="stationId != null" >
  617. dept_id = #{stationId}
  618. </if>
  619. </where>
  620. </select>
  621. <!--根据油站Id油枪号获取打印机编号 -->
  622. <select id="getStationPrinterList" parameterType="Integer" resultType="Map">
  623. SELECT
  624. A.station_id AS stationId,
  625. A.device_no AS printerSn,
  626. B.integral_print_flag AS integralPrintFlag
  627. FROM station_device_manage AS A
  628. LEFT JOIN sys_dept AS B ON A.station_id = B.dept_id
  629. <where>
  630. <if test="stationId != null and stationId !=''">
  631. A.station_id = #{stationId}
  632. </if>
  633. </where>
  634. </select>
  635. <!--获取油站的打印设备信息-->
  636. <select id="getStationDeviceManagerList" parameterType="com.platform.yijia.pojo.StationDeviceManager" resultType="com.platform.yijia.pojo.StationDeviceManager">
  637. SELECT
  638. device_id AS deviceId,
  639. device_no AS deviceNo,
  640. device_name AS deviceName,
  641. station_id AS stationId,
  642. device_type AS deviceType,
  643. device_serial_num AS deviceSerialNum,
  644. gun_no AS gunNo,
  645. device_factory AS deviceFactory,
  646. pos_fanout_exchange AS posFanoutExchange,
  647. pos_queue AS posQueue
  648. FROM station_device_manage
  649. <where>
  650. <if test="stationId != null and stationId !=''">
  651. station_id = #{stationId}
  652. </if>
  653. <if test="deviceNo != null and deviceNo !=''">
  654. AND device_no = #{deviceNo}
  655. </if>
  656. <if test="deviceType != null and deviceType !=''">
  657. AND device_type = #{deviceType}
  658. </if>
  659. <if test="gunNo != null and gunNo !=''">
  660. AND FIND_IN_SET(#{gunNo}, gun_no)
  661. </if>
  662. </where>
  663. ORDER BY device_id
  664. </select>
  665. <!--获取油站的打印设备信息-->
  666. <select id="getStationDeviceManager" parameterType="com.platform.yijia.pojo.StationDeviceManager" resultType="com.platform.yijia.pojo.StationDeviceManager">
  667. SELECT
  668. device_id AS deviceId,
  669. device_no AS deviceNo,
  670. device_name AS deviceName,
  671. station_id AS stationId,
  672. device_type AS deviceType,
  673. device_serial_num AS deviceSerialNum,
  674. gun_no AS gunNo,
  675. device_factory AS deviceFactory,
  676. pos_fanout_exchange AS posFanoutExchange,
  677. pos_queue AS posQueue
  678. FROM station_device_manage
  679. <where>
  680. <if test="stationId != null and stationId !=''">
  681. station_id = #{stationId}
  682. </if>
  683. <if test="deviceNo != null and deviceNo !=''">
  684. AND device_no = #{deviceNo}
  685. </if>
  686. <if test="deviceType != null and deviceType !=''">
  687. AND device_type = #{deviceType}
  688. </if>
  689. <if test="gunNo != null and gunNo !=''">
  690. AND FIND_IN_SET(#{gunNo}, gun_no)
  691. </if>
  692. </where>
  693. </select>
  694. <!-- 次要业务:LNG平台加气更新油站余额-->
  695. <update id="updateStationBalance" parameterType="com.platform.yijia.pojo.StationInfo">
  696. UPDATE sys_dept
  697. <set>
  698. <if test="balance !=null ">
  699. balance = #{balance}
  700. </if>
  701. </set>
  702. <where>
  703. <if test="stationId != null and stationId !='' ">
  704. dept_id = #{stationId}
  705. </if>
  706. </where>
  707. </update>
  708. </mapper>