/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.sg.managementcenter.materialProvided.service;

import com.jeeplus.core.persistence.Page;
import com.jeeplus.core.service.CrudService;
import com.jeeplus.modules.sg.managementcenter.materialProvided.entity.MaterialProvided;
import com.jeeplus.modules.sg.managementcenter.materialProvided.entity.MaterialProvidedVersion;
import com.jeeplus.modules.sg.managementcenter.materialProvided.mapper.MaterialProvidedMapper;
import com.jeeplus.modules.sg.managementcenter.materialProvided.mapper.MaterialProvidedVersionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(readOnly = true)
public class MaterialProvidedVersionService extends CrudService<MaterialProvidedVersionMapper, MaterialProvidedVersion> {
	@Autowired
	private MaterialProvidedVersionMapper materialProvidedVersionMapper;

	public MaterialProvidedVersion get(String id) {
		return super.get(id);
	}
	
	public List<MaterialProvidedVersion> findList(MaterialProvidedVersion materialProvidedVersion) {
		return super.findList(materialProvidedVersion);
	}
	
	public Page<MaterialProvidedVersion> findPage(Page<MaterialProvidedVersion> page,MaterialProvidedVersion materialProvidedVersion) {
		return super.findPage(page, materialProvidedVersion);
	}
	
	@Transactional(readOnly = false)
	public void save(MaterialProvidedVersion materialProvidedVersion) {
		super.save(materialProvidedVersion);
	}
	
	@Transactional(readOnly = false)
	public void delete(MaterialProvidedVersion materialProvidedVersion) {
		super.delete(materialProvidedVersion);
	}

	//查找最大版本信息
	public MaterialProvidedVersion findMaxVersion(){
		return materialProvidedVersionMapper.findMaxVersion();
	}
	//查找所有版本信息
	public List<MaterialProvidedVersion> findAllVersion(){
		return materialProvidedVersionMapper.findAllVersion();
	}
	//根据版本名称查询版本id
	public MaterialProvidedVersion findById(MaterialProvidedVersion materialProvidedVersion){
		return materialProvidedVersionMapper.findById(materialProvidedVersion);
	}
}