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')