Ver código fonte

添加年份判断

wyyay 2 anos atrás
pai
commit
7e59966bad

+ 1 - 1
.idea/compiler.xml

@@ -7,9 +7,9 @@
         <sourceOutputDir name="target/generated-sources/annotations" />
         <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
         <outputRelativeToContentRoot value="true" />
-        <module name="base-admin" />
         <module name="hazard-admin" />
         <module name="hazard-sdk" />
+        <module name="base-admin" />
         <module name="business-service" />
       </profile>
     </annotationProcessing>

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

@@ -73,6 +73,7 @@
             <if test="userId != null and userId != ''">
                 and UPPER(m.receive_by) like UPPER(CONCAT('%',#{userId},'%'))
             </if>
+            and YEAR(a.alarm_time) = YEAR(SYSDATE())
         </where>
         group by a.alarm_id
     </select>
@@ -122,6 +123,7 @@
             <if test="userId != null and userId != ''">
                 and UPPER(m.receive_by) like UPPER(CONCAT('%',#{userId},'%'))
             </if>
+            and YEAR(a.alarm_time) = YEAR(SYSDATE())
         </where>
         group by a.alarm_id,MONTH(a.alarm_time)
 
@@ -172,6 +174,7 @@
             <if test="userId != null and userId != ''">
                 and UPPER(m.receive_by) like UPPER(CONCAT('%',#{userId},'%'))
             </if>
+            and YEAR(a.alarm_time) = YEAR(SYSDATE())
         </where>
         group by a.alarm_id
     </select>
@@ -214,6 +217,7 @@
             <if test="userId != null and userId != ''">
                 and UPPER(m.receive_by) like UPPER(CONCAT('%',#{userId},'%'))
             </if>
+            and YEAR(a.alarm_time) = YEAR(SYSDATE())
         </where>
         group by a.alarm_id,MONTH(a.alarm_time)
 

+ 1 - 0
business-service/src/main/resources/mapper/service/MsgAppPushMapper.xml

@@ -62,6 +62,7 @@
             <if test="status != null and status != 0">
                 and UPPER(status) like UPPER(CONCAT('%',#{status},'%'))
             </if>
+            and YEAR(a.alarm_time) = YEAR(SYSDATE())
         </where>
     </select>
     <update id="update" parameterType="com.ozs.service.entity.MsgAppPush">

+ 2 - 2
hazard-admin/src/main/java/com/ozs/web/controller/accountmanagment/MsgAlarmController.java

@@ -320,7 +320,7 @@ public class MsgAlarmController extends BaseController {
             @ApiImplicitParam(paramType = "query", name = "alarmType", value = "灾害类型"),
     })
     public void exportDataStatistic(HttpServletResponse response, @RequestBody AlarmStatisticResVo alarmStatisticResVo) {
-        String userId = "1";//getUserId();
+        String userId = getUserId();
         if ("1".equals(userId)) {
             userId = "";
         }
@@ -349,7 +349,7 @@ public class MsgAlarmController extends BaseController {
             @ApiImplicitParam(paramType = "query", name = "alarmType", value = "灾害类型"),
     })
     public void exportDataStatisticMonth(HttpServletResponse response, @RequestBody AlarmStatisticResVo alarmStatisticResVo) {
-        String userId = "1";//getUserId();
+        String userId = getUserId();
         if ("1".equals(userId)) {
             userId = "";
         }