diff --git a/mhd-user-center/src/main/resources/mapper/UserShipperMapper.xml b/mhd-user-center/src/main/resources/mapper/UserShipperMapper.xml index c66b57cf8..6faf9be12 100644 --- a/mhd-user-center/src/main/resources/mapper/UserShipperMapper.xml +++ b/mhd-user-center/src/main/resources/mapper/UserShipperMapper.xml @@ -162,14 +162,13 @@ b.tax_number, b.user_email, b.user_remark as userRemarkShipper, - b.data_source, - COALESCE(pl.push_status, 1) AS push_status, - pl.push_time, - pl.push_by, - pl.push_by_name + b.push_status, + b.push_time, + b.push_by, + b.push_by_name, + b.data_source FROM "USER" a LEFT JOIN user_shipper b ON a.user_id = b.user_id - LEFT JOIN business_partner_push_log pl ON pl.shipper_id = b.shipper_id AND pl.organization_id = #{pushQueryOrgId} left join (select user_id, LISTAGG(DISTINCT r.role_name, '&') WITHIN GROUP(ORDER BY r.role_name) AS roleName from role r left join user_role ur on r.role_id = ur.role_id and ur.del_flag = 1 @@ -182,6 +181,116 @@ AND a.role_code != 'customer' + + SELECT b.shipper_id, + a.user_id, + b.parent_shipper_id, + b.shipper_type, + b.shipper_enterprise_name, + b.shipper_enterprise_social_credit_code, + b.shipper_enterprise_phone, + b.shipper_enterprise_address, + b.shipper_enterprise_license_date_from, + b.shipper_enterprise_license_date_to, + b.shipper_enterprise_taxpayer, + b.shipper_enterprise_license_long, + b.shipper_enterprise_license_front_url, + b.shipper_corp, + b.shipper_corp_name, + b.shipper_corp_legal_name, + b.shipper_corp_idcard_number, + b.shipper_corp_idcard_number_des, + b.shipper_corp_idcard_date_from, + b.shipper_corp_idcard_date_to, + b.shipper_corp_idcard_long, + b.shipper_corp_idcard_front_url, + b.shipper_corp_idcard_back_url, + b.shipper_corp_idcard_inhand_url, + a.create_time, + a.create_by, + a.create_by_name, + a.update_time, + a.update_by, + a.update_by_name, + b.del_flag, + b.shipper_fill, + b.shipper_fill_time, + b.shipper_enterprise_fill, + b.shipper_enterprise_fill_time, + b.shipper_fill_remark, + b.shipper_enterprise_fill_remark, + b.shipper_fill_auth_id, + b.shipper_fill_auth_name, + b.shipper_enterprisel_auth_name, + b.shipper_enterprisel_auth_id, + a.user_phone, + a.user_name, + a.organization_id AS organizationId, + a.organization_name AS organizationName, + a.user_account, + a.user_member_code, + a.user_idcard_number, + a.user_idcard_date_from, + a.user_idcard_date_to, + a.user_idcard_long, + a.user_idcard_front_url, + a.user_idcard_back_url, + a.user_idcard_inhand_url, + a.user_area_county_id, + a.user_area_name, + a.user_area_address, + a.user_remark, + a.avatar, + a.user_birthday, + b.authorized_quota, + b.settlement_day, + b.remark, + b.authorized_used_amount, + r.roleName, + b.is_auto_audit_order, + b.monthly_settlement_flag, + a.user_auth_status, + b.original_receipt_flag, + b.freight_node,b.customer_nc_code,b.settlement_currency, + b.role_code as roleCodeShipper, + b.user_member_code as userMemberCodeShipper, + b.user_name_shipper as userNameShipper, + b.emergency_contact_name, + b.emergency_contact_phone, + b.user_area_county_id as userAreaCountyIdShipper, + b.user_area_name as userAreaNameShipper, + b.user_area_address as userAreaAddressShipper, + b.legal_representative, + b.unified_code, + b.registered_phone, + b.registered_address, + b.fax, + b.payment_bank, + b.payment_account, + b.invoice_title, + b.tax_number, + b.user_email, + b.user_remark as userRemarkShipper, + COALESCE(pl.push_status, 1) AS push_status, + pl.push_time, + pl.push_by, + pl.push_by_name, + b.data_source + FROM "USER" a + LEFT JOIN user_shipper b ON a.user_id = b.user_id + LEFT JOIN business_partner_push_log pl ON pl.shipper_id = b.shipper_id AND pl.organization_id = #{pushQueryOrgId} + left join (select user_id, LISTAGG(DISTINCT r.role_name, '&') WITHIN GROUP(ORDER BY r.role_name) AS roleName + from role r + left join user_role ur on r.role_id = ur.role_id and ur.del_flag = 1 + where r.del_flag = 1 + and role_code in ('shipper', 'company') + group by user_id) r on r.user_id = a.user_id + WHERE a.del_flag = 1 + AND (b.del_flag = 1 OR b.del_flag IS NULL) + AND a.business_type IN (1,3) + AND a.role_code != 'customer' + + - + GROUP BY a.user_id ORDER BY a.create_time DESC