Browse Source

通信设备相关接口更新2

jichaobo 3 years ago
parent
commit
b4d5c3523f

+ 4 - 4
fiveep-controller/src/main/java/com/bizmatics/controller/web/DeviceController.java

@@ -139,14 +139,14 @@ public class DeviceController {
      * 设备管理-通信设备-查询
      *
      * @param deviceName 设备名称
-     * @param size       
-     * @param current    
+     * @param size       
+     * @param current    
      * @return
      */
     @GetMapping("correspondDeviceList")
     public ApiResult<CommonPage<CorrespondDeviceVO>> correspondDeviceList(@RequestParam(required = false) String deviceName,
-                                                                          @RequestParam(value = "size", required = false, defaultValue = "1") int size,
-                                                                          @RequestParam(value = "current", required = false, defaultValue = "10") int current) {
+                                                                          @RequestParam(value = "size", required = false, defaultValue = "15") int size,
+                                                                          @RequestParam(value = "current", required = false, defaultValue = "1") int current) {
         return ApiResult.success(deviceService.correspondDeviceList(deviceName, size, current));
     }
 

+ 1 - 1
fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/DeviceMapper.java

@@ -47,7 +47,7 @@ public interface DeviceMapper extends CrudMapper<Device> {
 
     List<CorrespondDeviceVO> CorrespondDeviceList(@Param("deviceName") String deviceName,
                                                   @Param("startCurrent") Integer startCurrent,
-                                                  @Param("current") Integer current);
+                                                  @Param("size") Integer size);
 
 
 }

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

@@ -128,8 +128,8 @@
             </if>
         </where>
         order by a.id desc
-        <if test="current != null and current != 0 and startCurrent != null">
-            LIMIT #{startCurrent},#{current}
+        <if test="size != null and size != 0 and startCurrent != null">
+            LIMIT #{startCurrent},#{size}
         </if>
 
     </select>

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

@@ -173,9 +173,9 @@ public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device>
         if (correspondDeviceListOne.size() > 0) {
             total = correspondDeviceListOne.size();
         }
-        int startCurrent = (size - 1) * current;
-        List<CorrespondDeviceVO> correspondDeviceList = baseMapper.CorrespondDeviceList(deviceName, startCurrent, current);
-        return new CommonPage<>(correspondDeviceList, total, current, size);
+        int startCurrent = (current - 1) * size;
+        List<CorrespondDeviceVO> correspondDeviceList = baseMapper.CorrespondDeviceList(deviceName, startCurrent, size);
+        return new CommonPage<>(correspondDeviceList, total, size, current);
     }
 
     @Override