<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tofly.xrtygis.custom.mapper.WaterMakingPlanMapper">

    <select id="viewExpense" resultType="map">
        select mouth,
               round(paczfy_one, 4)    paczfy_one,
               round(paczfy_two, 4)    paczfy_two,
               round(syzfy_one, 4)     syzfy_one,
               round(ylzfy_two, 4)     ylzfy_two,
               round(pamzszfy, 4)      pamzszfy,
               round(ftzfy, 4)         ftzfy,
               round(cnzfy, 4)         cnzfy,
               round(gmsjfhyzfy, 4)    gmsjfhyzfy,
               round(pamwnzfy, 4)      pamwnzfy,
               round(bcszfy, 4)        bcszfy,
               round(wnzyf, 4)         wnzyf,
               round(jbdf_one, 4)      jbdf_one,
               round(jbdf_two, 4)      jbdf_two,
               round(jbdf_total, 4)    jbdf_total,
               round(dldf_one, 4)      dldf_one,
               round(dldf_two, 4)      dldf_two,
               round(dldf_total, 4)    dldf_total,
               round(ysf, 4)           ysf,
               round(szysf_one, 4)     szysf_one,
               round(szysf_two, 4)     szysf_two,
               round(szysf_total, 4)   szysf_total,
               round(zfy_one, 4)       zfy_one,
               round(zfy_two, 4)       zfy_two,
               round(zzsclfy_one, 4)   zzsclfy_one,
               round(zzsclfy_two, 4)   zzsclfy_two,
               round(zfy, 4)           zfy,
               round(CNZFY_TWO, 4)     CNZFY_TWO,
               round(otherzfy, 4)      otherzfy,
               round(OTHER_ONE_ZFY, 4) OTHER_ONE_ZFY,
               round(OTHER_TWO_ZFY, 4) OTHER_TWO_ZFY
        from TF_YWPN_COSTBGFIXED_W
        where substr(MOUTH, 1, 4) = #{year}
        order by mouth
    </select>

    <select id="viewFixedPlan" resultType="map">
        select mouth,
               dfcb_one,
               dfcb_two,
               dfcb_total,
               paccb_one,
               sycb_one,
               cncb_one,
               bcscb_one,
               zsclcb_one,
               paccb_two,
               ylcb_two,
               pamzscb_two,
               ftcb_two,
               gmsjfhycb_two,
               pamwncb_two,
               wnzycb_two,
               zsclcb_two,
               zsclcb_total,
               ysfcb,
               szysfcb_one,
               szysfcb_two,
               szysfcb_total,
               dwcb_one,
               dwcb_two,
               dwcb_total,
               othercb
        from TF_YWPN_COSTBGFIXED_W
        where YEAR_ID = #{id}
        order by mouth
    </select>

    <select id="viewElectricityBill" resultType="map">
        select MOUTH, JBDF_ONE, JBDF_TWO, JBDF_TOTAL
        from TF_YWPN_COSTBGFIXED_W
        where substr(MOUTH, 1, 4) = #{year}
        order by mouth
    </select>

    <select id="getDosage" resultType="map">
        select w.month,
               pac_one,
               pac_two,
               sy_one,
               yl_two,
               pam,
               ft,
               cn,
               CN_TWO,
               gmsjfhy,
               pam_wn,
               bcs,
               wnzl,
               dldl_one,
               dldl_two,
               dldl_total,
               other,
               OTHER_ONE,
               OTHER_TWO,
               zsl_one,
               zsl_two,
               zsl_hqsk,
               zsl_total
        from TF_YWPN_COSTBGINDEX_W i
                 full join TF_YWPN_COSTBGWATER_W w on i.MONTH = w.MONTH
        where substr(i.MONTH, 1, 4) = #{year}
           or substr(w.month, 1, 4) = #{year}
    </select>

</mapper>