/**
   * 插入一条数据
   *
   * @param lwWholeSaleSummaryDto lwWholeSaleSummaryDto
   * @throws Exception
   */
  public void insert(LwWholeSaleSummaryDto lwWholeSaleSummaryDto) throws Exception {
    StringBuffer buffer = new StringBuffer(200);
    buffer.append("INSERT INTO LwWholeSaleSummary (");
    buffer.append("LineCode,");
    buffer.append("StatMonth,");
    buffer.append("PowerClass,");
    buffer.append("ElectricQuantity,");
    buffer.append("PointerQuantity,");
    buffer.append("SanXiaFee,");
    buffer.append("Surcharge,");
    buffer.append("SumFee,");
    buffer.append("ValidStatus,");
    buffer.append("Flag,");
    buffer.append("Remark,");
    buffer.append("TransLoss,");
    buffer.append("LineLoss,");
    buffer.append("UnPointerQuantity,");
    buffer.append("RateCode,");
    buffer.append("AdjustRate,");
    buffer.append("FarmUseScale,");
    buffer.append("FarmUsePrice,");
    buffer.append("FarmUseQuantity,");
    buffer.append("FarmUseFee,");
    buffer.append("ProductScale,");
    buffer.append("ProductPrice,");
    buffer.append("ProductQuantity,");
    buffer.append("ProductFee,");
    buffer.append("DenizenScale,");
    buffer.append("DenizenPrice,");
    buffer.append("DenizenQuantity,");
    buffer.append("DenizenFee,");
    buffer.append("UnDenizenScale,");
    buffer.append("UnDenizenPrice,");
    buffer.append("UnDenizenQuantity,");
    buffer.append("UnDenizenFee,");
    buffer.append("IndustryScale,");
    buffer.append("IndustryPrice,");
    buffer.append("IndustryQuantity,");
    buffer.append("IndustryFee,");
    buffer.append("BizScale,");
    buffer.append("BizPrice,");
    buffer.append("BizQuantity,");
    buffer.append("BizFee,");
    buffer.append("PowerRateFee,");
    buffer.append("UpCompany,");
    buffer.append("PowerFee,");
    buffer.append("InputDate,");
    buffer.append("Kv,");
    buffer.append("Wholesaletype,");
    buffer.append("WorkNum,");
    buffer.append("UnWorkNum,");
    buffer.append("OtherSurcharge,");
    buffer.append("DifferenceQuantity,");
    buffer.append("UnTransLoss,");
    buffer.append("UnLineLoss ");
    buffer.append(") ");
    if (logger.isDebugEnabled()) {
      StringBuffer debugBuffer = new StringBuffer(buffer.length() * 4);
      debugBuffer.append(buffer.toString());
      debugBuffer.append("VALUES(");
      debugBuffer.append("'").append(lwWholeSaleSummaryDto.getLineCode()).append("',");
      debugBuffer.append("'").append(lwWholeSaleSummaryDto.getStatMonth()).append("',");
      debugBuffer.append("'").append(lwWholeSaleSummaryDto.getPowerClass()).append("',");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getElectricQuantity()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getPointerQuantity()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getSanXiaFee()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getSurcharge()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getSumFee()).append(",");
      debugBuffer.append("'").append(lwWholeSaleSummaryDto.getValidStatus()).append("',");
      debugBuffer.append("'").append(lwWholeSaleSummaryDto.getFlag()).append("',");
      debugBuffer.append("'").append(lwWholeSaleSummaryDto.getRemark()).append("',");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getTransLoss()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getLineLoss()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getUnPointerQuantity()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getRateCode()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getAdjustRate()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getFarmUseScale()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getFarmUsePrice()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getFarmUseQuantity()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getFarmUseFee()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getProductScale()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getProductPrice()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getProductQuantity()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getProductFee()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getDenizenScale()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getDenizenPrice()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getDenizenQuantity()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getDenizenFee()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getUnDenizenScale()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getUnDenizenPrice()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getUnDenizenQuantity()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getUnDenizenFee()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getIndustryScale()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getIndustryPrice()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getIndustryQuantity()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getIndustryFee()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getBizScale()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getBizPrice()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getBizQuantity()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getBizFee()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getPowerRateFee()).append(",");
      debugBuffer.append("'").append(lwWholeSaleSummaryDto.getUpCompany()).append("',");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getPowerFee()).append(",");
      debugBuffer.append("'").append(lwWholeSaleSummaryDto.getInputDate()).append("',");
      debugBuffer.append("'").append(lwWholeSaleSummaryDto.getKv()).append("',");
      debugBuffer.append("'").append(lwWholeSaleSummaryDto.getWholesaletype()).append("',");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getWorkNum()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getUnWorkNum()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getOtherSurcharge()).append(",");
      debugBuffer.append("'").append(lwWholeSaleSummaryDto.getDifferenceQuantity()).append("',");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getUnTransLoss()).append(",");
      debugBuffer.append("").append(lwWholeSaleSummaryDto.getUnLineLoss()).append(")");
      logger.debug(debugBuffer.toString());
    }

    buffer.append(
        "VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
    dbManager.prepareStatement(buffer.toString());
    dbManager.setString(1, lwWholeSaleSummaryDto.getLineCode());
    dbManager.setString(2, lwWholeSaleSummaryDto.getStatMonth());
    dbManager.setString(3, lwWholeSaleSummaryDto.getPowerClass());
    dbManager.setDouble(4, lwWholeSaleSummaryDto.getElectricQuantity());
    dbManager.setDouble(5, lwWholeSaleSummaryDto.getPointerQuantity());
    dbManager.setDouble(6, lwWholeSaleSummaryDto.getSanXiaFee());
    dbManager.setDouble(7, lwWholeSaleSummaryDto.getSurcharge());
    dbManager.setDouble(8, lwWholeSaleSummaryDto.getSumFee());
    dbManager.setString(9, lwWholeSaleSummaryDto.getValidStatus());
    dbManager.setString(10, lwWholeSaleSummaryDto.getFlag());
    dbManager.setString(11, lwWholeSaleSummaryDto.getRemark());
    dbManager.setDouble(12, lwWholeSaleSummaryDto.getTransLoss());
    dbManager.setDouble(13, lwWholeSaleSummaryDto.getLineLoss());
    dbManager.setDouble(14, lwWholeSaleSummaryDto.getUnPointerQuantity());
    dbManager.setDouble(15, lwWholeSaleSummaryDto.getRateCode());
    dbManager.setDouble(16, lwWholeSaleSummaryDto.getAdjustRate());
    dbManager.setDouble(17, lwWholeSaleSummaryDto.getFarmUseScale());
    dbManager.setDouble(18, lwWholeSaleSummaryDto.getFarmUsePrice());
    dbManager.setDouble(19, lwWholeSaleSummaryDto.getFarmUseQuantity());
    dbManager.setDouble(20, lwWholeSaleSummaryDto.getFarmUseFee());
    dbManager.setDouble(21, lwWholeSaleSummaryDto.getProductScale());
    dbManager.setDouble(22, lwWholeSaleSummaryDto.getProductPrice());
    dbManager.setDouble(23, lwWholeSaleSummaryDto.getProductQuantity());
    dbManager.setDouble(24, lwWholeSaleSummaryDto.getProductFee());
    dbManager.setDouble(25, lwWholeSaleSummaryDto.getDenizenScale());
    dbManager.setDouble(26, lwWholeSaleSummaryDto.getDenizenPrice());
    dbManager.setDouble(27, lwWholeSaleSummaryDto.getDenizenQuantity());
    dbManager.setDouble(28, lwWholeSaleSummaryDto.getDenizenFee());
    dbManager.setDouble(29, lwWholeSaleSummaryDto.getUnDenizenScale());
    dbManager.setDouble(30, lwWholeSaleSummaryDto.getUnDenizenPrice());
    dbManager.setDouble(31, lwWholeSaleSummaryDto.getUnDenizenQuantity());
    dbManager.setDouble(32, lwWholeSaleSummaryDto.getUnDenizenFee());
    dbManager.setDouble(33, lwWholeSaleSummaryDto.getIndustryScale());
    dbManager.setDouble(34, lwWholeSaleSummaryDto.getIndustryPrice());
    dbManager.setDouble(35, lwWholeSaleSummaryDto.getIndustryQuantity());
    dbManager.setDouble(36, lwWholeSaleSummaryDto.getIndustryFee());
    dbManager.setDouble(37, lwWholeSaleSummaryDto.getBizScale());
    dbManager.setDouble(38, lwWholeSaleSummaryDto.getBizPrice());
    dbManager.setDouble(39, lwWholeSaleSummaryDto.getBizQuantity());
    dbManager.setDouble(40, lwWholeSaleSummaryDto.getBizFee());
    dbManager.setDouble(41, lwWholeSaleSummaryDto.getPowerRateFee());
    dbManager.setString(42, lwWholeSaleSummaryDto.getUpCompany());
    dbManager.setDouble(43, lwWholeSaleSummaryDto.getPowerFee());
    dbManager.setString(44, lwWholeSaleSummaryDto.getInputDate());
    dbManager.setString(45, lwWholeSaleSummaryDto.getKv());
    dbManager.setString(46, lwWholeSaleSummaryDto.getWholesaletype());
    dbManager.setDouble(47, lwWholeSaleSummaryDto.getWorkNum());
    dbManager.setDouble(48, lwWholeSaleSummaryDto.getUnWorkNum());
    dbManager.setDouble(49, lwWholeSaleSummaryDto.getOtherSurcharge());
    dbManager.setString(50, lwWholeSaleSummaryDto.getDifferenceQuantity());
    dbManager.setDouble(51, lwWholeSaleSummaryDto.getUnTransLoss());
    dbManager.setDouble(52, lwWholeSaleSummaryDto.getUnLineLoss());
    dbManager.executePreparedUpdate();
  }
  /**
   * 按主键更新一条数据(主键本身无法变更)
   *
   * @param lwWholeSaleSummaryDto lwWholeSaleSummaryDto
   * @throws Exception
   */
  public void update(LwWholeSaleSummaryDto lwWholeSaleSummaryDto) throws Exception {
    StringBuffer buffer = new StringBuffer(200);
    buffer.append("UPDATE LwWholeSaleSummary SET ");
    buffer.append("PowerClass = ?, ");
    buffer.append("ElectricQuantity = ?, ");
    buffer.append("PointerQuantity = ?, ");
    buffer.append("SanXiaFee = ?, ");
    buffer.append("Surcharge = ?, ");
    buffer.append("SumFee = ?, ");
    buffer.append("ValidStatus = ?, ");
    buffer.append("Flag = ?, ");
    buffer.append("Remark = ?, ");
    buffer.append("TransLoss = ?, ");
    buffer.append("LineLoss = ?, ");
    buffer.append("UnPointerQuantity = ?, ");
    buffer.append("RateCode = ?, ");
    buffer.append("AdjustRate = ?, ");
    buffer.append("FarmUseScale = ?, ");
    buffer.append("FarmUsePrice = ?, ");
    buffer.append("FarmUseQuantity = ?, ");
    buffer.append("FarmUseFee = ?, ");
    buffer.append("ProductScale = ?, ");
    buffer.append("ProductPrice = ?, ");
    buffer.append("ProductQuantity = ?, ");
    buffer.append("ProductFee = ?, ");
    buffer.append("DenizenScale = ?, ");
    buffer.append("DenizenPrice = ?, ");
    buffer.append("DenizenQuantity = ?, ");
    buffer.append("DenizenFee = ?, ");
    buffer.append("UnDenizenScale = ?, ");
    buffer.append("UnDenizenPrice = ?, ");
    buffer.append("UnDenizenQuantity = ?, ");
    buffer.append("UnDenizenFee = ?, ");
    buffer.append("IndustryScale = ?, ");
    buffer.append("IndustryPrice = ?, ");
    buffer.append("IndustryQuantity = ?, ");
    buffer.append("IndustryFee = ?, ");
    buffer.append("BizScale = ?, ");
    buffer.append("BizPrice = ?, ");
    buffer.append("BizQuantity = ?, ");
    buffer.append("BizFee = ?, ");
    buffer.append("PowerRateFee = ?, ");
    buffer.append("UpCompany = ?, ");
    buffer.append("PowerFee = ?, ");
    buffer.append("InputDate = ?, ");
    buffer.append("Kv = ?, ");
    buffer.append("Wholesaletype = ?, ");
    buffer.append("WorkNum = ?, ");
    buffer.append("UnWorkNum = ?, ");
    buffer.append("OtherSurcharge = ?, ");
    buffer.append("DifferenceQuantity = ?, ");
    buffer.append("UnTransLoss = ?, ");
    buffer.append("UnLineLoss = ? ");
    if (logger.isDebugEnabled()) {
      StringBuffer debugBuffer = new StringBuffer(buffer.length() * 4);
      debugBuffer.append("UPDATE LwWholeSaleSummary SET ");
      debugBuffer.append("PowerClass = '" + lwWholeSaleSummaryDto.getPowerClass() + "', ");
      debugBuffer.append(
          "ElectricQuantity = " + lwWholeSaleSummaryDto.getElectricQuantity() + ", ");
      debugBuffer.append("PointerQuantity = " + lwWholeSaleSummaryDto.getPointerQuantity() + ", ");
      debugBuffer.append("SanXiaFee = " + lwWholeSaleSummaryDto.getSanXiaFee() + ", ");
      debugBuffer.append("Surcharge = " + lwWholeSaleSummaryDto.getSurcharge() + ", ");
      debugBuffer.append("SumFee = " + lwWholeSaleSummaryDto.getSumFee() + ", ");
      debugBuffer.append("ValidStatus = '" + lwWholeSaleSummaryDto.getValidStatus() + "', ");
      debugBuffer.append("Flag = '" + lwWholeSaleSummaryDto.getFlag() + "', ");
      debugBuffer.append("Remark = '" + lwWholeSaleSummaryDto.getRemark() + "', ");
      debugBuffer.append("TransLoss = " + lwWholeSaleSummaryDto.getTransLoss() + ", ");
      debugBuffer.append("LineLoss = " + lwWholeSaleSummaryDto.getLineLoss() + ", ");
      debugBuffer.append(
          "UnPointerQuantity = " + lwWholeSaleSummaryDto.getUnPointerQuantity() + ", ");
      debugBuffer.append("RateCode = " + lwWholeSaleSummaryDto.getRateCode() + ", ");
      debugBuffer.append("AdjustRate = " + lwWholeSaleSummaryDto.getAdjustRate() + ", ");
      debugBuffer.append("FarmUseScale = " + lwWholeSaleSummaryDto.getFarmUseScale() + ", ");
      debugBuffer.append("FarmUsePrice = " + lwWholeSaleSummaryDto.getFarmUsePrice() + ", ");
      debugBuffer.append("FarmUseQuantity = " + lwWholeSaleSummaryDto.getFarmUseQuantity() + ", ");
      debugBuffer.append("FarmUseFee = " + lwWholeSaleSummaryDto.getFarmUseFee() + ", ");
      debugBuffer.append("ProductScale = " + lwWholeSaleSummaryDto.getProductScale() + ", ");
      debugBuffer.append("ProductPrice = " + lwWholeSaleSummaryDto.getProductPrice() + ", ");
      debugBuffer.append("ProductQuantity = " + lwWholeSaleSummaryDto.getProductQuantity() + ", ");
      debugBuffer.append("ProductFee = " + lwWholeSaleSummaryDto.getProductFee() + ", ");
      debugBuffer.append("DenizenScale = " + lwWholeSaleSummaryDto.getDenizenScale() + ", ");
      debugBuffer.append("DenizenPrice = " + lwWholeSaleSummaryDto.getDenizenPrice() + ", ");
      debugBuffer.append("DenizenQuantity = " + lwWholeSaleSummaryDto.getDenizenQuantity() + ", ");
      debugBuffer.append("DenizenFee = " + lwWholeSaleSummaryDto.getDenizenFee() + ", ");
      debugBuffer.append("UnDenizenScale = " + lwWholeSaleSummaryDto.getUnDenizenScale() + ", ");
      debugBuffer.append("UnDenizenPrice = " + lwWholeSaleSummaryDto.getUnDenizenPrice() + ", ");
      debugBuffer.append(
          "UnDenizenQuantity = " + lwWholeSaleSummaryDto.getUnDenizenQuantity() + ", ");
      debugBuffer.append("UnDenizenFee = " + lwWholeSaleSummaryDto.getUnDenizenFee() + ", ");
      debugBuffer.append("IndustryScale = " + lwWholeSaleSummaryDto.getIndustryScale() + ", ");
      debugBuffer.append("IndustryPrice = " + lwWholeSaleSummaryDto.getIndustryPrice() + ", ");
      debugBuffer.append(
          "IndustryQuantity = " + lwWholeSaleSummaryDto.getIndustryQuantity() + ", ");
      debugBuffer.append("IndustryFee = " + lwWholeSaleSummaryDto.getIndustryFee() + ", ");
      debugBuffer.append("BizScale = " + lwWholeSaleSummaryDto.getBizScale() + ", ");
      debugBuffer.append("BizPrice = " + lwWholeSaleSummaryDto.getBizPrice() + ", ");
      debugBuffer.append("BizQuantity = " + lwWholeSaleSummaryDto.getBizQuantity() + ", ");
      debugBuffer.append("BizFee = " + lwWholeSaleSummaryDto.getBizFee() + ", ");
      debugBuffer.append("PowerRateFee = " + lwWholeSaleSummaryDto.getPowerRateFee() + ", ");
      debugBuffer.append("UpCompany = '" + lwWholeSaleSummaryDto.getUpCompany() + "', ");
      debugBuffer.append("PowerFee = " + lwWholeSaleSummaryDto.getPowerFee() + ", ");
      debugBuffer.append("InputDate = '" + lwWholeSaleSummaryDto.getInputDate() + "', ");
      debugBuffer.append("Kv = '" + lwWholeSaleSummaryDto.getKv() + "', ");
      debugBuffer.append("Wholesaletype = '" + lwWholeSaleSummaryDto.getWholesaletype() + "', ");
      debugBuffer.append("WorkNum = " + lwWholeSaleSummaryDto.getWorkNum() + ", ");
      debugBuffer.append("UnWorkNum = " + lwWholeSaleSummaryDto.getUnWorkNum() + ", ");
      debugBuffer.append("OtherSurcharge = " + lwWholeSaleSummaryDto.getOtherSurcharge() + ", ");
      debugBuffer.append(
          "DifferenceQuantity = '" + lwWholeSaleSummaryDto.getDifferenceQuantity() + "', ");
      debugBuffer.append("UnTransLoss = " + lwWholeSaleSummaryDto.getUnTransLoss() + ", ");
      debugBuffer.append("UnLineLoss = " + lwWholeSaleSummaryDto.getUnLineLoss() + " ");
      debugBuffer.append("WHERE ");
      debugBuffer
          .append("LineCode=")
          .append("'")
          .append(lwWholeSaleSummaryDto.getLineCode())
          .append("' AND ");
      debugBuffer
          .append("StatMonth=")
          .append("'")
          .append(lwWholeSaleSummaryDto.getStatMonth())
          .append("'");
      logger.debug(debugBuffer.toString());
    }

    buffer.append("WHERE ");
    buffer.append("LineCode = ? And ");
    buffer.append("StatMonth = ?");

    dbManager.prepareStatement(buffer.toString());
    // 设置更新字段;
    dbManager.setString(1, lwWholeSaleSummaryDto.getPowerClass());
    dbManager.setDouble(2, lwWholeSaleSummaryDto.getElectricQuantity());
    dbManager.setDouble(3, lwWholeSaleSummaryDto.getPointerQuantity());
    dbManager.setDouble(4, lwWholeSaleSummaryDto.getSanXiaFee());
    dbManager.setDouble(5, lwWholeSaleSummaryDto.getSurcharge());
    dbManager.setDouble(6, lwWholeSaleSummaryDto.getSumFee());
    dbManager.setString(7, lwWholeSaleSummaryDto.getValidStatus());
    dbManager.setString(8, lwWholeSaleSummaryDto.getFlag());
    dbManager.setString(9, lwWholeSaleSummaryDto.getRemark());
    dbManager.setDouble(10, lwWholeSaleSummaryDto.getTransLoss());
    dbManager.setDouble(11, lwWholeSaleSummaryDto.getLineLoss());
    dbManager.setDouble(12, lwWholeSaleSummaryDto.getUnPointerQuantity());
    dbManager.setDouble(13, lwWholeSaleSummaryDto.getRateCode());
    dbManager.setDouble(14, lwWholeSaleSummaryDto.getAdjustRate());
    dbManager.setDouble(15, lwWholeSaleSummaryDto.getFarmUseScale());
    dbManager.setDouble(16, lwWholeSaleSummaryDto.getFarmUsePrice());
    dbManager.setDouble(17, lwWholeSaleSummaryDto.getFarmUseQuantity());
    dbManager.setDouble(18, lwWholeSaleSummaryDto.getFarmUseFee());
    dbManager.setDouble(19, lwWholeSaleSummaryDto.getProductScale());
    dbManager.setDouble(20, lwWholeSaleSummaryDto.getProductPrice());
    dbManager.setDouble(21, lwWholeSaleSummaryDto.getProductQuantity());
    dbManager.setDouble(22, lwWholeSaleSummaryDto.getProductFee());
    dbManager.setDouble(23, lwWholeSaleSummaryDto.getDenizenScale());
    dbManager.setDouble(24, lwWholeSaleSummaryDto.getDenizenPrice());
    dbManager.setDouble(25, lwWholeSaleSummaryDto.getDenizenQuantity());
    dbManager.setDouble(26, lwWholeSaleSummaryDto.getDenizenFee());
    dbManager.setDouble(27, lwWholeSaleSummaryDto.getUnDenizenScale());
    dbManager.setDouble(28, lwWholeSaleSummaryDto.getUnDenizenPrice());
    dbManager.setDouble(29, lwWholeSaleSummaryDto.getUnDenizenQuantity());
    dbManager.setDouble(30, lwWholeSaleSummaryDto.getUnDenizenFee());
    dbManager.setDouble(31, lwWholeSaleSummaryDto.getIndustryScale());
    dbManager.setDouble(32, lwWholeSaleSummaryDto.getIndustryPrice());
    dbManager.setDouble(33, lwWholeSaleSummaryDto.getIndustryQuantity());
    dbManager.setDouble(34, lwWholeSaleSummaryDto.getIndustryFee());
    dbManager.setDouble(35, lwWholeSaleSummaryDto.getBizScale());
    dbManager.setDouble(36, lwWholeSaleSummaryDto.getBizPrice());
    dbManager.setDouble(37, lwWholeSaleSummaryDto.getBizQuantity());
    dbManager.setDouble(38, lwWholeSaleSummaryDto.getBizFee());
    dbManager.setDouble(39, lwWholeSaleSummaryDto.getPowerRateFee());
    dbManager.setString(40, lwWholeSaleSummaryDto.getUpCompany());
    dbManager.setDouble(41, lwWholeSaleSummaryDto.getPowerFee());
    dbManager.setString(42, lwWholeSaleSummaryDto.getInputDate());
    dbManager.setString(43, lwWholeSaleSummaryDto.getKv());
    dbManager.setString(44, lwWholeSaleSummaryDto.getWholesaletype());
    dbManager.setDouble(45, lwWholeSaleSummaryDto.getWorkNum());
    dbManager.setDouble(46, lwWholeSaleSummaryDto.getUnWorkNum());
    dbManager.setDouble(47, lwWholeSaleSummaryDto.getOtherSurcharge());
    dbManager.setString(48, lwWholeSaleSummaryDto.getDifferenceQuantity());
    dbManager.setDouble(49, lwWholeSaleSummaryDto.getUnTransLoss());
    dbManager.setDouble(50, lwWholeSaleSummaryDto.getUnLineLoss());
    // 设置条件字段;
    dbManager.setString(51, lwWholeSaleSummaryDto.getLineCode());
    dbManager.setString(52, lwWholeSaleSummaryDto.getStatMonth());
    dbManager.executePreparedUpdate();
  }
  public ActionForward execute(
      ActionMapping actionMapping,
      ActionForm actionForm,
      HttpServletRequest httpServletRequest,
      HttpServletResponse httpServletResponse)
      throws Exception {
    String inputDate = httpServletRequest.getParameter("inputDate");
    httpServletRequest.setAttribute("inputDate", inputDate);
    String statmonth = inputDate.substring(0, 7);
    double sumffee = 0;
    double sumfpower = 0;
    double sumfdianfee = 0;
    double sumftax = 0;
    double sumfc = 0;
    double summfdianjinall = 0;
    double summfdianjin = 0;
    double sumfdianjintax = 0;
    double sumfsanxiaall = 0;
    double sumfsanxia = 0;
    double sumfsanxiatax = 0;
    double sumfjijinall = 0;
    double sumfjijin = 0;
    double sumfjijintax = 0;
    double sumallffee = 0;

    double sumwfee = 0;
    double sumwpower = 0;
    double sumwdianfee = 0;
    double sumwtax = 0;
    double sumwc = 0;
    double summwdianjinall = 0;
    double summwdianjin = 0;
    double sumwdianjintax = 0;
    double sumwsanxiaall = 0;
    double sumwsanxia = 0;
    double sumwsanxiatax = 0;
    double sumwjijinall = 0;
    double sumwjijin = 0;
    double sumwjijintax = 0;
    double pepolepowergd = 0;
    double notpepolepowergd = 0;
    double bizpowergd = 0;
    double productpowergd = 0;
    double industrypowergd = 0;
    double farmpowergd = 0;
    double pepolepowerjt = 0;
    double notpepolepowerjt = 0;
    double bizpowerjt = 0;
    double productpowerjt = 0;
    double industrypowerjt = 0;
    double farmpowerjt = 0;
    double sumallwfee = 0;

    double sumallfee = 0;
    double sumallpower = 0;
    double sumallc = 0;
    double sumalltax = 0;
    double sumallall = 0;
    double sumalldianjin = 0;
    double sumalldianjintax = 0;
    double sumallsanxia = 0;
    double sumallsanxiatax = 0;
    double sumalljijin = 0;
    double sumalljijintax = 0;

    DecimalFormat df = new DecimalFormat("###0.00");
    String conditions = " 1=1 and statmonth ='" + statmonth + "'";
    String conditionwgd =
        " 1=1 and statmonth ='" + statmonth + "' and upcompany='gy' or upcompany='dm'";
    String conditionwtj =
        " 1=1 and statmonth ='" + statmonth + "' and upcompany='ty' or upcompany='jy'";
    BLLwCorporationSummaryFacade blLwCorporationSummaryFacade = new BLLwCorporationSummaryFacade();
    Collection colf = blLwCorporationSummaryFacade.findByConditions(conditions);
    LwCorporationSummaryDto lwCorporationSummaryDto = new LwCorporationSummaryDto();
    Iterator itf = colf.iterator();
    while (itf.hasNext()) {
      lwCorporationSummaryDto = (LwCorporationSummaryDto) itf.next();
      sumfpower +=
          lwCorporationSummaryDto.getSumPointerQuantity()
              + lwCorporationSummaryDto.getBeforPower()
              + lwCorporationSummaryDto.getLastPower();
      sumfdianfee +=
          lwCorporationSummaryDto.getPointerFee() + lwCorporationSummaryDto.getPowerRateFee();
      summfdianjinall += lwCorporationSummaryDto.getSurcharge();
      sumfsanxiaall += lwCorporationSummaryDto.getPowerFee();
      sumfjijinall += lwCorporationSummaryDto.getSurcharge();
    }
    BLLwWholeSaleSummaryFacade blLwWholeSaleSummaryFacade = new BLLwWholeSaleSummaryFacade();
    Collection colwgd = blLwWholeSaleSummaryFacade.findByConditions(conditionwgd);
    LwWholeSaleSummaryDto lwWholeSaleSummaryDtogd = new LwWholeSaleSummaryDto();
    Iterator itwgd = colwgd.iterator();
    while (itwgd.hasNext()) {
      lwWholeSaleSummaryDtogd = (LwWholeSaleSummaryDto) itwgd.next();

      pepolepowergd += lwWholeSaleSummaryDtogd.getDenizenQuantity();
      notpepolepowergd += lwWholeSaleSummaryDtogd.getUnDenizenQuantity();
      bizpowergd += lwWholeSaleSummaryDtogd.getBizQuantity();
      productpowergd += lwWholeSaleSummaryDtogd.getProductQuantity();
      if (lwWholeSaleSummaryDtogd.getWholesaletype().equals("0")) {
        industrypowergd += lwWholeSaleSummaryDtogd.getIndustryQuantity();
      }
      if (lwWholeSaleSummaryDtogd.getWholesaletype().equals("1")) {
        industrypowergd += lwWholeSaleSummaryDtogd.getElectricQuantity();
      }
      farmpowergd += lwWholeSaleSummaryDtogd.getFarmUseQuantity();
      sumwpower += lwWholeSaleSummaryDtogd.getElectricQuantity();
      sumwdianfee += lwWholeSaleSummaryDtogd.getSumFee();
    }

    Collection colwtj = blLwWholeSaleSummaryFacade.findByConditions(conditionwtj);
    LwWholeSaleSummaryDto lwWholeSaleSummaryDtotj = new LwWholeSaleSummaryDto();
    Iterator itwtj = colwtj.iterator();
    while (itwtj.hasNext()) {
      lwWholeSaleSummaryDtotj = (LwWholeSaleSummaryDto) itwtj.next();

      pepolepowerjt += lwWholeSaleSummaryDtotj.getDenizenQuantity();
      notpepolepowerjt += lwWholeSaleSummaryDtotj.getUnDenizenQuantity();
      bizpowerjt += lwWholeSaleSummaryDtotj.getBizQuantity();
      productpowerjt += lwWholeSaleSummaryDtotj.getProductQuantity();
      if (lwWholeSaleSummaryDtotj.getWholesaletype().equals("0")) {
        industrypowerjt += lwWholeSaleSummaryDtotj.getIndustryQuantity();
      }
      if (lwWholeSaleSummaryDtotj.getWholesaletype().equals("1")) {
        industrypowerjt += lwWholeSaleSummaryDtotj.getElectricQuantity();
      }
      farmpowerjt += lwWholeSaleSummaryDtotj.getFarmUseQuantity();
      sumwpower += lwWholeSaleSummaryDtotj.getElectricQuantity();
      sumwdianfee += lwWholeSaleSummaryDtotj.getSumFee();
    }
    sumwsanxiaall =
        (pepolepowergd
                + notpepolepowergd
                + bizpowergd
                + productpowergd
                + industrypowergd
                + pepolepowerjt
                + notpepolepowerjt
                + bizpowerjt
                + productpowerjt
                + industrypowerjt
                + farmpowerjt)
            * 0.004
            * 0.88;
    summwdianjinall =
        (pepolepowerjt
                + notpepolepowerjt
                + bizpowerjt
                + productpowerjt
                + industrypowerjt
                + pepolepowergd
                + notpepolepowergd
                + bizpowergd
                + productpowergd
                + industrypowergd)
            * 0.02
            * 0.88;
    sumwjijinall =
        (pepolepowerjt + pepolepowergd) * 0.001 * 0.88
            + (notpepolepowerjt
                    + bizpowerjt
                    + industrypowerjt
                    + notpepolepowergd
                    + bizpowergd
                    + industrypowergd)
                * 0.002
                * 0.88
            + (pepolepowerjt
                    + notpepolepowerjt
                    + bizpowerjt
                    + industrypowerjt
                    + pepolepowergd
                    + notpepolepowergd
                    + bizpowergd
                    + industrypowergd)
                * 0.0031
                * 0.88;
    sumwc = sumwdianfee / 1.17;
    sumwtax = sumwdianfee / 1.17 * 0.17;
    sumwdianjintax = summwdianjinall / 1.17 * 0.17;
    sumwsanxiatax = sumwsanxiaall / 1.17 * 0.17;
    sumwjijintax = sumwjijinall / 1.17 * 0.17;

    summwdianjin = summwdianjinall / 1.17;
    sumwsanxia = sumwsanxiaall / 1.17;
    sumwjijin = sumwjijinall / 1.17;
    sumfc = sumfdianfee / 1.17;
    sumftax = sumfdianfee / 1.17 * 0.17;
    sumfdianjintax = summfdianjinall / 1.17 * 0.17;
    sumfsanxiatax = sumfsanxiaall / 1.17 * 0.17;
    sumfjijintax = sumfjijinall / 1.17 * 0.17;

    summfdianjin = summfdianjinall / 1.17;
    sumfsanxia = sumfsanxiaall / 1.17;
    sumfjijin = sumfjijinall / 1.17;
    sumffee = sumfdianfee + summfdianjinall + sumfsanxiaall + sumfjijinall;
    sumwfee = sumwdianfee + summwdianjinall + sumwsanxiaall + sumwjijinall;
    sumallfee = sumfdianfee + sumwdianfee;
    sumallpower = sumfpower + sumwpower;
    sumallc = sumwc + sumfc;
    sumalltax = sumwtax + sumftax;
    sumallall = sumwfee + sumffee;
    sumalldianjin = summwdianjin + summfdianjin;
    sumalldianjintax = sumwdianjintax + sumfdianjintax;
    sumallsanxia = sumwsanxia + sumfsanxia;
    sumallsanxiatax = sumwsanxiatax + sumfsanxiatax;
    sumalljijin = sumwjijin + sumfjijin;
    sumalljijintax = sumwjijintax + sumfjijintax;

    httpServletRequest.setAttribute("sumffee", df.format(sumffee));
    httpServletRequest.setAttribute("sumfpower", Math.round(sumfpower));
    httpServletRequest.setAttribute("sumfdianfee", df.format(sumfdianfee));
    httpServletRequest.setAttribute("sumftax", df.format(sumftax));
    httpServletRequest.setAttribute("sumfc", df.format(sumfc));
    httpServletRequest.setAttribute("summfdianjin", df.format(summfdianjin));
    httpServletRequest.setAttribute("sumfdianjintax", df.format(sumfdianjintax));
    httpServletRequest.setAttribute("sumfsanxia", df.format(sumfsanxia));
    httpServletRequest.setAttribute("sumfsanxiatax", df.format(sumfsanxiatax));
    httpServletRequest.setAttribute("sumfjijin", df.format(sumfjijin));
    httpServletRequest.setAttribute("sumfjijintax", df.format(sumfjijintax));
    httpServletRequest.setAttribute("sumwfee", df.format(sumwfee));
    httpServletRequest.setAttribute("sumwpower", Math.round(sumwpower));
    httpServletRequest.setAttribute("sumwdianfee", df.format(sumwdianfee));
    httpServletRequest.setAttribute("sumwtax", df.format(sumwtax));
    httpServletRequest.setAttribute("sumwc", df.format(sumwc));
    httpServletRequest.setAttribute("summwdianjin", df.format(summwdianjin));
    httpServletRequest.setAttribute("sumwdianjintax", df.format(sumwdianjintax));

    httpServletRequest.setAttribute("sumwsanxia", df.format(sumwsanxia));
    httpServletRequest.setAttribute("sumwsanxiatax", df.format(sumwsanxiatax));
    httpServletRequest.setAttribute("sumwjijin", df.format(sumwjijin));
    httpServletRequest.setAttribute("sumwjijintax", df.format(sumwjijintax));
    httpServletRequest.setAttribute("sumallfee", df.format(sumallfee));
    httpServletRequest.setAttribute("sumallpower", Math.round(sumallpower));
    httpServletRequest.setAttribute("sumallc", df.format(sumallc));
    httpServletRequest.setAttribute("sumalltax", df.format(sumalltax));
    httpServletRequest.setAttribute("sumallall", df.format(sumallall));
    httpServletRequest.setAttribute("sumalldianjin", df.format(sumalldianjin));
    httpServletRequest.setAttribute("sumalldianjintax", df.format(sumalldianjintax));
    httpServletRequest.setAttribute("sumallsanxia", df.format(sumallsanxia));
    httpServletRequest.setAttribute("sumallsanxiatax", df.format(sumallsanxiatax));
    httpServletRequest.setAttribute("sumalljijin", df.format(sumalljijin));
    httpServletRequest.setAttribute("sumalljijintax", df.format(sumalljijintax));
    return actionMapping.findForward("viewallcount");
  }