<?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.miaxis.price.mapper.PriceInfoMapper">

    <resultMap type="PriceInfo" id="PriceInfoResult">
        <result property="id"    column="id"    />
        <result property="brand"    column="brand"    />
        <result property="unitModel"    column="unit_model"    />
        <result property="unitPowerKw"    column="unit_power_kw"    />
        <result property="unitPowerKva"    column="unit_power_kva"    />
        <result property="rate"    column="rate"    />
        <result property="dieselEngineModel"    column="diesel_engine_model"    />
        <result property="speed"    column="speed"    />
        <result property="powerPrice"    column="power_price"    />
        <result property="generatorModel"    column="generator_model"    />
        <result property="generatorPrice"    column="generator_price"    />
        <result property="mutePrice"    column="mute_price"    />
        <result property="openPrice"    column="open_price"    />
        <result property="atsModel"    column="ats_model"    />
        <result property="atsPrice"    column="ats_price"    />
        <result property="batteryModel"    column="battery_model"    />
        <result property="batteryPrice"    column="battery_price"    />
        <result property="controllerMinbei"    column="controller_minbei"    />
        <result property="controllerPrice"    column="controller_price"    />
        <result property="totalCostMute"    column="total_cost_mute"    />
        <result property="totalCostOpen"    column="total_cost_open"    />
        <result property="muteLong"    column="mute_long"    />
        <result property="muteWidth"    column="mute_width"    />
        <result property="muteHigh"    column="mute_high"    />
        <result property="openLong"    column="open_long"    />
        <result property="openWidth"    column="open_width"    />
        <result property="openHigh"    column="open_high"    />
        <result property="ckdLong"    column="ckd_long"    />
        <result property="ckdWidth"    column="ckd_width"    />
        <result property="ckdHigh"    column="ckd_high"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>

    <sql id="selectPriceInfoVo">
        select * from price_info
    </sql>

    <select id="selectPriceInfoList" parameterType="PriceInfo" resultMap="PriceInfoResult">
        <include refid="selectPriceInfoVo"/>
        <where>
            <if test="brand != null  and brand != ''"> and brand = #{brand}</if>
            <if test="unitModel != null  and unitModel != ''"> and unit_model = #{unitModel}</if>
            <if test="unitPowerKw != null "> and unit_power_kw = #{unitPowerKw}</if>
            <if test="unitPowerKva != null "> and unit_power_kva = #{unitPowerKva}</if>
            <if test="rate != null "> and rate = #{rate}</if>
            <if test="dieselEngineModel != null  and dieselEngineModel != ''"> and diesel_engine_model = #{dieselEngineModel}</if>
            <if test="speed != null "> and speed = #{speed}</if>
            <if test="powerPrice != null "> and power_price = #{powerPrice}</if>
            <if test="generatorModel != null  and generatorModel != ''"> and generator_model = #{generatorModel}</if>
            <if test="generatorPrice != null "> and generator_price = #{generatorPrice}</if>
            <if test="mutePrice != null "> and mute_price = #{mutePrice}</if>
            <if test="openPrice != null "> and open_price = #{openPrice}</if>
            <if test="atsModel != null  and atsModel != ''"> and ats_model = #{atsModel}</if>
            <if test="atsPrice != null "> and ats_price = #{atsPrice}</if>
            <if test="batteryModel != null  and batteryModel != ''"> and battery_model = #{batteryModel}</if>
            <if test="batteryPrice != null "> and battery_price = #{batteryPrice}</if>
            <if test="controllerMinbei != null  and controllerMinbei != ''"> and controller_minbei = #{controllerMinbei}</if>
            <if test="controllerPrice != null "> and controller_price = #{controllerPrice}</if>
            <if test="totalCostMute != null "> and total_cost_mute = #{totalCostMute}</if>
            <if test="totalCostOpen != null "> and total_cost_open = #{totalCostOpen}</if>
            <if test="muteLong != null "> and mute_long = #{muteLong}</if>
            <if test="muteWidth != null "> and mute_width = #{muteWidth}</if>
            <if test="muteHigh != null "> and mute_high = #{muteHigh}</if>
            <if test="openLong != null "> and open_long = #{openLong}</if>
            <if test="openWidth != null "> and open_width = #{openWidth}</if>
            <if test="openHigh != null "> and open_high = #{openHigh}</if>
            <if test="ckdLong != null "> and ckd_long = #{ckdLong}</if>
            <if test="ckdWidth != null "> and ckd_width = #{ckdWidth}</if>
            <if test="ckdHigh != null "> and ckd_high = #{ckdHigh}</if>
        </where>
    </select>

</mapper>
