Commit 44487fd8 authored by zhengyi's avatar zhengyi

客户详情获取重构sql修正

parent 16668fc0
......@@ -87,18 +87,18 @@
<result column="updater_name" jdbcType="VARCHAR" property="updaterName"/>
<result column="customer_service_name" jdbcType="VARCHAR" property="customerServiceName"/>
<collection property="productList" ofType="cn.iocoder.yudao.module.product.vo.product.ProductRespVO">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="type_id" jdbcType="BIGINT" property="typeId"/>
<id column="prod_id" jdbcType="BIGINT" property="id"/>
<result column="prod_type_id" jdbcType="BIGINT" property="typeId"/>
<result column="attr_id" jdbcType="VARCHAR" property="attrId"/>
<result column="title_zh" jdbcType="VARCHAR" property="titleZh"/>
<result column="title_en" jdbcType="VARCHAR" property="titleEn"/>
<result column="prod_title_zh" jdbcType="VARCHAR" property="titleZh"/>
<result column="prod_title_en" jdbcType="VARCHAR" property="titleEn"/>
<result column="material_type" jdbcType="VARCHAR" property="materialType"/>
<result column="packaging" jdbcType="VARCHAR" property="packaging"/>
</collection>
<collection property="productTypeList" ofType="cn.iocoder.yudao.module.product.vo.product.ProductTypeRespVO">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="title_zh" jdbcType="VARCHAR" property="titleZh"/>
<result column="title_en" jdbcType="VARCHAR" property="titleEn"/>
<id column="type_id" jdbcType="BIGINT" property="id"/>
<result column="type_title_zh" jdbcType="VARCHAR" property="titleZh"/>
<result column="type_title_en" jdbcType="VARCHAR" property="titleEn"/>
</collection>
</resultMap>
......@@ -140,8 +140,16 @@
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,
p.id as prod_id,
p.type_id as prod_type_id,
p.attr_id as attr_id,
p.title_zh as prod_title_zh,
p.title_en as prod_title_en,
p.material_type as material_type,
p.packaging as packaging,
pt.id as type_id,
pt.title_zh as type_title_zh,
pt.title_en as type_title_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,
......@@ -151,6 +159,8 @@
uu.nickname as updater_name,
u.nickname as customer_service_name
from ecw_customer c
left join ecw_product p on FIND_IN_SET(p.id, c.product_ids)
left join ecw_product_type pt on FIND_IN_SET(pt.id, c.product_types)
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment