StationInfoMapper.xml 22 KB

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