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

import com.jeeplus.core.persistence.Page;
import com.jeeplus.core.service.CrudService;
import com.jeeplus.modules.sg.managementcenter.moduleacquisition.entity.ModuleBlockVersion;
import com.jeeplus.modules.sg.managementcenter.moduleacquisition.mapper.ModuleBlockVersionMapper;
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 ModuleBlockVersionService extends CrudService<ModuleBlockVersionMapper, ModuleBlockVersion> {
	@Autowired
	private ModuleBlockVersionMapper moduleBlockVersionMapper;

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

	//查找最近一次版本信息
	public ModuleBlockVersion findMaxVersion(){
		return moduleBlockVersionMapper.findMaxVersion();
	}

	//查找所有版本信息
	public List<ModuleBlockVersion> findAllVersion(){
		return moduleBlockVersionMapper.findAllVersion();
	}

	//根据版本名称查询版本id
	public ModuleBlockVersion findById(ModuleBlockVersion materialBlockVersion){
		return moduleBlockVersionMapper.findById(materialBlockVersion);
	}

	//根据版本id查找版本名称
	public ModuleBlockVersion findByName(ModuleBlockVersion moduleBlockVersion){
		return moduleBlockVersionMapper.findByName(moduleBlockVersion);
	}
}