"cl.name_zh as vip_level_name_zh, cl.name_en as vip_level_name_en, ",
"",
"cc.name_zh as credit_level_name_zh, cc.name_en as credit_level_name_en,",
"",
"country.name_zh as country_name_zh, country.name_en as country_name_en,",
"",
"(SELECT GROUP_CONCAT(title_zh) FROM ecw_product_type pt WHERE FIND_IN_SET(pt.id,(SELECT product_types FROM ecw_customer WHERE id=c.id))) AS product_type_name_zh, ",
"(SELECT GROUP_CONCAT(title_en) FROM ecw_product_type pt WHERE FIND_IN_SET(pt.id,(SELECT product_types FROM ecw_customer WHERE id=c.id))) AS product_type_name_en, ",
"",
"(SELECT GROUP_CONCAT(title_zh) FROM ecw_product p WHERE FIND_IN_SET(p.id,(SELECT product_ids FROM ecw_customer WHERE id=c.id))) AS product_name_zh, ",
"(SELECT GROUP_CONCAT(title_en) FROM ecw_product p WHERE FIND_IN_SET(p.id,(SELECT product_ids FROM ecw_customer WHERE id=c.id))) AS product_name_en, ",
"",
"(SELECT GROUP_CONCAT(title_zh) FROM ecw_node n WHERE FIND_IN_SET(n.id,(SELECT pickup_points FROM ecw_customer WHERE id=c.id))) AS pickup_point_name_zh,",
"(SELECT GROUP_CONCAT(title_en) FROM ecw_node n WHERE FIND_IN_SET(n.id,(SELECT pickup_points FROM ecw_customer WHERE id=c.id))) AS pickup_point_name_en,",
"",
"(SELECT GROUP_CONCAT(name_zh) FROM ecw_country ct WHERE FIND_IN_SET(ct.id,(SELECT busi_country_ids FROM ecw_customer WHERE id=c.id))) AS busi_country_name_zh,",
"(SELECT GROUP_CONCAT(name_en) FROM ecw_country ct WHERE FIND_IN_SET(ct.id,(SELECT busi_country_ids FROM ecw_customer WHERE id=c.id))) AS busi_country_name_en,",
"",
"(SELECT GROUP_CONCAT(name) FROM ecw_customer_competitor ccp WHERE FIND_IN_SET(ccp.id,(SELECT competitor_ids FROM ecw_customer WHERE id=c.id))) AS competitor_names,",
"",
"uc.nickname as creator_name,",
"uu.nickname as updater_name,",
"",
"c.customer_service,",
"u.nickname as customer_service_name",
"",
"from ecw_customer c",
"left join ecw_customer_level cl on c.level = cl.id",
"left join ecw_customer_credit cc on c.credit_level = cc.id",
"left join ecw_country country on c.country = country.id",
"left join system_user u on c.customer_service = u.id",
cl.name_zh as vip_level_name_zh, cl.name_en as vip_level_name_en,
cc.name_zh as credit_level_name_zh, cc.name_en as credit_level_name_en,
country.name_zh as country_name_zh, country.name_en as country_name_en,
(select p.* from ecw_product p where FIND_IN_SET(p.id, c.product_ids) as product_list,
(select pt.* from ecw_product_type pt where FIND_IN_SET(pt.id, c.product_types) as product_type_list,
(SELECT GROUP_CONCAT(title_zh) FROM ecw_node n WHERE FIND_IN_SET(n.id,(SELECT pickup_points FROM ecw_customer WHERE id=c.id))) AS pickup_point_name_zh,
(SELECT GROUP_CONCAT(title_en) FROM ecw_node n WHERE FIND_IN_SET(n.id,(SELECT pickup_points FROM ecw_customer WHERE id=c.id))) AS pickup_point_name_en,
(SELECT GROUP_CONCAT(name_zh) FROM ecw_country ct WHERE FIND_IN_SET(ct.id,(SELECT busi_country_ids FROM ecw_customer WHERE id=c.id))) AS busi_country_name_zh,
(SELECT GROUP_CONCAT(name_en) FROM ecw_country ct WHERE FIND_IN_SET(ct.id,(SELECT busi_country_ids FROM ecw_customer WHERE id=c.id))) AS busi_country_name_en,
(SELECT GROUP_CONCAT(name) FROM ecw_customer_competitor ccp WHERE FIND_IN_SET(ccp.id,(SELECT competitor_ids FROM ecw_customer WHERE id=c.id))) AS competitor_names,
uc.nickname as creator_name,
uu.nickname as updater_name,
u.nickname as customer_service_name
from ecw_customer c
left join ecw_customer_level cl on c.level = cl.id
left join ecw_customer_credit cc on c.credit_level = cc.id
left join ecw_country country on c.country = country.id
left join system_user u on c.customer_service = u.id