create view vi_lc_fund_plan as SELECT LCF.ID                                                                                                                                     AS ID,
       LBC.CONTRACT_NUMBER                                                                                                                        AS CONTRACT_NUMBER,
       LBC.PROJECT_ID                                                                                                                             AS PROJECT_ID,
       LBC.ID                                                                                                                                     AS CONTRACT_ID,
       LBC.CONTRACT_STATUS                                                                                                                        AS CONTRACT_STATUS,
       LCF.PAYMENT_NUMBER                                                                                                                         AS PAYMENT_NUMBER,
       LBC.PROJECT_NAME                                                                                                                           AS PROJECT_NAME,
       ifnull(LBU.CUSTOMERNAME, '')                                                                                                               AS CUSTOMERNAME,
       LCF.PAY_TYPE                                                                                                                               AS PAY_TYPE,
       LCF.FEE_TYPE                                                                                                                               AS FEE_TYPE,
       LCF.PLAN_LIST                                                                                                                              AS PLAN_LIST,
       LCF.PLAN_DATE                                                                                                                              AS PLAN_DATE,
       LCF.PLAN_MONEY                                                                                                                             AS PLAN_MONEY,
       (ifnull(LCFD.FACT_MONEY, 0) + ifnull(LCFI.FACT_MONEY, 0))                                                                                  AS FACT_MONEY,
       (ifnull(LCFI.FEE_ADJUST, 0) + ifnull(LCFD.FEE_ADJUST, 0))                                                                                  AS FEE_ADJUST,
       (((ifnull(LCFD.FACT_MONEY, 0) + ifnull(LCFI.FACT_MONEY, 0)) + ifnull(LCFI.FEE_ADJUST, 0)) +
        ifnull(LCFD.FEE_ADJUST, 0))                                                                                                               AS ALLFACT_MONEY,
       (LCF.PLAN_MONEY - (((ifnull(LCFD.FACT_MONEY, 0) + ifnull(LCFI.FACT_MONEY, 0)) + ifnull(LCFI.FEE_ADJUST, 0)) +
                          ifnull(LCFD.FEE_ADJUST, 0)))                                                                                            AS OVERMONEY
FROM ((((APZL.LC_FUND_PLAN LCF LEFT JOIN APZL.LB_CONTRACT_INFO LBC ON ((LCF.CONTRACT_ID = convert(LBC.ID USING UTF8)))) LEFT JOIN APZL.LB_UNION_LESSEE_F_TRANSFER LBU ON ((LCF.CONTRACT_ID = convert(LBU.CONTRACT_ID USING UTF8)))) LEFT JOIN APZL.LC_FUND_INCOME_TRANSFER LCFD ON ((
        (LCF.PAYMENT_NUMBER = LCFD.PAYMENT_NUMBER) AND (LCF.PAY_TYPE = LCFD.PAY_TYPE) AND (LCF.FEE_TYPE = LCFD.FEE_TYPE) AND
        (LCF.PLAN_LIST = LCFD.PLAN_LIST))))
LEFT JOIN APZL.LC_FUND_INCOME_TEMP_TRANSFER LCFI
          ON (((LCF.PAYMENT_NUMBER = LCFI.PAYMENT_NUMBER) AND (LCF.PAY_TYPE = LCFI.PAY_TYPE) AND (LCF.FEE_TYPE = LCFI.FEE_TYPE) AND
               (LCF.PLAN_LIST = LCFI.PLAN_LIST))));

-- comment on column vi_lc_fund_plan.id not supported: 标识

-- comment on column vi_lc_fund_plan.contract_number not supported: 业务合同号

-- comment on column vi_lc_fund_plan.project_id not supported: 项目编号

-- comment on column vi_lc_fund_plan.contract_id not supported: 编号

-- comment on column vi_lc_fund_plan.contract_status not supported: 合同状态

-- comment on column vi_lc_fund_plan.payment_number not supported: 投放编号

-- comment on column vi_lc_fund_plan.project_name not supported: 项目名称

-- comment on column vi_lc_fund_plan.pay_type not supported: 收付类型

-- comment on column vi_lc_fund_plan.fee_type not supported: 费用类型

-- comment on column vi_lc_fund_plan.plan_list not supported: 期次

-- comment on column vi_lc_fund_plan.plan_date not supported: 计划日期

-- comment on column vi_lc_fund_plan.plan_money not supported: 计划金额

