<?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.StationOilPriceMapper">
  <resultMap id="BaseResultMap" type="com.platform.yijia.pojo.StationOilPrice">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="oil_price_id" jdbcType="INTEGER" property="oilPriceId" />
    <result column="oil_name" jdbcType="VARCHAR" property="oilName" />
    <result column="oil_price" jdbcType="VARCHAR" property="oilPrice" />
    <result column="station_id" jdbcType="INTEGER" property="stationId" />
    <result column="station_nanme" jdbcType="VARCHAR" property="stationNanme" />
    <result column="date" jdbcType="TIMESTAMP" property="date" />
  </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_price_id, oil_name, oil_price, station_id, station_nanme, date
  </sql>
  <select id="selectByExample" parameterType="com.platform.yijia.pojo.StationOilPriceExample" 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_price
    <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_price
    where oil_price_id = #{oilPriceId,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_price
    where oil_price_id = #{oilPriceId,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.platform.yijia.pojo.StationOilPriceExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from station_oil_price
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.platform.yijia.pojo.StationOilPrice">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into station_oil_price (oil_price_id, oil_name, oil_price, 
      station_id, station_nanme, date
      )
    values (#{oilPriceId,jdbcType=INTEGER}, #{oilName,jdbcType=VARCHAR}, #{oilPrice,jdbcType=VARCHAR}, 
      #{stationId,jdbcType=INTEGER}, #{stationNanme,jdbcType=VARCHAR}, #{date,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.platform.yijia.pojo.StationOilPrice">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into station_oil_price
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="oilPriceId != null">
        oil_price_id,
      </if>
      <if test="oilName != null">
        oil_name,
      </if>
      <if test="oilPrice != null">
        oil_price,
      </if>
      <if test="stationId != null">
        station_id,
      </if>
      <if test="stationNanme != null">
        station_nanme,
      </if>
      <if test="date != null">
        date,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="oilPriceId != null">
        #{oilPriceId,jdbcType=INTEGER},
      </if>
      <if test="oilName != null">
        #{oilName,jdbcType=VARCHAR},
      </if>
      <if test="oilPrice != null">
        #{oilPrice,jdbcType=VARCHAR},
      </if>
      <if test="stationId != null">
        #{stationId,jdbcType=INTEGER},
      </if>
      <if test="stationNanme != null">
        #{stationNanme,jdbcType=VARCHAR},
      </if>
      <if test="date != null">
        #{date,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.platform.yijia.pojo.StationOilPriceExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from station_oil_price
    <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_price
    <set>
      <if test="record.oilPriceId != null">
        oil_price_id = #{record.oilPriceId,jdbcType=INTEGER},
      </if>
      <if test="record.oilName != null">
        oil_name = #{record.oilName,jdbcType=VARCHAR},
      </if>
      <if test="record.oilPrice != null">
        oil_price = #{record.oilPrice,jdbcType=VARCHAR},
      </if>
      <if test="record.stationId != null">
        station_id = #{record.stationId,jdbcType=INTEGER},
      </if>
      <if test="record.stationNanme != null">
        station_nanme = #{record.stationNanme,jdbcType=VARCHAR},
      </if>
      <if test="record.date != null">
        date = #{record.date,jdbcType=TIMESTAMP},
      </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_price
    set oil_price_id = #{record.oilPriceId,jdbcType=INTEGER},
      oil_name = #{record.oilName,jdbcType=VARCHAR},
      oil_price = #{record.oilPrice,jdbcType=VARCHAR},
      station_id = #{record.stationId,jdbcType=INTEGER},
      station_nanme = #{record.stationNanme,jdbcType=VARCHAR},
      date = #{record.date,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.platform.yijia.pojo.StationOilPrice">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update station_oil_price
    <set>
      <if test="oilName != null">
        oil_name = #{oilName,jdbcType=VARCHAR},
      </if>
      <if test="oilPrice != null">
        oil_price = #{oilPrice,jdbcType=VARCHAR},
      </if>
      <if test="stationId != null">
        station_id = #{stationId,jdbcType=INTEGER},
      </if>
      <if test="stationNanme != null">
        station_nanme = #{stationNanme,jdbcType=VARCHAR},
      </if>
      <if test="date != null">
        date = #{date,jdbcType=TIMESTAMP},
      </if>
    </set>
    where oil_price_id = #{oilPriceId,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.platform.yijia.pojo.StationOilPrice">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update station_oil_price
    set oil_name = #{oilName,jdbcType=VARCHAR},
      oil_price = #{oilPrice,jdbcType=VARCHAR},
      station_id = #{stationId,jdbcType=INTEGER},
      station_nanme = #{stationNanme,jdbcType=VARCHAR},
      date = #{date,jdbcType=TIMESTAMP}
    where oil_price_id = #{oilPriceId,jdbcType=INTEGER}
  </update>
</mapper>