create view vi_proj_cust as (
SELECT FLOW.FLOW_UNID AS FLOWUNID, (CASE WHEN isnull(LESSEE.ID) THEN LESSEE2.CUSTOMER_ID ELSE LESSEE.CUSTOMER_ID END) AS CUSTOMER_ID
FROM ((APZL.FLOW_BUSSINESS_OBJECT FLOW LEFT JOIN APZL.LB_UNION_LESSEE_TEMP LESSEE ON (((FLOW.FLOW_UNID = LESSEE.FLOWUNID) AND (LESSEE.IS_MAIN = 'Y'))))
LEFT JOIN APZL.LB_UNION_LESSEE LESSEE2 ON (((FLOW.PROJ_ID = LESSEE2.PROJECT_ID) AND (LESSEE2.IS_MAIN = 'Y')))));

-- comment on column vi_proj_cust.flowunid not supported: 流程编号

