Commit ec6a10ee authored by yanghao's avatar yanghao

fix: #802 【客户】2. 新增/编辑客户,主营类别和是多选

parent 0368aedb
alter table `ecw_customer`
change column `product_type` `product_types` varchar(300) DEFAULT NULL COMMENT '主营类型,多个逗号分隔';
......@@ -105,7 +105,7 @@ public class CustomerDO extends BaseDO {
/**
* 产品类型
*/
private Long productType;
private String productTypes;
/**
* 产品id
*/
......
......@@ -73,7 +73,8 @@ public interface CustomerMapper extends BaseMapperX<CustomerDO> {
"",
"country.name_zh as country_name_zh, country.name_en as country_name_en,",
"",
"pt.title_zh as product_type_name_zh, pt.title_en as product_type_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, ",
......@@ -96,7 +97,6 @@ public interface CustomerMapper extends BaseMapperX<CustomerDO> {
"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 ecw_product_type pt on c.product_type = pt.id",
"left join system_user u on c.customer_service = u.id",
"left join system_user uc on c.creator = uc.id",
"left join system_user uu on c.updater = uu.id",
......
......@@ -67,7 +67,7 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
private String address;
@ApiModelProperty(value = "产品类型id")
private Long productType;
private String productTypes;
@ApiModelProperty(value = "产品ids")
private String productIds;
......
......@@ -699,7 +699,7 @@
<if test="query.productTypes != null and query.productTypes.size()>0">
AND
<foreach item='item' index="index" collection='query.productTypes' open='(' separator='or' close=')'>
FIND_IN_SET(#{item}, contact.product_type)
FIND_IN_SET(#{item}, contact.product_types)
</foreach>
</if>
<!--主营商品名称-->
......
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