From 68ccca073fca3cae95c65f4e140173aff91d072d Mon Sep 17 00:00:00 2001 From: linfso Date: Wed, 15 May 2024 09:31:03 +0800 Subject: [PATCH] md --- .../mapper/EmisCustomerUserMapper.xml | 61 +++++++++++-------- 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a/emis-biz/src/main/resources/mapper/EmisCustomerUserMapper.xml b/emis-biz/src/main/resources/mapper/EmisCustomerUserMapper.xml index c39cfa4b9..8169c4a8c 100644 --- a/emis-biz/src/main/resources/mapper/EmisCustomerUserMapper.xml +++ b/emis-biz/src/main/resources/mapper/EmisCustomerUserMapper.xml @@ -77,9 +77,6 @@ - - select id, customer_code, customer_name, customer_name_en, simple_name, phone, mobile, customer_type, settled_type, user_type, company, dept_id, avatar, sex, invitation_info, login_ip, login_date, nick_name, union_id, openid, monthly_pay_code, user_name, password, owner_site, country, province, city, county, town, address, email, send_country, send_province, send_city, send_county, send_town, post_code, status, real_name, id_no, payee, salesmen, data_from, bl_open_oms, bl_sms, op_emp_code, order_num, remark, del_flag, create_by, create_time, update_by, update_time, create_site, update_site from emis_customer_user - del_flag='0' + + + AND owner_site in ( + SELECT t3.site_code FROM( + SELECT t1.site_code,t1.parent_site_code,t1.site_name, + IF( FIND_IN_SET( parent_site_code, @parent_ids ) > 0, @parent_ids := CONCAT( @parent_ids, ',', site_code ), '0' ) AS cids + FROM ( SELECT * FROM emis_site AS t WHERE t.del_flag = '0' ORDER BY t.site_code ASC ) t1, + ( SELECT @parent_ids := #{ownerSite} ) t2 + ) t3 + WHERE cids != '0' + UNION + SELECT #{ownerSite} FROM dual + ) + and id = #{id} - and customer_code=#{customerCode} + and customer_code like concat('%', #{customerCode}, '%') and customer_name like concat('%', #{customerName}, '%') and customer_name_en like concat('%', #{customerNameEn}, '%') and simple_name like concat('%', #{simpleName}, '%') and phone like concat('%', #{phone}, '%') and mobile like concat('%', #{mobile}, '%') - and customer_type=#{customerType} + and customer_type like concat('%', #{customerType}, '%') and settled_type like concat('%', #{settledType}, '%') - and user_type=#{userType} + and user_type like concat('%', #{userType}, '%') and company like concat('%', #{company}, '%') and dept_id like concat('%', #{deptId}, '%') and avatar like concat('%', #{avatar}, '%') @@ -128,6 +144,9 @@ and monthly_pay_code like concat('%', #{monthlyPayCode}, '%') and user_name like concat('%', #{userName}, '%') and password like concat('%', #{password}, '%') + + and biz_site like concat('%', #{bizSite}, '%') + and biz_site_name like concat('%', #{bizSiteName}, '%') and country like concat('%', #{country}, '%') and province like concat('%', #{province}, '%') and city like concat('%', #{city}, '%') @@ -159,33 +178,17 @@ and update_time = #{updateTime} and create_site like concat('%', #{createSite}, '%') and update_site like concat('%', #{updateSite}, '%') - - - - AND owner_site in ( - SELECT t3.site_code FROM( - SELECT t1.site_code,t1.parent_site_code,t1.site_name, - IF( FIND_IN_SET( parent_site_code, @parent_ids ) > 0, @parent_ids := CONCAT( @parent_ids, ',', site_code ), '0' ) AS cids - FROM ( SELECT * FROM emis_site AS t WHERE t.del_flag = '0' ORDER BY t.site_code ASC ) t1, - ( SELECT @parent_ids := #{ownerSite} ) t2 - ) t3 - WHERE cids != '0' - UNION - SELECT #{ownerSite} FROM dual - ) - - order by create_time desc - + insert into emis_customer_user id, @@ -212,6 +215,8 @@ user_name, password, owner_site, + biz_site, + biz_site_name, country, province, city, @@ -269,6 +274,8 @@ #{userName}, #{password}, #{ownerSite}, + #{bizSite}, + #{bizSiteName}, #{country}, #{province}, #{city}, @@ -327,7 +334,10 @@ openid = #{openid}, monthly_pay_code = #{monthlyPayCode}, user_name = #{userName}, + password = #{password}, owner_site = #{ownerSite}, + biz_site = #{bizSite}, + biz_site_name = #{bizSiteName}, country = #{country}, province = #{province}, city = #{city}, @@ -364,6 +374,9 @@ + + + update emis_customer_user set del_flag='1' where id = #{id}