<?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">
    <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_name"     jdbcType="VARCHAR"    property="stationName" />
    <result column="date"             jdbcType="TIMESTAMP"  property="date" />
  </resultMap>

  <sql id="Base_Column_List">
    oil_price_id, oil_name, oil_price, station_id, station_name, date
  </sql>


  <!--查询油站油品价格-->
  <select id="getStationOilPrice" resultMap="BaseResultMap" parameterType="com.platform.yijia.pojo.StationOilPrice">
    SELECT
        oil_price_id,
        oil_name,
        oil_price,
        station_id,
        station_name,
        date
    FROM
        station_oil_price
    <where>
      <if test="stationId !=null">
        station_id = #{stationId}
      </if>
      <if test="oilName !=null and oilName !=''">
        AND oil_name = #{oilName}
      </if>
    </where>
  </select>




</mapper>
