liuxm
2024-06-13 f823fa4a9283debfa7cb6d79fc1f3c7099f9b3ae
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
43
44
45
46
47
48
package com.dy.pmsBase.log;
 
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pmsGlobal.daoBa.BaLogMapper;
import com.dy.pmsGlobal.pojoBa.BaLog;
import org.apache.dubbo.common.utils.PojoUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.Date;
import java.util.List;
import java.util.Map;
 
@Service
public class LogSv {
 
    @Autowired
    private BaLogMapper dao;
 
    /**
     * 得到日志
     *
     * @param id 日志ID
     * @return 实体
     */
    public BaLog selectById(Long id) {
        return dao.selectByPrimaryKey(id);
    }
 
 
    /**
     * 获取日志列表
     */
    public QueryResultVo<List<BaLog>> selectSome(QueryVo queryVo) {
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo);
 
        //查询符合条件的记录总数
        Long itemTotal = dao.selectSomeCount(params);
 
        QueryResultVo<List<BaLog>> rsVo = new QueryResultVo<>(queryVo.pageSize, queryVo.pageCurr) ;
        //计算分页等信息
        rsVo.calculateAndSet(itemTotal, params);
 
        //查询符合条件的记录
        rsVo.obj = this.dao.selectSome(params) ;
        return rsVo ;
    }
}