INSERTINTO`jiedao`.`system_sms_template`(`id`,`type`,`status`,`code`,`name`,`content`,`params`,`remark`,`api_template_id`,`channel_id`,`channel_code`,`creator`,`create_time`,`updater`,`update_time`,`deleted`,`content_en`,`api_template_id_en`)VALUES(55,3,0,'user-sms-redeem-reward','积分兑换验证码','积分兑换验证码:${code},请勿将验证码泄露给他人,以免造成不必要的损失,两分钟之内有效!','[\"code\"]',NULL,'SMS_471775248',6,'ALIYUN','2696','2024-08-20 10:06:06','2696','2024-08-20 10:14:39',b'0','[ECLogistics]Your login code is:{code}, do not disclose this code to others to avoid any unnecessary loss, within 20 minutes effective!','SMS_199790126');
if(nor.customer_id != null and nor.customer_id > 0,
if(nor.customer_id is not null and nor.customer_id > 0,
(SELECT u1.nickname FROM system_user u1 JOIN system_user u2 on u1.id = u2.customer_service_id JOIN ecw_customer u ON u.customer_service = u2.id WHERE u.id = nor.customer_id),
"") as consignor_follow_customerService,
nor.customer_number as consignor_customer_number,
...
...
@@ -1545,7 +1545,7 @@
nor.phone as consignor_phone,
nor.country_code as consignor_country_code,
nee.customer_id as consignee_customer_id,
if(nee.customer_id != null and nee.customer_id > 0,
if(nee.customer_id is not null and nee.customer_id > 0,
(SELECT u1.nickname FROM system_user u1 JOIN system_user u2 on u1.id = u2.customer_service_id JOIN ecw_customer u ON u.customer_service = u2.id WHERE u.id = nee.customer_id),
"") as consignee_follow_customerService,
nee.customer_number as consignee_customer_number,
...
...
@@ -1682,7 +1682,7 @@
in_time,
if(#{query.userType} = 1, 1, 2) as user_type,
nor.customer_id as consignor_customer_id,
if(nor.customer_id != null and nor.customer_id > 0,
if(nor.customer_id is not null and nor.customer_id > 0,
(SELECT u1.nickname FROM system_user u1 JOIN system_user u2 on u1.id = u2.customer_service_id JOIN ecw_customer u ON u.customer_service = u2.id WHERE u.id = nor.customer_id),
"") as consignor_follow_customerService,
nor.customer_number as consignor_customer_number,
...
...
@@ -1691,7 +1691,7 @@
nor.phone as consignor_phone,
nor.country_code as consignor_country_code,
nee.customer_id as consignee_customer_id,
if(nee.customer_id != null and nee.customer_id > 0,
if(nee.customer_id is not null and nee.customer_id > 0,
(SELECT u1.nickname FROM system_user u1 JOIN system_user u2 on u1.id = u2.customer_service_id JOIN ecw_customer u ON u.customer_service = u2.id WHERE u.id = nee.customer_id),
"") as consignee_follow_customerService,
nee.customer_number as consignee_customer_number,
...
...
@@ -4493,7 +4493,7 @@
in_time,
if(#{query.userType} = 1, 1, 2) as user_type,
nor.customer_id as consignor_customer_id,
if(nor.customer_id != null and nor.customer_id > 0,
if(nor.customer_id is not null and nor.customer_id > 0,
(SELECT u1.nickname FROM system_user u1 JOIN system_user u2 on u1.id = u2.customer_service_id JOIN ecw_customer u ON u.customer_service = u2.id WHERE u.id = nor.customer_id),
"") as consignor_follow_customerService,
nor.customer_number as consignor_customer_number,
...
...
@@ -4502,7 +4502,7 @@
nor.phone as consignor_phone,
nor.country_code as consignor_country_code,
nee.customer_id as consignee_customer_id,
if(nee.customer_id != null and nee.customer_id > 0,
if(nee.customer_id is not null and nee.customer_id > 0,
(SELECT u1.nickname FROM system_user u1 JOIN system_user u2 on u1.id = u2.customer_service_id JOIN ecw_customer u ON u.customer_service = u2.id WHERE u.id = nee.customer_id),
"") as consignee_follow_customerService,
nee.customer_number as consignee_customer_number,
...
...
@@ -4619,7 +4619,7 @@
in_time,
if(#{query.userType} = 1, 1, 2) as user_type,
nor.customer_id as consignor_customer_id,
if(nor.customer_id != null and nor.customer_id > 0,
if(nor.customer_id is not null and nor.customer_id > 0,
(SELECT u1.nickname FROM system_user u1 JOIN system_user u2 on u1.id = u2.customer_service_id JOIN ecw_customer u ON u.customer_service = u2.id WHERE u.id = nor.customer_id),
"") as consignor_follow_customerService,
nor.customer_number as consignor_customer_number,
...
...
@@ -4628,7 +4628,7 @@
nor.phone as consignor_phone,
nor.country_code as consignor_country_code,
nee.customer_id as consignee_customer_id,
if(nee.customer_id != null and nee.customer_id > 0,
if(nee.customer_id is not null and nee.customer_id > 0,
(SELECT u1.nickname FROM system_user u1 JOIN system_user u2 on u1.id = u2.customer_service_id JOIN ecw_customer u ON u.customer_service = u2.id WHERE u.id = nee.customer_id),
"") as consignee_follow_customerService,
nee.customer_number as consignee_customer_number,
...
...
@@ -4771,7 +4771,7 @@
in_time,
if(#{query.userType} = 1, 1, 2) as user_type,
nor.customer_id as consignor_customer_id,
if(nor.customer_id != null and nor.customer_id > 0,
if(nor.customer_id is not null and nor.customer_id > 0,
(SELECT u1.nickname FROM system_user u1 JOIN system_user u2 on u1.id = u2.customer_service_id JOIN ecw_customer u ON u.customer_service = u2.id WHERE u.id = nor.customer_id),
"") as consignor_follow_customerService,
nor.customer_number as consignor_customer_number,
...
...
@@ -4780,7 +4780,7 @@
nor.phone as consignor_phone,
nor.country_code as consignor_country_code,
nee.customer_id as consignee_customer_id,
if(nee.customer_id != null and nee.customer_id > 0,
if(nee.customer_id is not null and nee.customer_id > 0,
(SELECT u1.nickname FROM system_user u1 JOIN system_user u2 on u1.id = u2.customer_service_id JOIN ecw_customer u ON u.customer_service = u2.id WHERE u.id = nee.customer_id),
"") as consignee_follow_customerService,
nee.customer_number as consignee_customer_number,
...
...
@@ -4909,7 +4909,7 @@
in_time,
if(#{query.userType} = 1, 1, 2) as user_type,
nor.customer_id as consignor_customer_id,
if(nor.customer_id != null and nor.customer_id > 0,
if(nor.customer_id is not null and nor.customer_id > 0,
(SELECT u1.nickname FROM system_user u1 JOIN system_user u2 on u1.id = u2.customer_service_id JOIN ecw_customer u ON u.customer_service = u2.id WHERE u.id = nor.customer_id),
"") as consignor_follow_customerService,
nor.customer_number as consignor_customer_number,
...
...
@@ -4918,7 +4918,7 @@
nor.phone as consignor_phone,
nor.country_code as consignor_country_code,
nee.customer_id as consignee_customer_id,
if(nee.customer_id != null and nee.customer_id > 0,
if(nee.customer_id is not null and nee.customer_id > 0,
(SELECT u1.nickname FROM system_user u1 JOIN system_user u2 on u1.id = u2.customer_service_id JOIN ecw_customer u ON u.customer_service = u2.id WHERE u.id = nee.customer_id),
"") as consignee_follow_customerService,
nee.customer_number as consignee_customer_number,
...
...
@@ -5016,7 +5016,7 @@
in_time,
if(#{query.userType} = 1, 1, 2) as user_type,
nor.customer_id as consignor_customer_id,
if(nor.customer_id != null and nor.customer_id > 0,
if(nor.customer_id is not null and nor.customer_id > 0,
(SELECT u1.nickname FROM system_user u1 JOIN system_user u2 on u1.id = u2.customer_service_id JOIN ecw_customer u ON u.customer_service = u2.id WHERE u.id = nor.customer_id),
"") as consignor_follow_customerService,
nor.customer_number as consignor_customer_number,
...
...
@@ -5025,7 +5025,7 @@
nor.phone as consignor_phone,
nor.country_code as consignor_country_code,
nee.customer_id as consignee_customer_id,
if(nee.customer_id != null and nee.customer_id > 0,
if(nee.customer_id is not null and nee.customer_id > 0,
(SELECT u1.nickname FROM system_user u1 JOIN system_user u2 on u1.id = u2.customer_service_id JOIN ecw_customer u ON u.customer_service = u2.id WHERE u.id = nee.customer_id),
"") as consignee_follow_customerService,
nee.customer_number as consignee_customer_number,
...
...
@@ -5136,7 +5136,7 @@
o.is_exception,
o.create_time,
nor.customer_id as consignor_customer_id,
if(nor.customer_id != null and nor.customer_id > 0,
if(nor.customer_id is not null and nor.customer_id > 0,
(SELECT u1.nickname FROM system_user u1 JOIN system_user u2 on u1.id = u2.customer_service_id JOIN ecw_customer u ON u.customer_service = u2.id WHERE u.id = nor.customer_id),
"") as consignor_follow_customerService,
nor.customer_number as consignor_customer_number,
...
...
@@ -5145,7 +5145,7 @@
nor.phone as consignor_phone,
nor.country_code as consignor_country_code,
nee.customer_id as consignee_customer_id,
if(nee.customer_id != null and nee.customer_id > 0,
if(nee.customer_id is not null and nee.customer_id > 0,
(SELECT u1.nickname FROM system_user u1 JOIN system_user u2 on u1.id = u2.customer_service_id JOIN ecw_customer u ON u.customer_service = u2.id WHERE u.id = nee.customer_id),
"") as consignee_follow_customerService,
nee.customer_number as consignee_customer_number,
...
...
@@ -7073,7 +7073,7 @@
o.create_time,
if(#{query.userType} = 1, 1, 2) as user_type,
nor.customer_id as consignor_customer_id,
if(nor.customer_id != null and nor.customer_id > 0,
if(nor.customer_id is not null and nor.customer_id > 0,
(SELECT u1.nickname FROM system_user u1 JOIN system_user u2 on u1.id = u2.customer_service_id JOIN ecw_customer u ON u.customer_service = u2.id WHERE u.id = nor.customer_id),
"") as consignor_follow_customerService,
nor.customer_number as consignor_customer_number,
...
...
@@ -7082,7 +7082,7 @@
nor.phone as consignor_phone,
nor.country_code as consignor_country_code,
nee.customer_id as consignee_customer_id,
if(nee.customer_id != null and nee.customer_id > 0,
if(nee.customer_id is not null and nee.customer_id > 0,
(SELECT u1.nickname FROM system_user u1 JOIN system_user u2 on u1.id = u2.customer_service_id JOIN ecw_customer u ON u.customer_service = u2.id WHERE u.id = nee.customer_id),
"") as consignee_follow_customerService,
nee.customer_number as consignee_customer_number,
...
...
@@ -7172,7 +7172,7 @@
o.create_time,
if(#{query.userType} = 1, 1, 2) as user_type,
nor.customer_id as consignor_customer_id,
if(nor.customer_id != null and nor.customer_id > 0,
if(nor.customer_id is not null and nor.customer_id > 0,
(SELECT u1.nickname FROM system_user u1 JOIN system_user u2 on u1.id = u2.customer_service_id JOIN ecw_customer u ON u.customer_service = u2.id WHERE u.id = nor.customer_id),
"") as consignor_follow_customerService,
nor.customer_number as consignor_customer_number,
...
...
@@ -7181,7 +7181,7 @@
nor.phone as consignor_phone,
nor.country_code as consignor_country_code,
nee.customer_id as consignee_customer_id,
if(nee.customer_id != null and nee.customer_id > 0,
if(nee.customer_id is not null and nee.customer_id > 0,
(SELECT u1.nickname FROM system_user u1 JOIN system_user u2 on u1.id = u2.customer_service_id JOIN ecw_customer u ON u.customer_service = u2.id WHERE u.id = nee.customer_id),
"(select count(1) from ecw_customer_followup l where l.offer_id = o.offer_id) as log_count, ",
"u.nickname as creator_name, ",
"u.nickname as business_manager_name, ",
// "(SELECT cc.`name` FROM ecw_customer_contacts cc WHERE ( o.relation = 1 AND cc.id = o.consignor_id ) OR ( o.relation = 2 AND cc.id = o.consignee_id)) AS relation_name ",
"cc.name as relation_name, ",
"cc.area_code as relation_area_code, ",
"cc.phone_new as relation_phone, ",
"if(#{lang} = 0, l.name_zh , l.name_en ) as channel_name, ",
"line.start_warehouse_id, ",
"line.dest_warehouse_id, ",
"if(#{lang} = 0, st.title_zh , st.title_en) as start_warehouse_name, ",
"if(#{lang} = 0, dst.title_zh , dst.title_en) as dest_warehouse_name, ",
"line.transport_type ",
"from ecw_offer o ",
"left join ecw_customer_contacts cc on (o.relation = 1 and cc.id = o.consignor_id) or (o.relation = 2 and cc.id = o.consignee_id) ",
"left join ecw_customer user on user.id = o.relation_id ",
"join ecw_customer_contacts cc on (o.relation = 1 and cc.id = o.consignor_id) or (o.relation = 2 and cc.id = o.consignee_id) ",
"join ecw_customer user on user.id = o.relation_id ",
"left join system_user u on u.id = o.follow_up_salesman_id ",
"left join ecw_region s on o.objective_id = s.id ",
"left join ecw_warehouse_line line on o.line_id = line.id ",
"left join ecw_warehouse dst on line.dest_warehouse_id = dst.id ",
"join ecw_region s on o.objective_id = s.id ",
"join ecw_warehouse_line line on o.line_id = line.id ",
"join ecw_warehouse st on line.start_warehouse_id = st.id ",
"join ecw_warehouse dst on line.dest_warehouse_id = dst.id ",
"left join ecw_channel l on o.channel_id = l.channel_id ",
"where o.deleted = 0",
...
...
@@ -152,7 +140,6 @@ public interface OfferMapper extends BaseMapperX<OfferDO> {
"AND o.relation_id = #{pageVO.customerId} ",
"</when>",
"<when test = 'pageVO.deptId != null'>",
"AND o.dept_id = #{pageVO.deptId} ",
"</when>",
...
...
@@ -204,23 +191,23 @@ public interface OfferMapper extends BaseMapperX<OfferDO> {
"</when>",
"<when test = 'pageVO.importances != null and pageVO.importances.size() > 0'>",
"<when test = 'pageVO.searchCustomer != null and pageVO.searchCustomer != \"\" '>",
"AND o.`relation_id` in(select cc.customer_id from ecw_customer_contacts cc where concat(cc.`name`, cc.phone_new) like concat('%',concat(#{pageVO.searchCustomer},'%')))",
"</when>",
...
...
@@ -400,7 +395,7 @@ public interface OfferMapper extends BaseMapperX<OfferDO> {
"u.nickname as creator_name, ",
"cc.name as relation_name",
"from ecw_offer o ",
"left join ecw_customer_contacts cc on (o.relation = 1 and cc.id = o.consignor_id) or (o.relation = 2 and cc.id = o.consignee_id) ",
"join ecw_customer_contacts cc on (o.relation = 1 and cc.id = o.consignor_id) or (o.relation = 2 and cc.id = o.consignee_id) ",
"left join system_user u on u.id = o.follow_up_salesman_id ",