From 754f2005abdb414480e64adb3b1ee5c1085ab71c Mon Sep 17 00:00:00 2001 From: yuyang Date: Wed, 1 Dec 2021 12:02:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A2=E5=8D=95=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E7=94=A8=E6=88=B7=E8=B4=A6=E5=8F=B7=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/XhpcHistoryOrderMapper.xml | 23 +++++++++++------- .../mapper/XhpcRealTimeOrderMapper.xml | 24 +++++++++++-------- .../resources/mapper/XhpcStatisticsMapper.xml | 1 - 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml index fd1a4fde..447e3522 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml @@ -632,7 +632,7 @@ and co.source=#{source} - and co.Plate_num=#{plateNum} + and co.Plate_num like concat('%', #{plateNum}, '%') and inu.internet_user_id=#{internetId} @@ -671,24 +671,31 @@ and op.operator_id =#{operatorId} - and co.user_id in (SELECT app_user_id FROM xhpc_app_user where phone like concat('%', #{phone}, '%')) or - co.user_id in (SELECT internet_user_id from xhpc_internet_user where phone like concat('%', #{phone}, '%')) + and co.user_id in ( + SELECT cro.user_id + FROM xhpc_charge_order cro WHERE cro.source = 0 AND cro.user_id IN ( SELECT app_user_id FROM xhpc_app_user where phone like concat('%', #{phone}, '%')) + union + SELECT cro.user_id FROM xhpc_charge_order cro WHERE cro.source = 1 AND cro.user_id IN (SELECT internet_user_id from xhpc_internet_user where phone like concat('%', #{phone}, '%')) + ) - and co.user_id in (SELECT app_user_id FROM xhpc_app_user) + and co.user_id in ( + SELECT cro.user_id FROM xhpc_charge_order cro WHERE cro.source = 0 AND cro.user_id IN ( SELECT app_user_id FROM xhpc_app_user where phone like concat('%', #{phone}, '%'))) - and co.user_id in (SELECT internet_user_id from xhpc_internet_user) + and co.user_id in ( + SELECT cro.user_id FROM xhpc_charge_order cro WHERE cro.source = 1 AND cro.user_id IN (SELECT internet_user_id from xhpc_internet_user where phone like concat('%', #{phone}, '%'))) - and co.user_id in (SELECT app_user_id FROM xhpc_app_user where phone like concat('%', #{phone}, '%')) + and co.user_id in ( + SELECT cro.user_id FROM xhpc_charge_order cro WHERE cro.source = 0 AND cro.user_id IN ( SELECT app_user_id FROM xhpc_app_user where phone like concat('%', #{phone}, '%'))) - and co.user_id in (SELECT internet_user_id from xhpc_internet_user where phone like concat('%', - #{phone}, '%')) + and co.user_id in ( + SELECT cro.user_id FROM xhpc_charge_order cro WHERE cro.source = 1 AND cro.user_id IN (SELECT internet_user_id from xhpc_internet_user where phone like concat('%', #{phone}, '%'))) diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcRealTimeOrderMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcRealTimeOrderMapper.xml index 60e36a5d..1ad0939f 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcRealTimeOrderMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcRealTimeOrderMapper.xml @@ -425,9 +425,6 @@ and co.source =#{source} - - and co.status =#{status} - and co.start_time >= #{startTime} @@ -447,24 +444,31 @@ and op.operator_id =#{operatorId} - and co.user_id in (SELECT app_user_id FROM xhpc_app_user where phone like concat('%', #{phone}, '%')) or - co.user_id in (SELECT internet_user_id from xhpc_internet_user where phone like concat('%', #{phone}, '%')) + and co.user_id in ( + SELECT cro.user_id + FROM xhpc_charge_order cro WHERE cro.source = 0 AND cro.user_id IN ( SELECT app_user_id FROM xhpc_app_user where phone like concat('%', #{phone}, '%')) + union + SELECT cro.user_id FROM xhpc_charge_order cro WHERE cro.source = 1 AND cro.user_id IN (SELECT internet_user_id from xhpc_internet_user where phone like concat('%', #{phone}, '%')) + ) - and co.user_id in (SELECT app_user_id FROM xhpc_app_user) + and co.user_id in ( + SELECT cro.user_id FROM xhpc_charge_order cro WHERE cro.source = 0 AND cro.user_id IN ( SELECT app_user_id FROM xhpc_app_user where phone like concat('%', #{phone}, '%'))) - and co.user_id in (SELECT internet_user_id from xhpc_internet_user) + and co.user_id in ( + SELECT cro.user_id FROM xhpc_charge_order cro WHERE cro.source = 1 AND cro.user_id IN (SELECT internet_user_id from xhpc_internet_user where phone like concat('%', #{phone}, '%'))) - and co.user_id in (SELECT app_user_id FROM xhpc_app_user where phone like concat('%', #{phone}, '%')) + and co.user_id in ( + SELECT cro.user_id FROM xhpc_charge_order cro WHERE cro.source = 0 AND cro.user_id IN ( SELECT app_user_id FROM xhpc_app_user where phone like concat('%', #{phone}, '%'))) - and co.user_id in (SELECT internet_user_id from xhpc_internet_user where phone like concat('%', - #{phone}, '%')) + and co.user_id in ( + SELECT cro.user_id FROM xhpc_charge_order cro WHERE cro.source = 1 AND cro.user_id IN (SELECT internet_user_id from xhpc_internet_user where phone like concat('%', #{phone}, '%'))) diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml index ad100ae8..7c05cbbd 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml @@ -122,7 +122,6 @@ sum(platform_svc_commisssion) platformSvcCommisssion, sum(operation_commission) operationCommission, sum(operation_svc_commission) operationSvcCommission, - DATE_FORMAT(create_time,'%Y-%m-%d') createTime from xhpc_statistics_station where del_flag=0 and type=1