<?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.tofly.xrtygis.custom.mapper.DataMonthPlanMapper">

    <!-- *********************制水材料************************* -->

    <select id="getOneMonthActual" resultType="com.tofly.xrtygis.custom.entity.vo.MarkWaterVo">
        select GSL_ONE   gsl,
               ZSL_ONE   zsl,
               ZYSL_ONE  zysl,
               ZYSLL_ONE zysll,
               PACDH_ONE pacdh,
               SYDH_ONE  sydh,
               DH_ONE    dh,
               PAC_ONE   pac,
               SY_ONE    sy,
               CN,
               BCS,
               DLDL_ONE  dldl
        from TF_YWPN_COSTRLWATER_W w
                 full join TF_YWPN_COSTRLUNIT_W u
                           on to_char(w.UP_DATE, 'yyyy-mm-dd') = to_char(u.UP_DATE, 'yyyy-mm-dd')
                               and w.MARK = u.MARK
        where w.MARK = '1'
          and to_char(w.UP_DATE, 'yyyy-mm') = #{year}
    </select>

    <select id="getTwoMonthActual" resultType="com.tofly.xrtygis.custom.entity.vo.MarkWaterVo">
        select GSL_TWO   gsl,
               ZSL_TWO   zsl,
               ZYSL_TWO  zysl,
               ZYSLL_TWO zysll,
               PACDH_TWO pacdh,
               YLDH_TWO  yldh,
               DH_TWO    dh,
               PAC_TWO   pac,
               YL_TWO    yl,
               PAM,
               FT,
               GMSJFHY   gmsj,
               PAM_WY    pamwn,
               WNZL,
               DLDL_TWO  dldl
        from TF_YWPN_COSTRLWATER_W w
                 full join TF_YWPN_COSTRLUNIT_W u
                           on to_char(w.UP_DATE, 'yyyy-mm-dd') = to_char(u.UP_DATE, 'yyyy-mm-dd')
                               and w.MARK = u.MARK
        where w.MARK = '1'
          and to_char(w.UP_DATE, 'yyyy-mm') = #{year}
    </select>

    <select id="getOneMonthPlan" resultType="com.tofly.xrtygis.custom.entity.vo.MarkWaterVo">
        select GSL_ONE   gsl,
               ZSL_ONE   zsl,
               ZYSL_ONE  zysl,
               ZYSLL_ONE zysll,
               PACDH_ONE pacdh,
               SYDH_ONE  sydh,
               DH_ONE    dh,
               PAC_ONE   pac,
               SY_ONE    sy,
               CN,
               BCS,
               DLDL_ONE  dldl
        from TF_YWPN_COSTBGWATER_W w,
             TF_YWPN_COSTBGINDEX_W i,
             TF_YWPN_COSTBGUNIT_W u
        where w.MONTH = i.MONTH
          and i.MONTH = u.MONTH
          and w.MONTH = #{year}
    </select>

    <select id="getTwoMonthPlan" resultType="com.tofly.xrtygis.custom.entity.vo.MarkWaterVo">
        select GSL_TWO   gsl,
               ZSL_TWO   zsl,
               ZYSL_TWO  zysl,
               ZYSLL_TWO zysll,
               PACDH_TWO pacdh,
               YLDH_TWO  yldh,
               DH_TWO    dh,
               PAC_TWO   pac,
               YL_TWO    yl,
               PAM,
               FT,
               GMSJFHY   gmsj,
               PAM_WN    pamwn,
               WNZL,
               DLDL_TWO  dldl
        from TF_YWPN_COSTBGWATER_W w,
             TF_YWPN_COSTBGINDEX_W i,
             TF_YWPN_COSTBGUNIT_W u
        where w.MONTH = i.MONTH
          and i.MONTH = u.MONTH
          and w.MONTH = #{year}
    </select>

    <select id="getOneMonthPile" resultType="com.tofly.xrtygis.custom.entity.vo.MarkWaterVo">
        select sum(GSL_ONE)                                                                       gsl,
               sum(ZSL_ONE)                                                                       zsl,
               sum(ZYSL_ONE)                                                                      zysl,
               sum(ZYSLL_ONE)                                                                     zysll,
               round(nvl(sum(PAC_ONE), 0) / decode(sum(ZSL_ONE), 0, null, sum(ZSL_ONE)) * 10, 5)  pacdh,
               round(nvl(sum(SY_ONE), 0) / decode(sum(ZSL_ONE), 0, null, sum(ZSL_ONE)) * 10, 5)   sydh,
               round(nvl(sum(DLDL_ONE), 0) / decode(sum(ZSL_ONE), 0, null, sum(ZSL_ONE)) * 10, 5) dh,
               sum(PAC_ONE)                                                                       pac,
               sum(SY_ONE)                                                                        sy,
               sum(CN)                                                                            cn,
               sum(BCS)                                                                           bcs,
               sum(DLDL_ONE)                                                                      dldl
        from TF_YWPN_COSTRLWATER_W
        where MARK = '1'
          and to_char(UP_DATE, 'yyyy-mm') = #{year}
        group by to_char(UP_DATE, 'yyyy-mm')
    </select>

    <select id="getTwoMonthPile" resultType="com.tofly.xrtygis.custom.entity.vo.MarkWaterVo">
        select sum(GSL_TWO)                                                                       gsl,
               sum(ZSL_TWO)                                                                       zsl,
               sum(ZYSL_TWO)                                                                      zysl,
               sum(ZYSLL_TWO)                                                                     zysll,
               round(nvl(sum(PAC_TWO), 0) / decode(sum(ZSL_TWO), 0, null, sum(ZSL_TWO)) * 10, 5)  pacdh,
               round(nvl(sum(YL_TWO), 0) / decode(sum(ZSL_TWO), 0, null, sum(ZSL_TWO)) * 10, 5)   yldh,
               round(nvl(sum(DLDL_TWO), 0) / decode(sum(ZSL_TWO), 0, null, sum(ZSL_TWO)) * 10, 5) dh,
               sum(PAC_TWO)                                                                       pac,
               sum(YL_TWO)                                                                        yl,
               sum(PAM)                                                                           pam,
               sum(FT)                                                                            ft,
               sum(GMSJFHY)                                                                       gmsj,
               sum(PAM_WY)                                                                        pamwn,
               sum(WNZL),
               sum(DLDL_TWO)                                                                      dldl
        from TF_YWPN_COSTRLWATER_W
        where MARK = '1'
          and to_char(UP_DATE, 'yyyy-mm') = #{year}
        group by to_char(UP_DATE, 'yyyy-mm')
    </select>

    <select id="getOneInfo" resultType="map">
        select to_char(w.UP_DATE, 'yyyy-mm-dd') day,
               GSL_ONE                          gsl,
               ZSL_ONE                          zsl,
               ZYSL_ONE                         zysl,
               ZYSLL_ONE                        zysll,
               PACDH_ONE                        pacdh,
               SYDH_ONE                         sydh,
               DH_ONE                           dh,
               PAC_ONE                          pac,
               SY_ONE                           sy,
               CN,
               BCS,
               DLDL_ONE                         dldl
        from TF_YWPN_COSTRLWATER_W w,
             TF_YWPN_COSTRLUNIT_W u
        where w.MARK = u.MARK
          and to_char(w.UP_DATE, 'yyyy-mm-dd') = to_char(u.UP_DATE, 'yyyy-mm-dd')
          and w.MARK = '0'
          and to_char(w.UP_DATE, 'yyyy-mm') = #{year}
        order by day
    </select>

    <select id="getTwoInfo" resultType="map">
        select to_char(w.UP_DATE, 'yyyy-mm-dd') day,
               GSL_TWO                          gsl,
               ZSL_TWO                          zsl,
               ZYSL_TWO                         zysl,
               ZYSLL_TWO                        zysll,
               PACDH_TWO                        pacdh,
               YLDH_TWO                         yldh,
               DH_TWO                           dh,
               PAC_TWO                          pac,
               YL_TWO                           yl,
               PAM,
               FT,
               GMSJFHY                          gmsj,
               PAM_WY                           pamwn,
               WNZL,
               DLDL_TWO                         dldl
        from TF_YWPN_COSTRLWATER_W w,
             TF_YWPN_COSTRLUNIT_W u
        where w.MARK = u.MARK
          and to_char(w.UP_DATE, 'yyyy-mm-dd') = to_char(u.UP_DATE, 'yyyy-mm-dd')
          and w.MARK = '0'
          and to_char(w.UP_DATE, 'yyyy-mm') = #{year}
        order by day
    </select>

    <!-- *********************成本核算************************* -->

    <!--
        <select id="viewOneMonthActual" resultType="com.tofly.xrtygis.custom.entity.vo.CostVo">
            select PACZFY_ONE  pacfy,
                   SYZFY_ONE   syfy,
                   CNZFY       cnfy,
                   BCSZFY      bcsfy,
                   JBDF_ONE    jbdf,
                   DLDF_ONE    dldf,
                   YSF,
                   SZYSF_ONE   szysf,
                   ZZSCLFY_ONE zsclfy,
                   ZFY_ONE     zfy,
                   DFCB_ONE    dfcb,
                   ZSCLCB_ONE  zzsclcb,
                   YSFCB,
                   SZYSFCB_ONE szysfcb,
                   DWCB_ONE    dwbdcb,
                   SYDJ,
                   CNDJ,
                   BCSDJ
            from TF_YWPN_COSTRLFIXED_W f,
                 TF_YWPN_COSTRLPRICE_W p
            where to_char(f.UP_DATE, 'yyyy') = p.YEAR
              and f.MARK = 1
              and p.ISNEW = 1
              and to_char(f.UP_DATE, 'yyyy-mm') = #{year}
        </select>

        <select id="viewTwoMonthActual" resultType="com.tofly.xrtygis.custom.entity.vo.CostVo">
            select PACZFY_TWO  pacfy,
                   YLZFY_TWO   ylfy,
                   PAMZSZFY    pamzs,
                   FTZFY       ftfy,
                   GMSJFHYZFY  gmsjfy,
                   PAMWNZFY    pamwn,
                   WNZYF       wnzyfy,
                   JBDF_TWO    jbdf,
                   DLDF_TWO    dldf,
                   SZYSF_TWO   szysf,
                   ZZSCLFY_TWO zsclfy,
                   ZFY_TWO     zfy,
                   DFCB_TWO    dfcb,
                   YLDJ,
                   PAM_ZSDJ    pamzsdj,
                   GMSJFHYDJ   gmsjdj,
                   ZSCLCB_ONE  zzsclcb,
                   FTDJ,
                   PAM_WNDJ    pamwndj,
                   WNZYDJ,
                   ZSCLCB_TWO  zzsclcb,
                   SZYSFCB_TWO szysfcb,
                   DWCB_TWO    dwbdcb
            from TF_YWPN_COSTRLFIXED_W fix
                     full join TF_YWPN_COSTRLPRICE_W pri
                               on to_char(fix.UP_DATE, 'yyyy') = pri.YEAR and pri.ISNEW = '1'
            where MARK = '1'
              and to_char(UP_DATE, 'yyyy-mm') = #{year}
        </select>

        <select id="viewOneMonthPlan" resultType="com.tofly.xrtygis.custom.entity.vo.CostVo">
            select PACZFY_ONE  pacfy,
                   SYZFY_ONE   syfy,
                   CNZFY       cnfy,
                   BCSZFY      bcsfy,
                   JBDF_ONE    jbdf,
                   DLDF_ONE    dldf,
                   YSF,
                   SZYSF_ONE   szysf,
                   ZZSCLFY_ONE zsclfy,
                   ZFY_ONE     zfy,
                   DFCB_ONE    dfcb,
                   SYDJ,
                   CNDJ,
                   BCSDJ,
                   ZSCLCB_ONE  zzsclcb,
                   YSFCB,
                   SZYSFCB_ONE szysfcb,
                   DWCB_ONE    dwbdcb
            from TF_YWPN_COSTBGFIXED_W fix
                     full join (select *
                                from (select *
                                      from TF_YWPN_COSTBGPRICE_W
                                      where YEAR = substr(#{year}, 1, 4)
                                      order by create_time)
                                where rownum = 1) pri
                               on substr(fix.MOUTH, 1, 4) = pri.YEAR
            where MOUTH = #{year}
        </select>

        <select id="viewTwoMonthPlan" resultType="com.tofly.xrtygis.custom.entity.vo.CostVo">
            select PACZFY_TWO  pacfy,
                   YLZFY_TWO   ylfy,
                   PAMZSZFY    pamzs,
                   FTZFY       ftfy,
                   GMSJFHYZFY  gmsjfy,
                   PAMWNZFY    pamwn,
                   WNZYF       wnzyfy,
                   JBDF_TWO    jbdf,
                   DLDF_TWO    dldf,
                   SZYSF_TWO   szysf,
                   ZZSCLFY_TWO zsclfy,
                   ZFY_TWO     zfy,
                   DFCB_TWO    dfcb,
                   YLDJ,
                   PAM_ZSDJ    pamzsdj,
                   GMSJFHYDJ   gmsjdj,
                   ZSCLCB_ONE  zzsclcb,
                   FTDJ,
                   PAM_WNDJ    pamwndj,
                   WNZYDJ      wnzydj,
                   ZSCLCB_TWO  zzsclcb,
                   SZYSFCB_TWO szysfcb,
                   DWCB_TWO    dwbdcb
            from TF_YWPN_COSTBGFIXED_W fix
                     full join (select *
                                from (select *
                                      from TF_YWPN_COSTBGPRICE_W
                                      where YEAR = substr(#{year}, 1, 4)
                                      order by create_time)
                                where rownum = 1) pri
                               on substr(fix.MOUTH, 1, 4) = pri.YEAR
            where MOUTH = #{year}
        </select>

        <select id="viewOneMonthPile" resultType="com.tofly.xrtygis.custom.entity.vo.CostVo">
            select sum(PACZFY_ONE)                                                            pacfy,
                   sum(SYZFY_ONE)                                                             syfy,
                   sum(CNZFY)                                                                 cnfy,
                   sum(BCSZFY)                                                                bcsfy,
                   sum(JBDF_ONE)                                                              jbdf,
                   sum(DLDF_ONE)                                                              dldf,
                   sum(YSF)                                                                   ysf,
                   sum(SZYSF_ONE)                                                             szysf,
                   sum(ZZSCLFY_ONE)                                                           zsclfy,
                   sum(ZFY_ONE)                                                               zfy,
                   SYDJ,
                   CNDJ,
                   BCSDJ,
                   round((sum(JBDF_ONE) + sum(DLDF_ONE)) / nullif(sum(GSL_ONE), 0) * 1000, 5) dfcb,
                   round(sum(zzsclfy_one) / nullif(sum(GSL_ONE), 0) * 1000, 5)                zzsclcb,
                   round(sum(ysf) / nullif(sum(GSL_ONE), 0) * 1000, 5)                        ysfcb,
                   round(sum(szysf_one) / nullif(sum(GSL_ONE), 0) * 1000, 5)                  szysfcb,
                   round(sum(zfy_one) / nullif(sum(GSL_ONE), 0) * 1000, 5)                    dwbdcb
            from TF_YWPN_COSTRLFIXED_W f,
                 TF_YWPN_COSTRLPRICE_W p,
                 TF_YWPN_COSTRLWATER_W w
            where f.MARK = '0'
              and to_char(f.UP_DATE, 'yyyy') = p.YEAR
              and p.ISNEW = '1'
              and to_char(f.up_date, 'yyyy-mm-dd') = to_char(w.up_date, 'yyyy-mm-dd')
              and to_char(f.UP_DATE, 'yyyy-mm') = #{year,jdbcType = VARCHAR}
            group by to_char(f.UP_DATE, 'yyyy-mm'), SYDJ, CNDJ, BCSDJ
        </select>

        <select id="viewTwoMonthPile" resultType="com.tofly.xrtygis.custom.entity.vo.CostVo">
            select sum(PACZFY_TWO)                                                            pacfy,
                   sum(YLZFY_TWO)                                                             ylfy,
                   sum(PAMZSZFY)                                                              pamzs,
                   sum(FTZFY)                                                                 ftfy,
                   sum(GMSJFHYZFY)                                                            gmsjfy,
                   sum(PAMWNZFY)                                                              pamwn,
                   sum(WNZYF)                                                                 wnzyfy,
                   sum(JBDF_TWO)                                                              jbdf,
                   sum(DLDF_TWO)                                                              dldf,
                   sum(SZYSF_TWO)                                                             szysf,
                   sum(ZZSCLFY_TWO)                                                           zsclfy,
                   sum(ZFY_TWO)                                                               zfy,
                   YLDJ,
                   PAM_ZSDJ                                                                   pamzsdj,
                   GMSJFHYDJ                                                                  gmsjdj,
                   FTDJ,
                   PAM_WNDJ                                                                   pamwndj,
                   WNZYDJ,
                   round((sum(JBDF_TWO) + sum(DLDF_TWO)) / nullif(sum(GSL_TWO), 0) * 1000, 5) dfcb,
                   round(sum(zzsclfy_two) / nullif(sum(GSL_TWO), 0) * 1000, 5)        zzsclcb,
                   round(sum(szysf_two) / nullif(sum(GSL_TWO), 0) * 1000, 5)          szysfcb,
                   round(sum(zfy_two) / nullif(sum(GSL_TWO), 0) * 1000, 5)            dwbdcb
            from TF_YWPN_COSTRLFIXED_W f,
                 TF_YWPN_COSTRLPRICE_W p,
                 TF_YWPN_COSTRLWATER_W w
            where f.MARK = '0'
              and to_char(f.up_date, 'yyyy-mm-dd') = to_char(w.up_date, 'yyyy-mm-dd')
              and to_char(f.UP_DATE, 'yyyy') = p.YEAR
              and p.ISNEW = '1'
              and to_char(f.UP_DATE, 'yyyy-mm') = #{year}
            group by to_char(f.UP_DATE, 'yyyy-mm'), YLDJ, PAM_ZSDJ, GMSJFHYDJ, FTDJ, PAM_WNDJ, WNZYDJ
        </select>

        <select id="viewOneInfo" resultType="map">
            select to_char(UP_DATE, 'yyyy-mm-dd') day,
                   PACZFY_ONE                     pacfy,
                   SYZFY_ONE                      syfy,
                   CNZFY                          cnfy,
                   BCSZFY                         bcsfy,
                   JBDF_ONE                       jbdf,
                   DLDF_ONE                       dldf,
                   YSF,
                   SZYSF_ONE                      szysf,
                   ZZSCLFY_ONE                    zsclfy,
                   ZFY_ONE                        zfy,
                   DFCB_ONE                       dfcb,
                   SYDJ,
                   CNDJ,
                   BCSDJ,
                   ZSCLCB_ONE                     zzsclcb,
                   YSFCB,
                   SZYSFCB_ONE                    szysfcb,
                   DWCB_ONE                       dwbdcb
            from TF_YWPN_COSTRLFIXED_W fix
                     full join TF_YWPN_COSTRLPRICE_W pri
                               on to_char(fix.UP_DATE, 'yyyy') = pri.YEAR and pri.ISNEW = '1'
            where MARK = '0'
              and to_char(UP_DATE, 'yyyy-mm') = #{year}
            order by day
        </select>

        <select id="viewTwoInfo" resultType="map">
            select to_char(UP_DATE, 'yyyy-mm-dd') day,
                   PACZFY_TWO                     pacfy,
                   YLZFY_TWO                      ylfy,
                   PAMZSZFY                       pamzs,
                   FTZFY                          ftfy,
                   GMSJFHYZFY                     gmsjfy,
                   PAMWNZFY                       pamwn,
                   WNZYF                          wnzyfy,
                   JBDF_TWO                       jbdf,
                   DLDF_TWO                       dldf,
                   SZYSF_TWO                      szysf,
                   ZZSCLFY_TWO                    zsclfy,
                   ZFY_TWO                        zfy,
                   DFCB_TWO                       dfcb,
                   YLDJ,
                   PAM_ZSDJ                       pamzsdj,
                   GMSJFHYDJ                      gmsjdj,
                   ZSCLCB_ONE                     zzsclcb,
                   FTDJ,
                   PAM_WNDJ                       pamwndj,
                   WNZYDJ,
                   ZSCLCB_TWO                     zzsclcb,
                   SZYSFCB_TWO                    szysfcb,
                   DWCB_TWO                       dwbdcb
            from TF_YWPN_COSTRLFIXED_W fix
                     full join TF_YWPN_COSTRLPRICE_W pri
                               on to_char(fix.UP_DATE, 'yyyy') = pri.YEAR and pri.ISNEW = '1'
            where MARK = '0'
              and to_char(UP_DATE, 'yyyy-mm') = #{year}
            order by day
        </select>

        <select id="viewSumMonthActual" resultType="map">
            select (PACZFY_ONE + PACZFY_TWO) paczfy_total,
                   JBDF_TOTAL,
                   DLDF_TOTAL,
                   SZYSF_TOTAL,
                   ZZSCLFY_ONE + ZZSCLFY_TWO zzsclfy_total,
                   ZFY,
                   DFCB_TOTAL,
                   ZSCLCB_TOTAL,
                   SZYSFCB_TOTAL,
                   DWCB_TOTAL,
                   SYZFY_ONE,
                   CNZFY,
                   BCSZFY,
                   YSF,
                   YSFCB,
                   SYDJ,
                   CNDJ,
                   BCSDJ,
                   YLZFY_TWO,
                   PAMZSZFY,
                   FTZFY,
                   GMSJFHYZFY,
                   PAMWNZFY,
                   WNZYF,
                   YLDJ,
                   PAM_ZSDJ,
                   GMSJFHYDJ,
                   FTDJ,
                   PAM_WNDJ,
                   WNZYDJ
            from TF_YWPN_COSTRLFIXED_W f,
                 TF_YWPN_COSTRLPRICE_W p
            where to_char(f.UP_DATE, 'yyyy') = p.YEAR
              and f.MARK = 1
              and p.ISNEW = 1
              and to_char(f.UP_DATE, 'yyyy-mm') = #{year}
        </select>

        <select id="viewSumMonthPlan" resultType="map">
            select (PACZFY_ONE + PACZFY_TWO) paczfy_total,
                   JBDF_TOTAL,
                   DLDF_TOTAL,
                   SZYSF_TOTAL,
                   ZZSCLFY_ONE + ZZSCLFY_TWO zzsclfy_total,
                   ZFY,
                   DFCB_TOTAL,
                   ZSCLCB_TOTAL,
                   SZYSFCB_TOTAL,
                   DWCB_TOTAL,
                   SYZFY_ONE,
                   CNZFY,
                   BCSZFY,
                   YSF,
                   YSFCB,
                   SYDJ,
                   CNDJ,
                   BCSDJ,
                   YLZFY_TWO,
                   PAMZSZFY,
                   FTZFY,
                   GMSJFHYZFY,
                   PAMWNZFY,
                   WNZYF,
                   YLDJ,
                   PAM_ZSDJ,
                   GMSJFHYDJ,
                   FTDJ,
                   PAM_WNDJ,
                   WNZYDJ
            from TF_YWPN_COSTBGFIXED_W fix
                     full join (select *
                                from (select *
                                      from TF_YWPN_COSTBGPRICE_W
                                      where YEAR = substr(#{year}, 1, 4)
                                      order by create_time)
                                where rownum = 1) pri
                               on substr(fix.MOUTH, 1, 4) = pri.YEAR
            where fix.MOUTH = #{year}
        </select>

        <select id="viewSumMonthPile" resultType="map">
            select sum(PACZFY_ONE) + sum(PACZFY_TWO)                                                  paczfy_total,
                   sum(JBDF_TOTAL)                                                                    JBDF_TOTAL,
                   sum(DLDF_TOTAL)                                                                    DLDF_TOTAL,
                   sum(SZYSF_TOTAL)                                                                   SZYSF_TOTAL,
                   sum(ZZSCLFY_ONE) + sum(ZZSCLFY_TWO)                                                zzsclfy_total,
                   sum(ZFY)                                                                           ZFY,
                   sum(SYZFY_ONE)                                                                     SYZFY_ONE,
                   sum(CNZFY)                                                                         CNZFY,
                   sum(BCSZFY)                                                                        BCSZFY,
                   sum(YSF)                                                                           YSF,
                   sum(YLZFY_TWO)                                                                     YLZFY_TWO,
                   sum(PAMZSZFY)                                                                      PAMZSZFY,
                   sum(FTZFY)                                                                         FTZFY,
                   sum(GMSJFHYZFY)                                                                    GMSJFHYZFY,
                   sum(PAMWNZFY)                                                                      PAMWNZFY,
                   sum(WNZYF)                                                                         WNZYF,

                   round((sum(JBDF_TOTAL) + sum(DLDF_TOTAL)) / nullif(sum(GSL_TOTAL), 0) * 1000, 5)   DFCB_TOTAL,
                   round((sum(ZZSCLFY_ONE) + sum(ZZSCLFY_TWO)) / nullif(sum(GSL_TOTAL), 0) * 1000, 5) ZSCLCB_TOTAL,
                   round(sum(SZYSF_TOTAL) / nullif(sum(GSL_TOTAL), 0) * 1000, 5)                      SZYSFCB_TOTAL,
                   round(sum(ZFY) / nullif(sum(GSL_TOTAL), 0) * 1000, 5)                              DWCB_TOTAL,
                   round(sum(YSF) / nullif(sum(GSL_TOTAL), 0) * 1000, 5)                              YSFCB,

                   SYDJ,
                   CNDJ,
                   BCSDJ,
                   YLDJ,
                   PAM_ZSDJ,
                   GMSJFHYDJ,
                   FTDJ,
                   PAM_WNDJ,
                   WNZYDJ
            from TF_YWPN_COSTRLFIXED_W f,
                 TF_YWPN_COSTRLPRICE_W p,
                 TF_YWPN_COSTRLWATER_W w
            where to_char(f.UP_DATE, 'yyyy') = p.YEAR
              and to_char(w.UP_DATE, 'yyyy-mm-dd') = to_char(f.UP_DATE, 'yyyy-mm-dd')
              and f.MARK = 1
              and p.ISNEW = 1
              and to_char(f.UP_DATE, 'yyyy-mm') = #{year}
            group by to_char(f.UP_DATE, 'yyyy-mm'), SYDJ, CNDJ, BCSDJ, YLDJ, PAM_ZSDJ, GMSJFHYDJ, FTDJ, PAM_WNDJ, WNZYDJ
        </select>
    -->
</mapper>