package com.qmth.themis.business.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qmth.themis.business.dao.TBClientVersionMapper;
import com.qmth.themis.business.entity.TBClientVersion;
import com.qmth.themis.business.service.TBClientVersionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @Description: 客户端版本 服务实现类
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2020/6/25
 */
@Service
public class TBClientVersionServiceImpl extends ServiceImpl<TBClientVersionMapper, TBClientVersion> implements TBClientVersionService {

    @Resource
    TBClientVersionMapper tbClientVersionMapper;

    /**
     * 客户端版本查询
     *
     * @param iPage
     * @return
     */
    @Override
    public IPage<TBClientVersion> clientVersionQuery(IPage<Map> iPage) {
        return tbClientVersionMapper.clientVersionQuery(iPage);
    }

    /**
     * 获取客户端最大版本号
     *
     * @return
     */
    @Override
    public TBClientVersion getMaxClientVersion() {
        return tbClientVersionMapper.getMaxClientVersion();
    }

    /**
     * 根据学校id获取客户端自行上传的版本
     *
     * @param orgId
     * @return
     */
    @Override
    public TBClientVersion getLastUploadClientVersion(Long orgId) {
        return tbClientVersionMapper.getLastUploadClientVersion(orgId);
    }
}
