Quellcode durchsuchen

1.解决了alarmhistoryMapper.xml中表写死的问题。2.修改拦截器返回false

‘xugp vor 2 Jahren
Ursprung
Commit
dec2fd1686

+ 2 - 2
schedule-job/alarm-schedule/src/main/resources/mappers/AlarmHistoryMapper.xml

@@ -159,14 +159,14 @@
         w.ednavalue,
         h.alerttime,
         w.warningtypeid
-        from alarmhistory_nss_202107 h
+        from ${tbName} h
         left join alarmsnap a on h.snapid = a.id
         left join warning2 w on a.alertvalue = w.ednavalue
         and a.modelid = w.modelid
         <where>
             and a.category1 = 'windturbine'
             and h.messagetype = '1'
-
+            and
             <if test="starttime !=null and endtime !=null">
                 h.alerttime  &gt;= #{starttime,jdbcType=DATE} and h.alerttime  &lt; #{endtime,jdbcType=DATE}
             </if>

+ 1 - 1
warning-web/src/main/java/com/gyee/wisdom/alarm/sharding/filter/LoginInterceptor.java

@@ -51,7 +51,7 @@ public class LoginInterceptor implements HandlerInterceptor {
         ServletOutputStream resultWriter = httpServletResponse.getOutputStream();
         // 如果不是映射到方法直接通过
         if (!(object instanceof HandlerMethod)) {
-            return true;
+            return false;
         }
         HandlerMethod handlerMethod = (HandlerMethod) object;
         Method method = handlerMethod.getMethod();

+ 2 - 2
warning-web/src/main/resources/mappers-oracle/AlarmHistoryMapper.xml

@@ -169,14 +169,14 @@
         w.ednavalue,
         h.alerttime,
         w.warningtypeid
-        from alarmhistory_nss_202107 h
+        from ${tbName} h
         left join alarmsnap a on h.snapid = a.id
         left join warning2 w on a.alertvalue = w.ednavalue
         and a.modelid = w.modelid
         <where>
             and a.category1 = 'windturbine'
             and h.messagetype = '1'
-
+            and
             <if test="starttime !=null and endtime !=null">
                 h.alerttime  &gt;= #{starttime,jdbcType=DATE} and h.alerttime  &lt; #{endtime,jdbcType=DATE}
             </if>

+ 2 - 2
warning-web/src/main/resources/mappers/AlarmHistoryMapper.xml

@@ -163,14 +163,14 @@
         w.ednavalue,
         h.alerttime,
         w.warningtypeid
-        from alarmhistory_nss_202107 h
+        from ${tbName} h
         left join alarmsnap a on h.snapid = a.id
         left join warning2 w on a.alertvalue = w.ednavalue
         and a.modelid = w.modelid
         <where>
             and a.category1 = 'windturbine'
             and h.messagetype = '1'
-
+            and
             <if test="starttime !=null and endtime !=null">
                 h.alerttime  &gt;= #{starttime,jdbcType=DATE} and h.alerttime  &lt; #{endtime,jdbcType=DATE}
             </if>