package com.zhgd.xmgl.modules.basicdata.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.mybatis.EntityMap;
import com.zhgd.xmgl.modules.basicdata.entity.OperationLog;
import com.zhgd.xmgl.modules.basicdata.mapper.OperationLogMapper;
import com.zhgd.xmgl.modules.basicdata.service.IOperationLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Description: 操作日志表
 * @author： pds
 * @date：   2021-05-07
 * @version： V1.0
 */
@Service
public class OperationLogServiceImpl extends ServiceImpl<OperationLogMapper, OperationLog> implements IOperationLogService {
    @Autowired
    private OperationLogMapper operationLogMapper;


    @Override
    public IPage<EntityMap> selectOperationLogPage(Map<String, Object> param) {
//        Map<String,Object> map=enterpriseService.getCompanyType(param);
        Map<String,Object> map=new HashMap<>();
        int pageNo = Integer.parseInt(map.getOrDefault("pageNo", 1).toString());
        int pageSize = Integer.parseInt(map.getOrDefault("pageSize", 10).toString());
        Page<EntityMap> page = new Page<>(pageNo, pageSize);
        List<EntityMap> list=operationLogMapper.selectOperationLogPage(page, map);
        return page.setRecords(list);
    }
}
