123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.platform.yijia.dao.StationInfoMapper">
- <resultMap id="BaseResultMap" type="com.platform.yijia.pojo.StationInfo">
- <id column="dept_id" jdbcType="INTEGER" property="stationId" />
- <id column="parent_id" jdbcType="INTEGER" property="groupId" />
- <result column="dept_name" jdbcType="VARCHAR" property="stationName" />
- <result column="city" jdbcType="VARCHAR" property="city" />
- <result column="dept_address" jdbcType="VARCHAR" property="stationAddress" />
- <result column="oil_gun_num" jdbcType="INTEGER" property="oilGunNum" />
- <result column="leader" jdbcType="VARCHAR" property="contacts" />
- <result column="ji_bie" jdbcType="VARCHAR" property="jiBie"/>
- <result column="phone" jdbcType="VARCHAR" property="phone" />
- <result column="station_longitude" jdbcType="VARCHAR" property="stationLongitude" />
- <result column="station_latitude" jdbcType="VARCHAR" property="stationLatitude" />
- <result column="station_pic" jdbcType="VARCHAR" property="stationPic" />
- <result column="image1" jdbcType="VARCHAR" property="image1" />
- <result column="image2" jdbcType="VARCHAR" property="image2" />
- <result column="image3" jdbcType="VARCHAR" property="image3" />
- <result column="image4" jdbcType="VARCHAR" property="image4" />
- <result column="image5" jdbcType="VARCHAR" property="image5" />
- <result column="notice" jdbcType="VARCHAR" property="notice" />
- <result column="mno" jdbcType="INTEGER" property="mno" />
- <result column="print_setting" jdbcType="VARCHAR" property="printSetting" />
- <result column="ws_print_flag" jdbcType="VARCHAR" property="wsPrintFlag" />
- <result column="discount_setting" jdbcType="VARCHAR" property="discountSetting" />
- <result column="card_enabled_flag" jdbcType="VARCHAR" property="cardEnabledFlag" />
- <result column="integral_flag" jdbcType="VARCHAR" property="integralFlag" />
- <result column="label_flag" jdbcType="VARCHAR" property="labelFlag" />
- <result column="integral_print_flag" jdbcType="VARCHAR" property="integralPrintFlag" />
- <result column="integral_rule_flag" jdbcType="VARCHAR" property="integralRuleFlag" />
- <result column="coupon_flag" jdbcType="VARCHAR" property="couponFlag" />
- <result column="coupon_enabled_flag" jdbcType="VARCHAR" property="couponEnabledFlag" />
- <result column="card_rule_flag_group" jdbcType="VARCHAR" property="cardRuleFlagGroup" />
- <result column="card_enabled_flag_group" jdbcType="VARCHAR" property="cardEnabledFlagGroup" />
- <result column="integral_flag_group" jdbcType="VARCHAR" property="integralFlagGroup" />
- <result column="integral_rule_flag_group" jdbcType="VARCHAR" property="integralRuleFlagGroup" />
- <result column="is_lng_flag" jdbcType="VARCHAR" property="isLngFlag" />
- <result column="is_lng_flag_group" jdbcType="VARCHAR" property="isLngFlagGroup" />
- <result column="coupon_flag_group" jdbcType="VARCHAR" property="couponFlagGroup" />
- <result column="coupon_enabled_flag_group" jdbcType="VARCHAR" property="couponEnabledFlagGroup" />
- <result column="single_station_flag" jdbcType="VARCHAR" property="singleStationFlag" />
- <result column="card_rule_flag" jdbcType="VARCHAR" property="cardRuleFlag" />
- <result column="print_device_type" jdbcType="VARCHAR" property="printDeviceType" />
- <result column="app_id" jdbcType="VARCHAR" property="appId" />
- <result column="gzh_app_id" jdbcType="VARCHAR" property="gzhAppId" />
- </resultMap>
- <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.platform.yijia.pojo.StationInfo">
- <result column="station_pic" jdbcType="LONGVARBINARY" property="stationPic" />
- </resultMap>
- <!--油站轮播图片信息返回结果-->
- <!-- <resultMap id="StationPicResultMap" type="com.platform.yijia.pojo.StationPic">-->
- <!-- <id column="id" jdbcType="INTEGER" property="id" />-->
- <!-- <result column="name" jdbcType="VARCHAR" property="name" />-->
- <!-- <result column="url" jdbcType="VARCHAR" property="url" />-->
- <!-- <result column="station_id" jdbcType="INTEGER" property="stationId" />-->
- <!-- <result column="station_name" jdbcType="VARCHAR" property="stationName" />-->
- <!-- <result column="parent_id" jdbcType="VARCHAR" property="parentId" />-->
- <!-- </resultMap>-->
- <!--查询油站轮播图片信息-->
- <select id="getStationPicList" resultMap="BaseResultMap" parameterType="com.platform.yijia.pojo.StationInfo">
- SELECT
- dept_id,
- dept_name,
- notice,
- image1,
- image2,
- image3,
- image4,
- image5
- FROM
- sys_dept
- <where>
- <if test="stationId !=null and stationId !=''">
- AND dept_id = #{stationId}
- </if>
- </where>
- </select>
- <!--获取油站的某个油品的价格和营销方案信息-->
- <select id="selectStationOilPriceAndDiscountSetting" parameterType="Map" resultType="Map">
- SELECT
- T1.dept_id AS stationId,
- T1.parent_id AS groupId,
- T1.discount_setting AS discountSetting,
- T1.card_enabled_flag AS cardEnabledFlag,
- T3.card_rule_flag AS cardRuleFlag,
- T2.oil_price AS oilPrice,
- T4.settlement_type AS settlementType,
- T4.settlement_price AS settlementPrice,
- T4.driver_price_type AS driverPriceType,
- T4.driver_price AS driverPrice
- FROM sys_dept AS T1
- LEFT JOIN station_oil_price AS T2 ON T1.dept_id = T2.station_id
- LEFT JOIN sys_dept AS T3 ON T1.parent_id = T3.dept_id
- LEFT JOIN station_settlement_price AS T4 ON T2.station_id = T4.station_id
- <where>
- <if test="stationId !='' and stationId != null" >
- T1.dept_id = #{stationId}
- </if>
- <if test="oilName !=null and oilName !=''">
- AND T2.oil_name = #{oilName}
- </if>
- </where>
- </select>
- <!--根据小程序ID获取油站列表信息 -->
- <select id="getStationListByAppId" parameterType="com.platform.yijia.pojo.StationInfo" resultMap="BaseResultMap">
- SELECT
- T1.dept_id,
- T1.parent_id,
- T1.dept_name,
- T1.city,
- T1.dept_address,
- T1.station_longitude,
- T1.station_latitude,
- T1.station_pic
- FROM sys_dept AS T1
- <where>
- <if test="appId !='' and appId != null" >
- T1.app_id = #{appId}
- </if>
- </where>
- ORDER BY T1.dept_id
- </select>
- <!--获取油站信息-->
- <select id="selectStationInfo" parameterType="com.platform.yijia.pojo.StationInfo" resultMap="BaseResultMap">
- SELECT
- T1.dept_id,
- T1.parent_id,
- T1.ji_bie,
- T1.dept_name,
- T1.dept_address,
- T1.city,
- T1.oil_gun_num,
- T1.leader,
- T1.station_longitude,
- T1.station_latitude,
- T1.station_pic,
- T1.mno,
- T1.notice,
- T1.image1,
- T1.image2,
- T1.image3,
- T1.image4,
- T1.image5,
- T1.ws_print_flag,
- T1.print_setting,
- T1.discount_setting,
- T1.integral_print_flag,
- T1.print_device_type,
- T1.card_enabled_flag,
- T1.integral_flag,
- T1.label_flag,
- T1.is_lng_flag,
- T1.balance,
- T1.coupon_flag,
- T1.coupon_enabled_flag,
- T2.card_enabled_flag AS card_enabled_flag_group,
- T2.card_rule_flag AS card_rule_flag_group,
- T2.integral_flag AS integral_flag_group,
- T2.integral_rule_flag AS integral_rule_flag_group,
- T2.is_lng_flag AS is_lng_flag_group,
- T2.coupon_flag AS coupon_flag_group,
- T2.coupon_enabled_flag AS coupon_enabled_flag_group
- FROM sys_dept AS T1
- LEFT JOIN sys_dept AS T2 ON T1.parent_id = T2.dept_id
- <where>
- <if test="stationId !='' and stationId != null" >
- T1.dept_id = #{stationId}
- </if>
- </where>
- </select>
- <sql id="Example_Where_Clause">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- <where>
- <foreach collection="oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- <where>
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- dept_id, parent_id, dept_name, dept_address, city, oil_gun_num, leader, phone,
- station_longitude, station_latitude, mno
- </sql>
- <sql id="Blob_Column_List">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- station_pic
- </sql>
- <select id="selectByExampleWithBLOBs" parameterType="com.platform.yijia.pojo.StationInfoExample" resultMap="ResultMapWithBLOBs">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- ,
- <include refid="Blob_Column_List" />
- from sys_dept
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByExample" parameterType="com.platform.yijia.pojo.StationInfoExample" resultMap="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- ,
- <include refid="Blob_Column_List" />
- from sys_dept
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- select
- <include refid="Base_Column_List" />
- ,
- <include refid="Blob_Column_List" />
- from sys_dept
- where dept_id = #{stationId,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- delete from sys_dept
- where dept_id = #{stationId,jdbcType=INTEGER}
- </delete>
- <delete id="deleteByExample" parameterType="com.platform.yijia.pojo.StationInfoExample">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- delete from sys_dept
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.platform.yijia.pojo.StationInfo">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- insert into sys_dept (dept_id, dept_name, dept_address,
- oil_gun_num, leader, phone, station_longitude,
- station_latitude, mno, station_pic
- )
- values (#{stationId,jdbcType=INTEGER}, #{stationName,jdbcType=VARCHAR}, #{stationAddress,jdbcType=VARCHAR},
- #{oilGunNum,jdbcType=INTEGER}, #{contacts,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR},
- #{stationLongitude,jdbcType=VARCHAR},
- #{stationLatitude,jdbcType=VARCHAR}, #{mno,jdbcType=INTEGER}, #{stationPic,jdbcType=LONGVARBINARY}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.platform.yijia.pojo.StationInfo">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- insert into sys_dept
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="stationId != null">
- dept_id,
- </if>
- <if test="stationName != null">
- dept_name,
- </if>
- <if test="stationAddress != null">
- dept_address,
- </if>
- <if test="oilGunNum != null">
- oil_gun_num,
- </if>
- <if test="leader != null">
- leader,
- </if>
- <if test="phone != null">
- phone,
- </if>
- <if test="stationLongitude != null">
- station_longitude,
- </if>
- <if test="stationLatitude != null">
- station_latitude,
- </if>
- <if test="mno != null">
- mno,
- </if>
- <if test="stationPic != null">
- station_pic,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="stationId != null">
- #{stationId,jdbcType=INTEGER},
- </if>
- <if test="stationName != null">
- #{stationName,jdbcType=VARCHAR},
- </if>
- <if test="stationAddress != null">
- #{stationAddress,jdbcType=VARCHAR},
- </if>
- <if test="oilGunNum != null">
- #{oilGunNum,jdbcType=INTEGER},
- </if>
- <if test="contacts != null">
- #{contacts,jdbcType=VARCHAR},
- </if>
- <if test="phone != null">
- #{phone,jdbcType=VARCHAR},
- </if>
- <if test="stationLongitude != null">
- #{stationLongitude,jdbcType=VARCHAR},
- </if>
- <if test="stationLatitude != null">
- #{stationLatitude,jdbcType=VARCHAR},
- </if>
- <if test="mno != null">
- #{mno,jdbcType=INTEGER},
- </if>
- <if test="stationPic != null">
- #{stationPic,jdbcType=LONGVARBINARY},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.platform.yijia.pojo.StationInfoExample" resultType="java.lang.Long">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- select count(*) from sys_dept
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- update sys_dept
- <set>
- <if test="record.stationId != null">
- dept_id = #{record.stationId,jdbcType=INTEGER},
- </if>
- <if test="record.stationName != null">
- dept_name = #{record.stationName,jdbcType=VARCHAR},
- </if>
- <if test="record.stationAddress != null">
- dept_address = #{record.stationAddress,jdbcType=VARCHAR},
- </if>
- <if test="record.oilGunNum != null">
- oil_gun_num = #{record.oilGunNum,jdbcType=INTEGER},
- </if>
- <if test="record.contacts != null">
- leader = #{record.contacts,jdbcType=VARCHAR},
- </if>
- <if test="record.phone != null">
- phone = #{record.phone,jdbcType=VARCHAR},
- </if>
- <if test="record.stationLongitude != null">
- station_longitude = #{record.stationLongitude,jdbcType=VARCHAR},
- </if>
- <if test="record.stationLatitude != null">
- station_latitude = #{record.stationLatitude,jdbcType=VARCHAR},
- </if>
- <if test="record.mno != null">
- mno = #{record.mno,jdbcType=INTEGER},
- </if>
- <if test="record.stationPic != null">
- station_pic = #{record.stationPic,jdbcType=LONGVARBINARY},
- </if>
- </set>
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExampleWithBLOBs" parameterType="map">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- update sys_dept
- set dept_id = #{record.stationId,jdbcType=INTEGER},
- dept_name = #{record.stationName,jdbcType=VARCHAR},
- dept_address = #{record.stationAddress,jdbcType=VARCHAR},
- oil_gun_num = #{record.oilGunNum,jdbcType=INTEGER},
- leader = #{record.contacts,jdbcType=VARCHAR},
- phone = #{record.phone,jdbcType=VARCHAR},
- station_longitude = #{record.stationLongitude,jdbcType=VARCHAR},
- station_latitude = #{record.stationLatitude,jdbcType=VARCHAR},
- mno = #{record.mno,jdbcType=INTEGER},
- station_pic = #{record.stationPic,jdbcType=LONGVARBINARY}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExample" parameterType="map">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- update sys_dept
- set dept_id = #{record.stationId,jdbcType=INTEGER},
- dept_name = #{record.stationName,jdbcType=VARCHAR},
- dept_address = #{record.stationAddress,jdbcType=VARCHAR},
- oil_gun_num = #{record.oilGunNum,jdbcType=INTEGER},
- leader = #{record.contacts,jdbcType=VARCHAR},
- phone = #{record.phone,jdbcType=VARCHAR},
- station_longitude = #{record.stationLongitude,jdbcType=VARCHAR},
- station_latitude = #{record.stationLatitude,jdbcType=VARCHAR},
- mno = #{record.mno,jdbcType=INTEGER}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.platform.yijia.pojo.StationInfo">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- update sys_dept
- <set>
- <if test="stationName != null">
- dept_name = #{stationName,jdbcType=VARCHAR},
- </if>
- <if test="stationAddress != null">
- dept_address = #{stationAddress,jdbcType=VARCHAR},
- </if>
- <if test="oilGunNum != null">
- oil_gun_num = #{oilGunNum,jdbcType=INTEGER},
- </if>
- <if test="contacts != null">
- leader = #{contacts,jdbcType=VARCHAR},
- </if>
- <if test="phone != null">
- phone = #{phone,jdbcType=VARCHAR},
- </if>
- <if test="stationLongitude != null">
- station_longitude = #{stationLongitude,jdbcType=VARCHAR},
- </if>
- <if test="stationLatitude != null">
- station_latitude = #{stationLatitude,jdbcType=VARCHAR},
- </if>
- <if test="mno != null">
- mno = #{mno,jdbcType=INTEGER},
- </if>
- <if test="stationPic != null">
- station_pic = #{stationPic,jdbcType=LONGVARBINARY},
- </if>
- </set>
- where dept_id = #{stationId,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.platform.yijia.pojo.StationInfo">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- update sys_dept
- set dept_name = #{stationName,jdbcType=VARCHAR},
- dept_address = #{stationAddress,jdbcType=VARCHAR},
- oil_gun_num = #{oilGunNum,jdbcType=INTEGER},
- leader = #{contacts,jdbcType=VARCHAR},
- phone = #{phone,jdbcType=VARCHAR},
- station_longitude = #{stationLongitude,jdbcType=VARCHAR},
- station_latitude = #{stationLatitude,jdbcType=VARCHAR},
- mno = #{mno,jdbcType=INTEGER},
- station_pic = #{stationPic,jdbcType=LONGVARBINARY}
- where dept_id = #{stationId,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.platform.yijia.pojo.StationInfo">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- update sys_dept
- set dept_name = #{stationName,jdbcType=VARCHAR},
- dept_address = #{stationAddress,jdbcType=VARCHAR},
- oil_gun_num = #{oilGunNum,jdbcType=INTEGER},
- leader = #{contacts,jdbcType=VARCHAR},
- phone = #{phone,jdbcType=VARCHAR},
- station_longitude = #{stationLongitude,jdbcType=VARCHAR},
- station_latitude = #{stationLatitude,jdbcType=VARCHAR},
- mno = #{mno,jdbcType=INTEGER}
- where dept_id = #{stationId,jdbcType=INTEGER}
- </update>
- <!--查询油站的公告-->
- <select id="getStationNoticeInfo" parameterType="Integer" resultType="map">
- SELECT
- notice AS notice
- FROM
- station_pay
- <where>
- <if test="stationId !='' and stationId != null" >
- station_id = #{stationId}
- </if>
- </where>
- </select>
- <!--查询油站的优惠方式-->
- <select id="getStationDiscountWay" parameterType="String" resultType="String">
- SELECT
- discount_setting AS discountSetting
- FROM
- sys_dept
- <where>
- <if test="stationId !='' and stationId != null" >
- station_id = #{stationId}
- </if>
- </where>
- </select>
- <!--查询油站小程序AppId和AppSecret-->
- <select id="getStationAppIdAndAppSecret" parameterType="Integer" resultType="Map">
- SELECT
- mno AS mno,
- dept_name AS stationName,
- app_id AS appId,
- app_secret AS appSecret,
- gzh_app_id AS gzhAppId,
- gzh_app_secret AS gzhAppSecret,
- ali_app_id AS aliAppId,
- ali_public_key AS aliPublicKey,
- ali_private_key AS aliPrivateKey,
- ali_encrypt_key AS aliEncryptKey,
- merchant_no AS merchantNo,
- terminal_id AS terminalId,
- yun_key AS yunKey,
- mno_array AS mnoArray,
- mno_proportion AS mnoProportion,
- mno_status AS mnoStatus
- FROM
- sys_dept
- <where>
- <if test="stationId != null" >
- dept_id = #{stationId}
- </if>
- </where>
- </select>
- <!--根据油站Id油枪号获取打印机编号 -->
- <select id="getStationPrinterList" parameterType="Integer" resultType="Map">
- SELECT
- A.station_id AS stationId,
- A.device_no AS printerSn,
- B.integral_print_flag AS integralPrintFlag
- FROM station_device_manage AS A
- LEFT JOIN sys_dept AS B ON A.station_id = B.dept_id
- <where>
- <if test="stationId != null and stationId !=''">
- A.station_id = #{stationId}
- </if>
- </where>
- </select>
- <!--获取油站的打印设备信息-->
- <select id="getStationDeviceManagerList" parameterType="com.platform.yijia.pojo.StationDeviceManager" resultType="com.platform.yijia.pojo.StationDeviceManager">
- SELECT
- device_id AS deviceId,
- device_no AS deviceNo,
- device_name AS deviceName,
- station_id AS stationId,
- device_type AS deviceType,
- device_serial_num AS deviceSerialNum,
- gun_no AS gunNo,
- device_factory AS deviceFactory,
- pos_fanout_exchange AS posFanoutExchange,
- pos_queue AS posQueue
- FROM station_device_manage
- <where>
- <if test="stationId != null and stationId !=''">
- station_id = #{stationId}
- </if>
- <if test="deviceNo != null and deviceNo !=''">
- AND device_no = #{deviceNo}
- </if>
- <if test="deviceType != null and deviceType !=''">
- AND device_type = #{deviceType}
- </if>
- <if test="gunNo != null and gunNo !=''">
- AND FIND_IN_SET(#{gunNo}, gun_no)
- </if>
- </where>
- ORDER BY device_id
- </select>
- <!--获取油站的打印设备信息-->
- <select id="getStationDeviceManager" parameterType="com.platform.yijia.pojo.StationDeviceManager" resultType="com.platform.yijia.pojo.StationDeviceManager">
- SELECT
- device_id AS deviceId,
- device_no AS deviceNo,
- device_name AS deviceName,
- station_id AS stationId,
- device_type AS deviceType,
- device_serial_num AS deviceSerialNum,
- gun_no AS gunNo,
- device_factory AS deviceFactory,
- pos_fanout_exchange AS posFanoutExchange,
- pos_queue AS posQueue
- FROM station_device_manage
- <where>
- <if test="stationId != null and stationId !=''">
- station_id = #{stationId}
- </if>
- <if test="deviceNo != null and deviceNo !=''">
- AND device_no = #{deviceNo}
- </if>
- <if test="deviceType != null and deviceType !=''">
- AND device_type = #{deviceType}
- </if>
- <if test="gunNo != null and gunNo !=''">
- AND FIND_IN_SET(#{gunNo}, gun_no)
- </if>
- </where>
- </select>
- <!-- 次要业务:LNG平台加气更新油站余额-->
- <update id="updateStationBalance" parameterType="com.platform.yijia.pojo.StationInfo">
- UPDATE sys_dept
- <set>
- <if test="balance !=null ">
- balance = #{balance}
- </if>
- </set>
- <where>
- <if test="stationId != null and stationId !='' ">
- dept_id = #{stationId}
- </if>
- </where>
- </update>
- </mapper>
|