create view vi_business_approval as SELECT LUNT.FLOWUNID                              AS FLOWUNID,
       ifnull(CPT.FULLNAME, CPT1.ENTERPRISENAME)  AS FULLNAME,
       CPT.SEX                                    AS SEX,
       ifnull(CPT.CERTTYPE, CPT1.CERTTYPE)        AS CERTTYPE,
       ifnull(CPT.CERTID, CPT1.CERTID)            AS CERTID,
       ifnull(CPT.WORKCORP, CPT1.COMPANY_NAME)    AS WORKCORP,
       ifnull(CPT.WORKADD, CPT1.REG_ADDRESS)      AS WORKADD,
       ifnull(CPT.ENTRYTIME, CPT1.ESTABLISH_DATE) AS ENTRYTIME,
       CPT.FORMALEMP                              AS FORMALEMP,
       LPIT.PRODUCT_NAME                          AS PRODUCTNAME,
       LPIT.PROJECT_NO                            AS PROJECT_NO,
       LPIT.CAR_TYPE                              AS CAR_TYPE,
       LPIT.LEAS_FORM                             AS LEAS_FORM,
       LCCT.CLEAN_LEASE_MONEY                     AS CLEANLEASEMONEY,
       LCCT.LEASE_TERM                            AS LEASETERM,
       LCCT.INCOME_NUMBER_YEAR                    AS INCOMENUMBERYEAR,
       FO1.PHASECHOICE                            AS FIRSTCHOICE,
       FO1.PHASEOPINION                           AS FIRSTOPINION,
       FO1.INTEROPINION1                          AS INTEROPINION1,
       FO1.DISTRIOPINION1                         AS DISTRIOPINION1,
       FO2.PHASECHOICE                            AS SECONDCHOICE,
       FO2.PHASEOPINION                           AS SECONDOPINION,
       FO2.INTEROPINION2                          AS INTEROPINION2,
       FO2.DISTRIOPINION2                         AS DISTRIOPINION2,
       FO3.PHASECHOICE                            AS THIRDCHOICE,
       FO3.PHASEOPINION                           AS THIRDOPINION,
       FO3.INTEROPINION3                          AS INTEROPINION3,
       FO3.DISTRIOPINION3                         AS DISTRIOPINION3,
       FO4.PHASECHOICE                            AS FOURCHOICE,
       FO4.PHASEOPINION                           AS FOUROPINION,
       FO4.INTEROPINION4                          AS INTEROPINION4,
       FO4.DISTRIOPINION4                         AS DISTRIOPINION4
FROM ((((((((((((APZL.LB_PROJECT_INFO_TEMP LPIT LEFT JOIN APZL.LB_UNION_LESSEE_TEMP LUNT ON ((LPIT.FLOWUNID = convert(LUNT.FLOWUNID USING UTF8)))) LEFT JOIN APZL.CUSTOMER_PERSON_TEMP CPT ON (((CPT.CUSTOMERID = LUNT.CUSTOMER_ID) AND (LUNT.FLOWUNID = CPT.FLOWUNID)))) LEFT JOIN APZL.CUSTOMER_COMPANY_TEMP CPT1 ON (((CPT1.CUSTOMERID = LUNT.CUSTOMER_ID) AND (LUNT.FLOWUNID = CPT1.FLOWUNID)))) LEFT JOIN APZL.LC_CALC_CONDITION_TEMP LCCT ON ((convert(LCCT.FLOWUNID USING UTF8) = LPIT.FLOWUNID))) LEFT JOIN APZL.FLOW_TASK FT1 ON ((
        (convert(FT1.OBJECTNO USING UTF8) = LPIT.FLOWUNID) AND (FT1.PHASENO = '0030') AND
        (FT1.RELATIVEOBJECTNO IS NOT NULL)))) LEFT JOIN APZL.FLOW_OPINION FO1 ON ((FT1.RELATIVEOBJECTNO = FO1.SERIALNO))) LEFT JOIN APZL.FLOW_TASK FT2 ON ((
        (convert(FT2.OBJECTNO USING UTF8) = LPIT.FLOWUNID) AND (FT2.PHASENO = '0040') AND
        (FT2.RELATIVEOBJECTNO IS NOT NULL)))) LEFT JOIN APZL.FLOW_OPINION FO2 ON ((FT2.RELATIVEOBJECTNO = FO2.SERIALNO))) LEFT JOIN APZL.FLOW_TASK FT3 ON ((
        (convert(FT3.OBJECTNO USING UTF8) = LPIT.FLOWUNID) AND (FT3.PHASENO = '0050') AND
        (FT3.RELATIVEOBJECTNO IS NOT NULL)))) LEFT JOIN APZL.FLOW_OPINION FO3 ON ((FT3.RELATIVEOBJECTNO = FO3.SERIALNO))) LEFT JOIN APZL.FLOW_TASK FT4 ON ((
        (convert(FT4.OBJECTNO USING UTF8) = LPIT.FLOWUNID) AND (FT4.PHASENO = '0020') AND (FT4.RELATIVEOBJECTNO IS NOT NULL))))
LEFT JOIN APZL.FLOW_OPINION FO4 ON ((FT4.RELATIVEOBJECTNO = FO4.SERIALNO)));

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

-- comment on column vi_business_approval.SEX not supported: 性别

-- comment on column vi_business_approval.FORMALEMP not supported: 正式员工

-- comment on column vi_business_approval.PRODUCTNAME not supported: 产品名称

-- comment on column vi_business_approval.PROJECT_NO not supported: 项目编号

-- comment on column vi_business_approval.LEAS_FORM not supported: 租赁形式

-- comment on column vi_business_approval.CLEANLEASEMONEY not supported: 融资额

-- comment on column vi_business_approval.LEASETERM not supported: 租赁期限

-- comment on column vi_business_approval.INCOMENUMBERYEAR not supported: 还款间隔

-- comment on column vi_business_approval.firstchoice not supported: 阶段意见

-- comment on column vi_business_approval.firstopinion not supported: 意见详情

-- comment on column vi_business_approval.InterOpinion1 not supported: 内部意见1

-- comment on column vi_business_approval.DistriOpinion1 not supported: 经销商意见1

-- comment on column vi_business_approval.secondchoice not supported: 阶段意见

-- comment on column vi_business_approval.secondopinion not supported: 意见详情

-- comment on column vi_business_approval.InterOpinion2 not supported: 内部意见2

-- comment on column vi_business_approval.DistriOpinion2 not supported: 经销商意见2

-- comment on column vi_business_approval.thirdchoice not supported: 阶段意见

-- comment on column vi_business_approval.thirdopinion not supported: 意见详情

-- comment on column vi_business_approval.InterOpinion3 not supported: 内部意见3

-- comment on column vi_business_approval.DistriOpinion3 not supported: 经销商意见3

-- comment on column vi_business_approval.fourchoice not supported: 阶段意见

-- comment on column vi_business_approval.fouropinion not supported: 意见详情

-- comment on column vi_business_approval.InterOpinion4 not supported: 内部意见4

-- comment on column vi_business_approval.DistriOpinion4 not supported: 经销商意见4

