package com.ym.mec.biz.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ym.mec.biz.dal.dao.TenantCloudCourseRecordDao;
import com.ym.mec.biz.dal.entity.TenantCloudCourseRecord;
import com.ym.mec.biz.dal.vo.TenantCloudCourseRecordVo;
import com.ym.mec.biz.service.TenantCloudCourseRecordService;
import com.ym.mec.common.page.PageInfo;
import com.ym.mec.common.page.PageUtil;
import com.ym.mec.common.tenant.TenantContextHolder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

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

/**
 * 机构云教室课程扣费记录(TenantCloudCourseRecord)表服务实现类
 *
 * @author hgw
 * @since 2021-12-26 21:54:10
 */
@Service("tenantCloudCourseRecordService")
public class TenantCloudCourseRecordServiceImpl extends ServiceImpl<TenantCloudCourseRecordDao, TenantCloudCourseRecord> implements TenantCloudCourseRecordService {

    private final static Logger log = LoggerFactory.getLogger(TenantCloudCourseRecordServiceImpl.class);

    @Override
    public PageInfo<TenantCloudCourseRecordVo> queryPage(Map<String, Object> param) {
        Page<TenantCloudCourseRecordVo> pageInfo = PageUtil.getPageInfo(param);
        pageInfo.setDesc("a.created_time_");
        param.put("tenantId", TenantContextHolder.getTenantId());
        return PageUtil.pageInfo(baseMapper.queryPage(pageInfo, param));
    }

    @Override
    public List<TenantCloudCourseRecordVo> queryList(Map<String, Object> param) {
        return baseMapper.queryPage(param);
    }
}

