Преглед на файлове

数据统计新增年份需求

wyyay преди 1 година
родител
ревизия
874ab0ec7c
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      business-service/src/main/resources/mapper/service/MsgAlarmMapper.xml

+ 2 - 2
business-service/src/main/resources/mapper/service/MsgAlarmMapper.xml

@@ -141,7 +141,7 @@
         <result column="alarm_type" property="alarmType"/>
         <result column="alarm_type" property="alarmType"/>
     </resultMap>
     </resultMap>
     <select id="listDtoMonth" resultMap="AlarmStatisticMonthDtoResult">
     <select id="listDtoMonth" resultMap="AlarmStatisticMonthDtoResult">
-        SELECT p.monthsta,p.fre as frequency
+        SELECT p.monthsta as monthsta,sum(p.fre) as frequency
         from
         from
         (SELECT
         (SELECT
         MONTH(a.alarm_time) as monthsta,
         MONTH(a.alarm_time) as monthsta,
@@ -172,7 +172,7 @@
                 and UPPER(m.receive_by) like UPPER(CONCAT('%',#{userId},'%'))
                 and UPPER(m.receive_by) like UPPER(CONCAT('%',#{userId},'%'))
             </if>
             </if>
         </where>
         </where>
-        group by a.alarm_id,MONTH(a.alarm_time)) AS p
+        group by a.alarm_id,MONTH(a.alarm_time)) AS p group by p.monthsta
     </select>
     </select>
 
 
     <select id="selectCameraCode" parameterType="java.lang.String" resultType="java.util.Map">
     <select id="selectCameraCode" parameterType="java.lang.String" resultType="java.util.Map">