<!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,
               paczfy_one,
               paczfy_two,
               syzfy_one,
               ylzfy_two,
               pamzszfy,
               ftzfy,
               cnzfy,
               gmsjfhyzfy,
               pamwnzfy,
               bcszfy,
               wnzyf,
               jbdf_one,
               jbdf_two,
               jbdf_total,
               dldf_one,
               dldf_two,
               dldf_total,
               ysf,
               szysf_one,
               szysf_two,
               szysf_total,
               zfy_one,
               zfy_two,
               zzsclfy_one,
               zzsclfy_two,
               zfy,
               otherzfy
        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,
               gmsjfhy,
               pam_wn,
               bcs,
               wnzl,
               dldl_one,
               dldl_two,
               dldl_total,
               other,
               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>