123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340 |
- <?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.StationOilGunMapper">
- <resultMap id="BaseResultMap" type="com.platform.yijia.pojo.StationOilGun">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- <id column="oil_gun_id" jdbcType="INTEGER" property="oilGunId" />
- <result column="oil_gun_no" jdbcType="VARCHAR" property="oilGunNo" />
- <result column="oil_name" jdbcType="VARCHAR" property="oilName" />
- <result column="oil_price" jdbcType="DECIMAL" property="oilPrice" />
- <result column="station_id" jdbcType="INTEGER" property="stationId" />
- <result column="station_name" jdbcType="VARCHAR" property="stationName" />
- <result column="date" jdbcType="TIMESTAMP" property="date" />
- <result column="status" jdbcType="VARCHAR" property="status" />
- </resultMap>
- <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.
- -->
- oil_gun_id, oil_gun_no, oil_name, oil_price, station_id, station_name, date, status
- </sql>
- <select id="selectByExample" parameterType="com.platform.yijia.pojo.StationOilGunExample" 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" />
- from station_oil_gun
- <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="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- select
- <include refid="Base_Column_List" />
- from station_oil_gun
- where oil_gun_id = #{oilGunId,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 station_oil_gun
- where oil_gun_id = #{oilGunId,jdbcType=INTEGER}
- </delete>
- <delete id="deleteByExample" parameterType="com.platform.yijia.pojo.StationOilGunExample">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- delete from station_oil_gun
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.platform.yijia.pojo.StationOilGun">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- insert into station_oil_gun (oil_gun_id, oil_gun_no, oil_name,
- oil_price, station_id, station_name,
- date, status)
- values (#{oilGunId,jdbcType=INTEGER}, #{oilGunNo,jdbcType=VARCHAR}, #{oilName,jdbcType=VARCHAR},
- #{oilPrice,jdbcType=DECIMAL}, #{stationId,jdbcType=INTEGER}, #{stationName,jdbcType=VARCHAR},
- #{date,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.platform.yijia.pojo.StationOilGun">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- insert into station_oil_gun
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="oilGunId != null">
- oil_gun_id,
- </if>
- <if test="oilGunNo != null">
- oil_gun_no,
- </if>
- <if test="oilName != null">
- oil_name,
- </if>
- <if test="oilPrice != null">
- oil_price,
- </if>
- <if test="stationId != null">
- station_id,
- </if>
- <if test="stationName != null">
- station_name,
- </if>
- <if test="date != null">
- date,
- </if>
- <if test="status != null">
- status,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="oilGunId != null">
- #{oilGunId,jdbcType=INTEGER},
- </if>
- <if test="oilGunNo != null">
- #{oilGunNo,jdbcType=VARCHAR},
- </if>
- <if test="oilName != null">
- #{oilName,jdbcType=VARCHAR},
- </if>
- <if test="oilPrice != null">
- #{oilPrice,jdbcType=DECIMAL},
- </if>
- <if test="stationId != null">
- #{stationId,jdbcType=INTEGER},
- </if>
- <if test="stationName != null">
- #{stationName,jdbcType=VARCHAR},
- </if>
- <if test="date != null">
- #{date,jdbcType=TIMESTAMP},
- </if>
- <if test="status != null">
- #{status,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.platform.yijia.pojo.StationOilGunExample" resultType="java.lang.Long">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- select count(*) from station_oil_gun
- <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 station_oil_gun
- <set>
- <if test="record.oilGunId != null">
- oil_gun_id = #{record.oilGunId,jdbcType=INTEGER},
- </if>
- <if test="record.oilGunNo != null">
- oil_gun_no = #{record.oilGunNo,jdbcType=VARCHAR},
- </if>
- <if test="record.oilName != null">
- oil_name = #{record.oilName,jdbcType=VARCHAR},
- </if>
- <if test="record.oilPrice != null">
- oil_price = #{record.oilPrice,jdbcType=DECIMAL},
- </if>
- <if test="record.stationId != null">
- station_id = #{record.stationId,jdbcType=INTEGER},
- </if>
- <if test="record.stationName != null">
- station_name = #{record.stationName,jdbcType=VARCHAR},
- </if>
- <if test="record.date != null">
- date = #{record.date,jdbcType=TIMESTAMP},
- </if>
- <if test="record.status != null">
- status = #{record.status,jdbcType=VARCHAR},
- </if>
- </set>
- <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 station_oil_gun
- set oil_gun_id = #{record.oilGunId,jdbcType=INTEGER},
- oil_gun_no = #{record.oilGunNo,jdbcType=VARCHAR},
- oil_name = #{record.oilName,jdbcType=VARCHAR},
- oil_price = #{record.oilPrice,jdbcType=DECIMAL},
- station_id = #{record.stationId,jdbcType=INTEGER},
- station_name = #{record.stationName,jdbcType=VARCHAR},
- date = #{record.date,jdbcType=TIMESTAMP},
- status = #{record.status,jdbcType=VARCHAR}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.platform.yijia.pojo.StationOilGun">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- update station_oil_gun
- <set>
- <if test="oilGunNo != null">
- oil_gun_no = #{oilGunNo,jdbcType=VARCHAR},
- </if>
- <if test="oilName != null">
- oil_name = #{oilName,jdbcType=VARCHAR},
- </if>
- <if test="oilPrice != null">
- oil_price = #{oilPrice,jdbcType=DECIMAL},
- </if>
- <if test="stationId != null">
- station_id = #{stationId,jdbcType=INTEGER},
- </if>
- <if test="stationName != null">
- station_name = #{stationName,jdbcType=VARCHAR},
- </if>
- <if test="date != null">
- date = #{date,jdbcType=TIMESTAMP},
- </if>
- <if test="status != null">
- status = #{status,jdbcType=VARCHAR},
- </if>
- </set>
- where oil_gun_id = #{oilGunId,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.platform.yijia.pojo.StationOilGun">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- -->
- update station_oil_gun
- set oil_gun_no = #{oilGunNo,jdbcType=VARCHAR},
- oil_name = #{oilName,jdbcType=VARCHAR},
- oil_price = #{oilPrice,jdbcType=DECIMAL},
- station_id = #{stationId,jdbcType=INTEGER},
- station_name = #{stationName,jdbcType=VARCHAR},
- date = #{date,jdbcType=TIMESTAMP},
- status = #{status,jdbcType=VARCHAR}
- where oil_gun_id = #{oilGunId,jdbcType=INTEGER}
- </update>
- <!--根据油站Id油枪号获取打印机编号 -->
- <select id="getPrinterSnByStationIdAndOilGunNo" parameterType="map" resultType="map">
- SELECT
- A.gun_no AS oilGunNo,
- A.station_id AS stationId,
- A.device_no AS printerSn,
- B.print_setting AS printSetting
- FROM station_device_manage AS A
- LEFT JOIN station_pay AS B ON A.station_id = B.station_id
- <where>
- A.device_status = "1"
- <if test="oilGunNo != null and oilGunNo !=''">
- AND FIND_IN_SET(#{oilGunNo}, A.gun_no)
- </if>
- <if test="stationId != null and stationId !=''">
- AND A.station_id = #{stationId}
- </if>
- </where>
- </select>
- </mapper>
|