StationInfoMapper.xml 27 KB

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