Browse Source

添加告警参数属性

lihui001 3 years ago
parent
commit
6a08eac9a3

+ 30 - 30
zoniot-water/zoniot-water-core/src/main/java/com/bz/zoneiot/water/core/mapper/HomePageReportMapper.xml

@@ -18,7 +18,7 @@
         and dp.PARM_TYPE = #{dto.parmType} and st.SCENE_TYPE_NAME = #{dto.sceneType}
         and r.year*12 + r.month >=  year(CURDATE())*12 + month(CURDATE()) - 5
         <if test="user.userType!=null and user.userType!=-999 and user.userType!=-9999 and  user.programItems != null and user.programItems.size() > 0">
-            <if test="user.permissonType == 5 or user.permissonType == 2">
+            <if test="user.permissionType == 5 or user.permissionType == 2">
                 and ( s.DEPT_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
@@ -30,13 +30,13 @@
                 </foreach>
                 )
             </if>
-            <if test="user.permissonType == 4 or user.permissonType == 3">
+            <if test="user.permissionType == 4 or user.permissionType == 3">
                 and s.DEPT_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
                 </foreach>
             </if>
-            <if test="user.permissonType == 1">
+            <if test="user.permissionType == 1">
                 and s.COMPANY_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
@@ -65,7 +65,7 @@
          </if>
         and s.TENANT_ID=#{user.tenantId}
         <if test="user.userType!=null and user.userType!=-999 and user.userType!=-9999 and  user.programItems != null and user.programItems.size() > 0">
-            <if test="user.permissonType == 5 or user.permissonType == 2">
+            <if test="user.permissionType == 5 or user.permissionType == 2">
                 and ( s.DEPT_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
@@ -77,13 +77,13 @@
                 </foreach>
                 )
             </if>
-            <if test="user.permissonType == 4 or user.permissonType == 3">
+            <if test="user.permissionType == 4 or user.permissionType == 3">
                 and s.DEPT_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
                 </foreach>
             </if>
-            <if test="user.permissonType == 1">
+            <if test="user.permissionType == 1">
                 and s.COMPANY_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
@@ -137,7 +137,7 @@
             </if>
             and ps.TENANT_ID=#{user.tenantId}
             <if test="user.userType!=null and user.userType!=-999 and user.userType!=-9999 and  user.programItems != null and user.programItems.size() > 0">
-            <if test="user.permissonType == 5 or user.permissonType == 2">
+            <if test="user.permissionType == 5 or user.permissionType == 2">
                 and ( s.DEPT_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
@@ -149,13 +149,13 @@
                 </foreach>
                 )
             </if>
-            <if test="user.permissonType == 4 or user.permissonType == 3">
+            <if test="user.permissionType == 4 or user.permissionType == 3">
                 and s.DEPT_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
                 </foreach>
             </if>
-            <if test="user.permissonType == 1">
+            <if test="user.permissionType == 1">
                 and s.COMPANY_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
@@ -191,7 +191,7 @@
             </if>
             and s.TENANT_ID =#{user.tenantId}
             <if test="user.userType!=null and user.userType!=-999 and user.userType!=-9999 and  user.programItems != null and user.programItems.size() > 0">
-                <if test="user.permissonType == 5 or user.permissonType == 2">
+                <if test="user.permissionType == 5 or user.permissionType == 2">
                     and ( s.DEPT_ORG_ID in
                     <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                         #{item.orgId}
@@ -203,13 +203,13 @@
                     </foreach>
                     )
                 </if>
-                <if test="user.permissonType == 4 or user.permissonType == 3">
+                <if test="user.permissionType == 4 or user.permissionType == 3">
                     and s.DEPT_ORG_ID in
                     <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                         #{item.orgId}
                     </foreach>
                 </if>
-                <if test="user.permissonType == 1">
+                <if test="user.permissionType == 1">
                     and s.COMPANY_ORG_ID in
                     <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                         #{item.orgId}
@@ -237,7 +237,7 @@
         and dp.TENANT_ID=#{user.tenantId}
         and r.COLLECT_DATE >= DATE_SUB(CURDATE(),INTERVAL 14 day)
         <if test="user.userType!=null and user.userType!=-999 and user.userType!=-9999 and  user.programItems != null and user.programItems.size() > 0">
-            <if test="user.permissonType == 5 or user.permissonType == 2">
+            <if test="user.permissionType == 5 or user.permissionType == 2">
                 and ( s.DEPT_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
@@ -249,13 +249,13 @@
                 </foreach>
                 )
             </if>
-            <if test="user.permissonType == 4 or user.permissonType == 3">
+            <if test="user.permissionType == 4 or user.permissionType == 3">
                 and s.DEPT_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
                 </foreach>
             </if>
-            <if test="user.permissonType == 1">
+            <if test="user.permissionType == 1">
                 and s.COMPANY_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
@@ -288,7 +288,7 @@
         and st.SCENE_TYPE_NAME = #{dto.sceneType}
         and s.TENANT_ID=#{user.tenantId}
         <if test="user.userType != null and user.userType!=-999 and user.userType != -9999 and  user.programItems != null and user.programItems.size() > 0">
-            <if test="user.permissonType == 5 or user.permissonType == 2">
+            <if test="user.permissionType == 5 or user.permissionType == 2">
                 and ( s.DEPT_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
@@ -300,13 +300,13 @@
                 </foreach>
                 )
             </if>
-            <if test="user.permissonType == 4 or user.permissonType == 3">
+            <if test="user.permissionType == 4 or user.permissionType == 3">
                 and s.DEPT_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
                 </foreach>
             </if>
-            <if test="user.permissonType == 1">
+            <if test="user.permissionType == 1">
                 and s.COMPANY_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
@@ -343,7 +343,7 @@
         and st.SCENE_TYPE_NAME = #{dto.sceneType}
         and s.TENANT_ID=#{user.tenantId}
         <if test="user.userType!=null and user.userType!=-999 and user.userType!=-9999 and  user.programItems != null and user.programItems.size() > 0">
-            <if test="user.permissonType == 5 or user.permissonType == 2">
+            <if test="user.permissionType == 5 or user.permissionType == 2">
                 and ( s.DEPT_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     <if test="item.orgId != null">
@@ -359,7 +359,7 @@
                 </foreach>
                 )
             </if>
-            <if test="user.permissonType == 4 or user.permissonType == 3">
+            <if test="user.permissionType == 4 or user.permissionType == 3">
                 and s.DEPT_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     <if test="item.orgId != null">
@@ -367,7 +367,7 @@
                     </if>
                 </foreach>
             </if>
-            <if test="user.permissonType == 1">
+            <if test="user.permissionType == 1">
                 and s.COMPANY_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     <if test="item.orgId != null">
@@ -402,7 +402,7 @@
         and st.SCENE_TYPE_NAME = #{dto.sceneType}
         and dp.TENANT_ID=#{user.tenantId}
         <if test="user.userType!=null and user.userType!=-999 and user.userType!=-9999 and  user.programItems != null and user.programItems.size() > 0">
-            <if test="user.permissonType == 5 or user.permissonType == 2">
+            <if test="user.permissionType == 5 or user.permissionType == 2">
                 and ( s.DEPT_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
@@ -414,13 +414,13 @@
                 </foreach>
                 )
             </if>
-            <if test="user.permissonType == 4 or user.permissonType == 3">
+            <if test="user.permissionType == 4 or user.permissionType == 3">
                 and s.DEPT_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
                 </foreach>
             </if>
-            <if test="user.permissonType == 1">
+            <if test="user.permissionType == 1">
                 and s.COMPANY_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
@@ -449,7 +449,7 @@
             and s.COMPANY_ORG_ID = #{dto.companyOrgId}
         </if>
         <if test="user.userType != null and user.userType != -999 and user.userType!=-9999 and  user.programItems != null and user.programItems.size() > 0">
-            <if test="user.permissonType == 5 or user.permissonType == 2">
+            <if test="user.permissionType == 5 or user.permissionType == 2">
                 and ( s.DEPT_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
@@ -461,13 +461,13 @@
                 </foreach>
                 )
             </if>
-            <if test="user.permissonType == 4 or user.permissonType == 3">
+            <if test="user.permissionType == 4 or user.permissionType == 3">
                 and s.DEPT_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
                 </foreach>
             </if>
-            <if test="user.permissonType == 1">
+            <if test="user.permissionType == 1">
                 and s.COMPANY_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
@@ -542,7 +542,7 @@
             and s.COMPANY_ORG_ID = #{dto.companyOrgId}
         </if>
         <if test="user.userType != null and user.userType != -999 and user.userType!=-9999 and  user.programItems != null and user.programItems.size() > 0">
-            <if test="user.permissonType == 5 or user.permissonType == 2">
+            <if test="user.permissionType == 5 or user.permissionType == 2">
                 and ( s.DEPT_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
@@ -554,13 +554,13 @@
                 </foreach>
                 )
             </if>
-            <if test="user.permissonType == 4 or user.permissonType == 3">
+            <if test="user.permissionType == 4 or user.permissionType == 3">
                 and s.DEPT_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}
                 </foreach>
             </if>
-            <if test="user.permissonType == 1">
+            <if test="user.permissionType == 1">
                 and s.COMPANY_ORG_ID in
                 <foreach collection="user.programItems" item="item" open="(" close=")" separator=",">
                     #{item.orgId}

+ 1 - 1
zoniot-water/zoniot-water-web/src/main/java/com/bz/zoneiot/water/web/service/impl/AlarmTypeServiceImpl.java

@@ -228,7 +228,7 @@ public class AlarmTypeServiceImpl implements AlarmTypeService {
             alarmRule.setAlarmTypeId(alarmType.getId());
             // 生成规则表达式  = < > ≤ ≥ ≠
             String expression = "";
-            if (alarmRule.getMeasuringDataType() == 1) {
+            if (alarmRule.getMeasuringDataType() != null && alarmRule.getMeasuringDataType() == 1) {
                 if (StringUtils.equals("=", alarmRule.getOperator())) {
                     expression = "data['"+alarmRule.getMeasuringCode()+"'] == \"" + alarmRule.getValue() + "\"";
                 }