StationInfoMapper.xml 21 KB

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