create view vi_mail_address as (
SELECT CP.ID                                                                                                         AS ID,
       CP.CUSTOMERID                                                                                                 AS CUSTOMERID,
       CP.FULLNAME                                                                                                   AS FULLNAME,
       (CASE CP.MAILING_ADDRESS WHEN '单位地址' THEN CP.WORKADD WHEN '居住地址' THEN CA.FULLADDRESS ELSE CP.NATIVEPLACE END) AS MAILING_ADDRESS
FROM (APZL.CUSTOMER_PERSON CP
LEFT JOIN APZL.CUSTOMER_ADDRESS CA ON ((CA.CUSTOMERID = convert(CP.CUSTOMERID USING UTF8)))));

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

-- comment on column vi_mail_address.customerid not supported: 客户编号

-- comment on column vi_mail_address.fullname not supported: 姓名

