package com.dst.slms.workBench.service.sql;

/**
 * @description  费控工作台的相关SQL语句类 TABLE
 * @date  20/05/04 9:47
 * @author  wanghb
 */

public class FeeControlSQL {
    //public final static String SQL_LIST_02   = "SELECT \"\" FROM TABLE l1 left join TABLE l2 on l1.fid = l2.FparentId  WHERE 1 = 1";

    //全盘费用预算
    public final static String SQL_LIST_01   = "SELECT SUM(l1.Fbudget) budget FROM yc_cost_CyclePaymentPlan l1 WHERE 1 = 1 ";
    //全盘已发生费用
    public final static String SQL_LIST_02   = "SELECT SUM(l1.FtaxConAmt) taxConAmt FROM yc_cost_saleContract l1 WHERE 1 = 1 ";
    //本年费用预算
    public final static String SQL_LIST_03   = "SELECT SUM(Famount) FROM yc_cost_ProjectYearBudget l1 left join yc_cost_ProjectYearBudgetE1 l2 on  l1.fid = l2.FparentId  WHERE 1 = 1  ";

    //销售进度
    public final static String SQL_LIST_04   = "SELECT FsalesProgress salesProgress FROM yc_cost_salesProgress l1 WHERE 1 = 1 ";

    //本年费用预算  echarts数据统计  SQL_LIST_02  和  SQL_LIST_03  SQL_LIST_04 的结合体
    public final static String SQL_ECHARTS_01   = "SELECT distinct l2.Famount amount,l5.fname name,l3.FtaxConAmt taxConAmt,l4.FsalesProgress salesProgress " +
            " FROM  yc_cost_ProjectYearBudget l1  " +
            " LEFT JOIN yc_cost_ProjectYearBudgetE1 l2 ON l1.fid = l2.FparentId  " +
            " LEFT JOIN yc_cost_saleContract l3 on l1.ForgID = l3.ForgunitID " +
            " LEFT JOIN yc_cost_salesProgress l4 on l1.ForgID = l4.ForgID " +
            " left join xr_sys_org l5 on  l1.ForgID = l5.fid   " +
            " WHERE   1 = 1  ";

    //全盘已发生费用 echarts数据统计
    public final static String SQL_ECHARTS_02   = "SELECT SUM(l1.FtaxConAmt) value,l2.fname name FROM yc_cost_saleContract l1 left join xr_sys_org l2 on  l1.FdutyDepID = l2.fid   WHERE 1 = 1 ";

}
