whyclxw
2025-01-08 cda74cda7ece9e046b0350a22017567a90702001
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.whyc.service;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageInfo;
import com.whyc.dto.Response;
import com.whyc.mapper.LockCtlLogMapper;
import com.whyc.pojo.db_area.LockInf;
import com.whyc.pojo.db_user.UserInf;
import com.whyc.util.ActionUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
@Service
public class LockCtlLogService {
    @Autowired(required = false)
    private LockCtlLogMapper mapper;
 
    //查询最近的开锁日志
    public Response getLockLog(Integer lockId) {
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.eq("lock_id",lockId);
        wrapper.orderByDesc("ctl_time");
        wrapper.last("limit 20");
        List<LockInf> list=mapper.selectList(wrapper);
        return new Response().setII(1,list!=null,list,"查询最近的开锁日志");
    }
    //获取锁的日志
    public List getAllLog(List lockIds) {
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.in("lock_id",lockIds);
        wrapper.orderByDesc("ctl_time");
        List<LockInf> list=mapper.selectList(wrapper);
        return list;
    }
}