Commit e6f308ee authored by ma's avatar ma

用户列表排序

parent 35127506
......@@ -45,7 +45,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
throw new IotLicenseException(ResultCode.VALIDATE_FAILED.getCode(), ResultCode.VALIDATE_FAILED.getMsg());
}
List<UserVo> records = userMapper.getUserList(userName, company, userIds);
records = records.stream().sorted(Comparator.comparing(UserVo::getCreateTime, Comparator.reverseOrder())).collect(Collectors.toList());
records = records.stream().sorted(Comparator.comparing(UserVo::getCreateTime, Comparator.reverseOrder())).sorted(Comparator.comparing(UserVo::getLevel)).collect(Collectors.toList());
List<UserVo> result = new ArrayList<>();
int begin = (pageNo - 1) * pageSize;
if (begin >= 0 && records.size() > 0) {
......
......@@ -15,7 +15,7 @@
</update>
<select id="getUserList" resultType="iot.sixiang.license.model.vo.UserVo">
SELECT user.user_id, user_name, password, company, user.create_time, user.update_time,
SELECT user.user_id, user_name, password, company, user.level, user.create_time, user.update_time,
COUNT(device.`device_id`) totalDevice,
COUNT(if(device.device_id is NOT NULL, if (device.`status` = 0 or device.`status` is NULL, 1, NULL), NULL))
unUseDevice,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment