jishenghua 9 месяцев назад
Родитель
Сommit
998e67ec4b

+ 0 - 1
gyj-iot-boot/gyjiot-open-api/src/main/java/com/gyjiot/data/controller/media/SipDeviceChannelController.java

@@ -39,7 +39,6 @@ public class SipDeviceChannelController extends BaseController
     @GetMapping("/list")
     public TableDataInfo list(SipDeviceChannel sipDeviceChannel)
     {
-        startPage();
         List<SipDeviceChannel> list = sipDeviceChannelService.selectSipDeviceChannelList(sipDeviceChannel);
         return getDataTable(list);
     }

+ 4 - 6
gyj-iot-boot/gyjiot-server/sip-server/src/main/java/com/gyjiot/sip/service/impl/SipDeviceChannelServiceImpl.java

@@ -1,9 +1,9 @@
 package com.gyjiot.sip.service.impl;
 
-import com.gyjiot.common.core.domain.entity.SysUser;
 import com.gyjiot.common.core.redis.RedisCache;
 import com.gyjiot.common.core.redis.RedisKeyBuilder;
 import com.gyjiot.common.utils.DateUtils;
+import com.gyjiot.common.utils.PageUtils;
 import com.gyjiot.iot.domain.Product;
 import com.gyjiot.iot.service.IProductService;
 import com.gyjiot.sip.domain.SipDevice;
@@ -23,8 +23,6 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
-import static com.gyjiot.common.utils.SecurityUtils.getLoginUser;
-
 /**
  * 监控设备通道信息Service业务层处理
  *
@@ -95,14 +93,14 @@ public class SipDeviceChannelServiceImpl implements ISipDeviceChannelService {
 //            sipDeviceChannel.setTenantId(user.getUserId());
 //        }
 //        sipDeviceChannel.setTenantId(user.getUserId());
+        PageUtils.startPage();
         List<SipDeviceChannel> list = sipDeviceChannelMapper.selectSipDeviceChannelList(sipDeviceChannel);
-        List<SipDeviceChannel> newList = new ArrayList<>();
         if (list != null && list.size() > 0) {
             for (SipDeviceChannel channel : list) {
-                newList.add(updateChannelStatus(channel));
+                updateChannelStatus(channel);
             }
         }
-        return newList;
+        return list;
     }
 
     public SipDeviceChannel updateChannelStatus(SipDeviceChannel channel) {

+ 3 - 3
gyj-iot-boot/gyjiot-service/gyjiot-iot-service/src/main/resources/mapper/iot/DeviceMapper.xml

@@ -167,7 +167,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="networkAddress != null  and networkAddress != ''"> and network_address like concat('%', #{networkAddress}, '%')</if>
             <if test="params.beginActiveTime != null and params.beginActiveTime != '' and params.endActiveTime != null and params.endActiveTime != ''"> and active_time between #{params.beginActiveTime} and #{params.endActiveTime}</if>
         </where>
-        order by create_time desc
+        order by is_sys desc, create_time desc
     </select>
 
     <select id="selectUnAuthDeviceList" parameterType="com.gyjiot.iot.domain.Device" resultMap="DeviceResult">
@@ -248,7 +248,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select d.device_id, d.device_name, p.product_id, p.product_name,p.device_type,
             d.user_id, d.user_name, d.tenant_id, d.tenant_name, d.serial_number,d.gw_dev_code,
             d.firmware_version, d.status,d.rssi,d.is_shadow,d.is_simulate ,d.location_way,
-            d.things_model_value, d.active_time,d.create_time,d.img_url,max(u.is_owner) as is_owner,
+            d.things_model_value, d.active_time,d.create_time,d.img_url,d.is_sys, max(u.is_owner) as is_owner,
         (select count(*) from iot_device d1 where d1.gw_dev_code = d.serial_number) as sub_device_count,
         p.protocol_code,p.transport
         from iot_device d
@@ -272,7 +272,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="params.beginActiveTime != null and params.beginActiveTime != '' and params.endActiveTime != null and params.endActiveTime != ''"> and d.active_time between #{params.beginActiveTime} and #{params.endActiveTime}</if>
         </where>
         group by d.device_id,d.user_id
-        order by d.create_time desc
+        order by d.is_sys desc, d.create_time desc
     </select>
 
     <select id="selectDeviceByDeviceId" parameterType="Long" resultMap="DeviceResult">