package com.zcxk.service;

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.zcxk.dao.VerManageMapper;

import com.zcxk.entity.*;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;

import java.util.*;


/**
 *
 * APP版本Service接口
 * @author: yjy
 * @date 2021-5-13
 */
@Service
public class VerManageService extends ServiceImpl<VerManageMapper, VerManageEntity> {
	@Autowired
	private VerManageMapper verManageMapper;

	public VerManageEntity selectVer(){
		VerManageEntity res=null;
		List<VerManageEntity> list=this.list();
		if(list.size()>0){
			res=list.get(0);
		}
		return res;
	}

	public Page<VerManageEntity> findVerManage(IPage<VerManageEntity> page,String verId, String productType){
		return verManageMapper.findVerManage(page, verId, productType);
	}

	public List<VerManageEntity> getUpgradeVer(String productType){
		return verManageMapper.getUpgradeVer(productType);
	}

	public int insertSelective(VerManageEntity verManageEntity){
		return verManageMapper.insertSelective(verManageEntity);
	}

	public int updateByPrimaryKeySelective(VerManageEntity verManageEntity){
		return verManageMapper.updateByPrimaryKeySelective(verManageEntity);
	}

	public int deleteSelective(List<String> ids){
		return verManageMapper.deleteSelective(ids);
	}
}
