<?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="vip.xiaonuo.production.mapper.ProductionWriteRateMapper">

    <select id="productionParam" resultType="vip.xiaonuo.production.param.TargetListDetailVos">


        SELECT
         ROUND(IFNULL(AVG(production_rate), 0), 2)  productionRate ,  DATE_FORMAT(create_time, '%Y-%m') ymonth

          FROM `production_write_rate`
          ${ew.customSqlSegment}
    </select>
    <select id="getListNengHaoDetail" resultType="vip.xiaonuo.production.param.TargetListDetailVos">


 SELECT
         ROUND(IFNULL(  (
          electricity * ${electricity} + zheng_qi  * ${zhengQi} +dan_qi * ${danQi}
          +ya_Suo* ${yaSuo}  +ro_water* ${roWater} +zl_water* ${zlWater}
           +xh_water* ${xhWater} +qd_water* ${qdWater} +swd_water* ${swdWater} +eswd_water* ${eswdWater}
           +re_water  * ${reWater} +diwen_water* ${diwenWater} +fu_swd_yierchun* ${fuSwdYierchun} + fu_eswd_yierchun* ${fuEswdYierchun}
          ), 0), 2)  productionRate ,  DATE_FORMAT(create_time, '%Y-%m') ymonth

          FROM  `production_write_energy`

          ${ew.customSqlSegment}

    </select>
</mapper>
