<![CDATA[select t1.* from (SELECT t1.`BUSINESSTYPECODE`, t1.`CUSTOMERID`, t1.`CUSTOMERNAME`, t1.`CUSTOMERTYPE` FROM (SELECT 'ACCOUNT' AS `CUSTOMERTYPE`,v1.`ACCOUNTID` AS `CUSTOMERID` ,v1.`ACCOUNTNAME` AS `CUSTOMERNAME` ,NULL AS `BUSINESSTYPECODE` FROM (SELECT t1.`ACCOUNTID`, t1.`ACCOUNTNAME` FROM `ACCOUNT` t1 ) v1 UNION ALL SELECT 'CONTACT' AS `CUSTOMERTYPE`,v2.`CONTACTID` AS `CUSTOMERID` ,v2.`FULLNAME` AS `CUSTOMERNAME` ,NULL AS `BUSINESSTYPECODE` FROM (SELECT t1.`CONTACTID`, t1.`FULLNAME` FROM `CONTACT` t1 ) v2 ) t1 ) t1 where customerid=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.`BUSINESSTYPECODE`, t1.`CUSTOMERID`, t1.`CUSTOMERNAME`, t1.`CUSTOMERTYPE` FROM (SELECT 'ACCOUNT' AS `CUSTOMERTYPE`,v1.`ACCOUNTID` AS `CUSTOMERID` ,v1.`ACCOUNTNAME` AS `CUSTOMERNAME` ,v1.`BUSINESSTYPECODE` AS `BUSINESSTYPECODE` FROM (SELECT t1.`ACCOUNTID`, t1.`ACCOUNTNAME`, t1.`BUSINESSTYPECODE` FROM `ACCOUNT` t1 ) v1 UNION ALL SELECT 'CONTACT' AS `CUSTOMERTYPE`,v2.`CONTACTID` AS `CUSTOMERID` ,v2.`FULLNAME` AS `CUSTOMERNAME` ,NULL AS `BUSINESSTYPECODE` FROM (SELECT t1.`CONTACTID`, t1.`FULLNAME` FROM `CONTACT` t1 ) v2 ) t1 ) t1 where customerid=#{id}]]>
<![CDATA[ SELECT t1.`BUSINESSTYPECODE`, t1.`CUSTOMERID`, t1.`CUSTOMERNAME`, t1.`CUSTOMERTYPE` FROM (SELECT 'ACCOUNT' AS `CUSTOMERTYPE`,v1.`ACCOUNTID` AS `CUSTOMERID` ,v1.`ACCOUNTNAME` AS `CUSTOMERNAME` ,NULL AS `BUSINESSTYPECODE` FROM (SELECT t1.`ACCOUNTID`, t1.`ACCOUNTNAME` FROM `ACCOUNT` t1 ) v1 UNION ALL SELECT 'CONTACT' AS `CUSTOMERTYPE`,v2.`CONTACTID` AS `CUSTOMERID` ,v2.`FULLNAME` AS `CUSTOMERNAME` ,NULL AS `BUSINESSTYPECODE` FROM (SELECT t1.`CONTACTID`, t1.`FULLNAME` FROM `CONTACT` t1 ) v2 ) t1
<![CDATA[ SELECT t1.`BUSINESSTYPECODE`, t1.`CUSTOMERID`, t1.`CUSTOMERNAME`, t1.`CUSTOMERTYPE` FROM (SELECT 'ACCOUNT' AS `CUSTOMERTYPE`,v1.`ACCOUNTID` AS `CUSTOMERID` ,v1.`ACCOUNTNAME` AS `CUSTOMERNAME` ,v1.`BUSINESSTYPECODE` AS `BUSINESSTYPECODE` FROM (SELECT t1.`ACCOUNTID`, t1.`ACCOUNTNAME`, t1.`BUSINESSTYPECODE` FROM `ACCOUNT` t1 ) v1 UNION ALL SELECT 'CONTACT' AS `CUSTOMERTYPE`,v2.`CONTACTID` AS `CUSTOMERID` ,v2.`FULLNAME` AS `CUSTOMERNAME` ,NULL AS `BUSINESSTYPECODE` FROM (SELECT t1.`CONTACTID`, t1.`FULLNAME` FROM `CONTACT` t1 ) v2 ) t1
]]>
</sql>
<!--数据查询[View]-->
<sqlid="View"databaseId="mysql">
<![CDATA[ SELECT t1.`BUSINESSTYPECODE`, t1.`CUSTOMERID`, t1.`CUSTOMERNAME`, t1.`CUSTOMERTYPE` FROM (SELECT 'ACCOUNT' AS `CUSTOMERTYPE`,v1.`ACCOUNTID` AS `CUSTOMERID` ,v1.`ACCOUNTNAME` AS `CUSTOMERNAME` ,NULL AS `BUSINESSTYPECODE` FROM (SELECT t1.`ACCOUNTID`, t1.`ACCOUNTNAME` FROM `ACCOUNT` t1 ) v1 UNION ALL SELECT 'CONTACT' AS `CUSTOMERTYPE`,v2.`CONTACTID` AS `CUSTOMERID` ,v2.`FULLNAME` AS `CUSTOMERNAME` ,NULL AS `BUSINESSTYPECODE` FROM (SELECT t1.`CONTACTID`, t1.`FULLNAME` FROM `CONTACT` t1 ) v2 ) t1
<![CDATA[ SELECT t1.`BUSINESSTYPECODE`, t1.`CUSTOMERID`, t1.`CUSTOMERNAME`, t1.`CUSTOMERTYPE` FROM (SELECT 'ACCOUNT' AS `CUSTOMERTYPE`,v1.`ACCOUNTID` AS `CUSTOMERID` ,v1.`ACCOUNTNAME` AS `CUSTOMERNAME` ,v1.`BUSINESSTYPECODE` AS `BUSINESSTYPECODE` FROM (SELECT t1.`ACCOUNTID`, t1.`ACCOUNTNAME`, t1.`BUSINESSTYPECODE` FROM `ACCOUNT` t1 ) v1 UNION ALL SELECT 'CONTACT' AS `CUSTOMERTYPE`,v2.`CONTACTID` AS `CUSTOMERID` ,v2.`FULLNAME` AS `CUSTOMERNAME` ,NULL AS `BUSINESSTYPECODE` FROM (SELECT t1.`CONTACTID`, t1.`FULLNAME` FROM `CONTACT` t1 ) v2 ) t1