create view lc_fund_income_temp_hxm as SELECT DI.DISTRIBUTOR_NO   AS DISTRIBUTOR_NO,
       LC.FLOWUNID         AS FLOWUNID,
       DI.DISTRIBUTOR_NAME AS DISTRIBUTOR_NAME,
       DA.ACCOUNT          AS DA_NAME,
       DA.ACC_NUMBER       AS AD_NUMBER,
       DA.OPEN_BANK        AS DA_BANK,
       DA.PROVINCEINFO     AS PROVINCEINFO,
       DA.DISTRICT         AS DISTRICT,
       OA.ACC_BANK         AS ACC_BANK,
       OA.ACC_NAME         AS ACC_NAME,
       OA.ACC_NUMBER       AS ACC_NUMBER,
       LC.SMONEY           AS SMONEY,
       LC.SCOUNT           AS SCOUNT,
       CT.REQSTS           AS REQSTS,
       CT.RTNFLG           AS RTNFLG,
       CT.ERRTXT           AS ERRTXT,
       CT.RTNNAR           AS RTNNAR,
       LC.IS_FLOWING       AS IS_FLOWING,
       LC.PAYTYPE          AS PAYTYPE
FROM ((((APZL.DISTRIBUTOR_INFO DI JOIN APZL.DISTRIBUTOR_ACCOUNT DA ON (((DI.DISTRIBUTOR_NO = DA.DISTRIBUTOR_ID) AND (DA.IS_MAIN = 'Y')))) JOIN (
    SELECT APZL.OWN_ACCOUNT.ACC_BANK AS ACC_BANK, APZL.OWN_ACCOUNT.ACC_NAME AS ACC_NAME, APZL.OWN_ACCOUNT.ACC_NUMBER AS ACC_NUMBER
    FROM (APZL.OWN_ACCOUNT
    LEFT JOIN APZL.OWN_INFO OI ON ((APZL.OWN_ACCOUNT.OWN_ID = OI.OWN_NUMBER)))
    WHERE ((APZL.OWN_ACCOUNT.STATE_ = '0010') AND (OI.OWN_NAME = '安鹏国际融资租赁（深圳）有限公司') AND (APZL.OWN_ACCOUNT.ACC_TYPE = '0010') AND
           ((APZL.OWN_ACCOUNT.ACCOUNT_TYPE = 'out_account') OR (APZL.OWN_ACCOUNT.ACCOUNT_TYPE = 'inAndOut_account')) AND
           (APZL.OWN_ACCOUNT.FBSDK = 'Y') AND (APZL.OWN_ACCOUNT.MONEY_TYPE = '01'))
) OA) JOIN (
    SELECT LFIT.FLOWUNID           AS FLOWUNID,
           LCI.DISTRIBUTOR_ID      AS DISTRIBUTOR_ID,
           LFIT.IS_FLOWING         AS IS_FLOWING,
           PSL.PAYTYPE             AS PAYTYPE,
           sum(LFIT.FACT_MONEY)    AS SMONEY,
           count(LFIT.CONTRACT_ID) AS SCOUNT
    FROM ((APZL.LB_CONTRACT_INFO LCI LEFT JOIN APZL.PRD_SPECIFIC_LIBRARY PSL ON ((convert(LCI.PRODUCT_ID USING UTF8) = PSL.PRODUCTID)))
    JOIN APZL.LC_FUND_INCOME_TEMP LFIT
         ON (((LCI.ID = LFIT.CONTRACT_ID) AND (LFIT.PAY_TYPE = 'pay_type_out') AND (LFIT.PAY_STATUS = 'apply_pass') AND (LFIT.ROLL_BACK = '0'))))
    GROUP BY LCI.DISTRIBUTOR_ID, LFIT.FLOWUNID
) LC ON ((DI.DISTRIBUTOR_NO = LC.DISTRIBUTOR_ID)))
LEFT JOIN APZL.LC_FUND_INCOME_CALLBACK_DETAIL_TEMP CT ON (((LC.FLOWUNID = CT.FLOWUNID) AND (LC.DISTRIBUTOR_ID = CT.DISTRIBUTOR_ID))));

-- comment on column lc_fund_income_temp_hxm.distributor_no not supported: 经销商编码

-- comment on column lc_fund_income_temp_hxm.FLOWUNID not supported: 流程编号

-- comment on column lc_fund_income_temp_hxm.distributor_name not supported: 经销商名称

-- comment on column lc_fund_income_temp_hxm.da_name not supported: 账户名称

-- comment on column lc_fund_income_temp_hxm.ad_number not supported: 银行帐号

-- comment on column lc_fund_income_temp_hxm.da_bank not supported: 开户银行

-- comment on column lc_fund_income_temp_hxm.provinceInfo not supported: 省份

-- comment on column lc_fund_income_temp_hxm.district not supported: 地区

-- comment on column lc_fund_income_temp_hxm.acc_bank not supported: 本方银行

-- comment on column lc_fund_income_temp_hxm.acc_name not supported: 本方银行账户

-- comment on column lc_fund_income_temp_hxm.acc_number not supported: 本方账号

-- comment on column lc_fund_income_temp_hxm.REQSTS not supported: 业务请求状态

-- comment on column lc_fund_income_temp_hxm.RTNFLG not supported: 业务处理结果

-- comment on column lc_fund_income_temp_hxm.ERRTXT not supported: 错误文本

-- comment on column lc_fund_income_temp_hxm.RTNNAR not supported: 结果摘要

-- comment on column lc_fund_income_temp_hxm.IS_FLOWING not supported: 是否流程中

-- comment on column lc_fund_income_temp_hxm.payType not supported: 放款方式

