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

import com.jeeplus.core.persistence.Page;
import com.jeeplus.core.service.CrudService;
import com.jeeplus.modules.sg.audit.record.entity.Record;
import com.jeeplus.modules.sg.audit.record.mapper.RecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 项目管理Service
 * @author
 * @version
 */
@Service
@Transactional(readOnly = true)
public class RecordService extends CrudService<RecordMapper, Record> {

	@Autowired
	private RecordMapper recordMapper;

	public Record get(String id) {
		Record record = super.get(id);
		return record;
	}

	public List<Record> findList(Record record) {
		return super.findList(record);
	}

	public Page<Record> findPage(Page<Record> page, Record entity) {
		return super.findPage(page, entity);
	}

	@Override
	public List<Record> findListBy(List<Record> entity) {
		return super.findListBy(entity);
	}

	@Transactional(readOnly = false)
	public void save(Record entity) {
		entity.preInsert();
		recordMapper.insert(entity);
	}

}