李进 2 éve
szülő
commit
f126383499

+ 3 - 5
device-api-service/src/main/java/com/xy/service/DeviceLogServiceImpl.java

@@ -6,10 +6,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.xy.dto.DeviceLogDto;
 import com.xy.entity.DeviceLog;
 import com.xy.mapper.DeviceLogMapper;
-import com.xy.utils.Beans;
-import com.xy.utils.MybatisPlusQuery;
-import com.xy.utils.PageBean;
-import com.xy.utils.R;
+import com.xy.utils.*;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
@@ -44,7 +41,8 @@ public class DeviceLogServiceImpl extends ServiceImpl<DeviceLogMapper, DeviceLog
         LambdaQueryWrapper<DeviceLog> lambdaQueryWrapper = new MybatisPlusQuery().eqWrapper(page, DeviceLog.class)
                 .ge(DeviceLog::getLogBeginTime, page.getBeginLogBeginTime())
                 .le(DeviceLog::getLogBeginTime, page.getEndLogBeginTime())
-                .build();
+                .build()
+                .orderByDesc(!Emptys.check(pageBean.getOrders()), DeviceLog::getCreateTime);
         IPage<DeviceLog> iPage = page(toIPage(pageBean), lambdaQueryWrapper);
         return R.ok(toPageBean(DeviceLogDto.Vo.class, iPage));
     }