Selaa lähdekoodia

测试bug修改

yq 4 vuotta sitten
vanhempi
commit
8f2ea09cbd

+ 3 - 3
fiveep-persistence/src/main/resources/mapper/mysql/AlarmPowerMapper.xml

@@ -28,13 +28,13 @@
         on d.device_code = ap.device_code
         <where>
             <if test="userId != null and userId != 0">
-                us.user_id = #{userId}
+                and us.user_id = #{userId}
             </if>
             <if test="siteId != null and siteId != 0">
-                us.site_id = #{siteId}
+                and us.site_id = #{siteId}
             </if>
             <if test="handlingStatus != null">
-                ap.handling_status = #{handlingStatus}
+                and ap.handling_status = #{handlingStatus}
             </if>
         </where>
     </select>

+ 5 - 5
fiveep-persistence/src/main/resources/mapper/mysql/DeviceMapper.xml

@@ -21,19 +21,19 @@
         on us.site_id = ds.site_id
         <where>
             <if test="userId != null and userId != 0">
-                us.user_id = #{userId}
+                and us.user_id = #{userId}
             </if>
             <if test="siteId != null and siteId != 0">
-                us.site_id = #{siteId}
+                and us.site_id = #{siteId}
             </if>
             <if test="deviceStatus != null">
-                ds.device_status = #{deviceStatus}
+                and ds.device_status = #{deviceStatus}
             </if>
             <if test="startTime != null">
-                ds.status_time >= #{startTime}
+                and ds.status_time >= #{startTime}
             </if>
             <if test="endTime != null">
-                ds.status_time &lt;= #{endTime}
+                and ds.status_time &lt;= #{endTime}
             </if>
         </where>
     </select>

+ 6 - 6
fiveep-persistence/src/main/resources/mapper/mysql/HtAnalogDataMapper.xml

@@ -80,13 +80,13 @@
         on d.device_code = had.deviceName
         <where>
             <if test="userId != null and userId != 0">
-                us.user_id = #{userId}
+                and us.user_id = #{userId}
             </if>
             <if test="siteId != null and siteId != 0">
-                us.site_id = #{siteId}
+                and us.site_id = #{siteId}
             </if>
             <if test="endTime != null">
-                had.dataTime &lt;= #{endTime}
+                and had.dataTime &lt;= #{endTime}
             </if>
         </where>
         order dataTime desc limit 0,1
@@ -102,13 +102,13 @@
         on d.device_code = had.deviceName
         <where>
             <if test="userId != null and userId != 0">
-                us.user_id = #{userId}
+                and us.user_id = #{userId}
             </if>
             <if test="siteId != null and siteId != 0">
-                us.site_id = #{siteId}
+                and us.site_id = #{siteId}
             </if>
             <if test="startTime != null">
-                had.dataTime >= #{startTime}
+                and had.dataTime >= #{startTime}
             </if>
         </where>
         order dataTime asc limit 0,1

+ 2 - 2
fiveep-persistence/src/main/resources/mapper/mysql/RtAnalogDataMapper.xml

@@ -78,10 +78,10 @@
         on d.device_code = rad.deviceName
         <where>
             <if test="userId != null and userId != 0">
-                us.user_id = #{userId}
+                and us.user_id = #{userId}
             </if>
             <if test="siteId != null and siteId != 0">
-                us.site_id = #{siteId}
+                and us.site_id = #{siteId}
             </if>
         </where>
     </select>

+ 4 - 4
fiveep-persistence/src/main/resources/mapper/mysql/SiteMapper.xml

@@ -26,13 +26,13 @@
         on us.site_Id = ds.site_id
         <where>
             <if test="userId != null and userId != 0">
-                us.user_id = #{userId}
+                and us.user_id = #{userId}
             </if>
             <if test="siteId != null and siteId != 0">
-                us.site_id = #{siteId}
+                and us.site_id = #{siteId}
             </if>
             <if test="siteStatus != null">
-                ds.device_status = #{siteStatus}
+                and ds.device_status = #{siteStatus}
             </if>
         </where>
     </select>
@@ -44,7 +44,7 @@
         on us.site_id = s.id
         <where>
             <if test="userId != null and userId != 0">
-                us.user_id = #{userId}
+                and us.user_id = #{userId}
             </if>
         </where>
     </select>

+ 3 - 2
fiveep-service/src/main/java/com/bizmatics/service/impl/AlarmPowerServiceImpl.java

@@ -31,10 +31,11 @@ public class AlarmPowerServiceImpl extends AbstractCrudService<AlarmPowerMapper,
 
     @Override
     public ApCountVO selectCount() {
-        Integer count = baseMapper.selectCount(SessionLocal.getUserId(),null,null);
+        Integer userId = SessionLocal.getUserId();
+        Integer count = baseMapper.selectCount(userId,null,null);
         ApCountVO apCountVo = new ApCountVO();
         apCountVo.setCount(count);
-        apCountVo.setUnCount(baseMapper.selectCount(SessionLocal.getUserId(),null,0));
+        apCountVo.setUnCount(baseMapper.selectCount(userId,null,0));
         return apCountVo;
     }
 

+ 1 - 1
fiveep-service/src/main/java/com/bizmatics/service/util/SessionLocal.java

@@ -37,6 +37,6 @@ public class SessionLocal {
     }
 
     public static Integer getUserId(){
-       return Optional.ofNullable(getUser()).map(user -> getUserId()).orElseThrow(() ->new BusinessException(BIZ_LACK_NECESSARY_PARAM_ERROR,"用户未登录"));
+        return Optional.ofNullable(getUser()).map(User::getId).orElseThrow(() ->new BusinessException(BIZ_LACK_NECESSARY_PARAM_ERROR,"用户未登录"));
     }
 }