From 7f2c180933a52d61603f82fd48f70120a6a2aa2d Mon Sep 17 00:00:00 2001 From: zhao-meiyu <2970484253@qq.com> Date: Thu, 25 Jan 2024 14:02:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=84=9F=E7=9F=A5=E7=BB=9F=E8=AE=A1=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DcPerceivedEventsWarningMapper.xml | 47 +++++++++---------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml b/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml index 586ef63e..0b51272a 100644 --- a/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml @@ -15,14 +15,14 @@ SELECT DATE_FORMAT(warning.create_time, '%Y-%m-%d %H') AS time, COUNT(*) AS number FROM dc_warning AS warning - LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark_id=mark.stake_mark + LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark WHERE DATE_FORMAT(warning.create_time,'%Y-%m-%d')=DATE_FORMAT(#{createTime},'%Y-%m-%d') AND warning.direction=#{direction} AND mark.`section_id`=#{sectionId} @@ -85,7 +85,7 @@ SELECT month(warning.create_time) AS month, COUNT(*) AS number FROM dc_warning as warning - LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark_id=mark.stake_mark + LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark where mark.`section_id`=#{sectionId} AND warning.direction=#{direction} and DATE_FORMAT(warning.create_time,'%Y')=DATE_FORMAT(#{createTime},'%Y') GROUP BY month SELECT warning.warning_type warningType,COUNT(*) AS number FROM dc_warning as warning - LEFT JOIN dc_stake_mark as mark on warning.stake_mark_id=mark.stake_mark + LEFT JOIN dc_stake_mark as mark on warning.stake_mark=mark.stake_mark where DATE_FORMAT(warning.create_time,'%Y-%m') =DATE_FORMAT(#{createTime},'%Y-%m') AND warning.direction=#{direction} and mark.`section_id`=#{sectionId} @@ -152,7 +151,7 @@ warning.warning_type warningType, COUNT(*) AS number FROM dc_warning as warning - LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark_id=mark.stake_mark + LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark WHERE YEAR(warning.create_time) =DATE_FORMAT(#{createTime},'%Y') AND warning.direction=#{direction} and mark.`section_id`=#{sectionId} @@ -160,11 +159,9 @@ ORDER BY QUARTER; - select count(1) from dc_warning where stake_mark_id=#{stakeMark} + select count(1) from dc_warning where stake_mark=#{stakeMark} AND direction=#{direction} and DATE(create_time)=DATE_FORMAT(#{createTime},'%Y-%m-%d')