whyclxw
2024-12-17 80b696d123cd39860dc1cc18be015c79c03a2f87
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
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 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,"查询最近的开锁日志");
    }
}