whyclxw
2025-01-08 e8a78b6fa6a8e4f752155c7b297318d6c8e42e82
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
38
39
40
41
42
package com.whyc.service;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
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_lock_ram.LockCtlLog;
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,Integer logResult,int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        QueryWrapper wrapper=new QueryWrapper();
        if(lockId!=null){
            wrapper.eq("lock_id",lockId);
        }
        if(logResult!=null){
            wrapper.eq("ctl_result",logResult);
        }
        wrapper.orderByDesc("ctl_time");
        List<LockInf> list=mapper.selectList(wrapper);
        PageInfo pageInfo=new PageInfo(list);
        return new Response().setII(1,list!=null,pageInfo,"查询最近的开锁日志");
    }
    //获取开锁错误的日志
    public List getAllErrorLog(List lockIds) {
        List<LockCtlLog> list=mapper.getAllErrorLog(lockIds);
        return list;
    }
}