company_info
tenant_supplier_business_scope
purchaser_supplier_basic_info
purchaser_supplier_tag
tenant_supplier_tag
select * from company_info ci
left join purchaser_supplier_basic_info psbi on ci.id = psbi.master_purchaser_id and psbi.master_supplier_id=采购商id
left join purchaser_supplier_tag pst on ci.id = pst.master_purchaser_id and pst.master_supplier_id=采购商id
left join tenant_supplier_tag tst on tst.tenant_id = ci.tenant_id and pst.master_supplier_id=采购商id
select ci.`company_name` , ci.`created_at`,ci.`registered_captical`,ci.`city`,psbi.`cooperate_status`,psbi.`investigate_status`,tst.`tag_name`,pst.`tag_name`
from company_info ci
left join purchaser_supplier_basic_info psbi on ci.id = psbi.master_purchaser_id and psbi.master_supplier_id=1
left join purchaser_supplier_tag pst on ci.id = pst.master_purchaser_id and pst.master_supplier_id=1
left join tenant_supplier_tag tst on tst.tenant_id = ci.tenant_id and tst.master_supplier_id=1
where ci.`company_name` like '%端%'