/**
 * Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.extension.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeeplus.core.persistence.Page;
import com.jeeplus.core.service.CrudService;
import com.jeeplus.modules.extension.entity.FormSetting;
import com.jeeplus.modules.extension.mapper.FormSettingMapper;

/**
 * 表单只读配置Service
 * @author 刘高峰
 * @version 2019-10-17
 */
@Service
@Transactional(readOnly = true)
public class FormSettingService extends CrudService<FormSettingMapper, FormSetting> {

	public FormSetting get(String id) {
		return super.get(id);
	}

	public List<FormSetting> findList(FormSetting formSetting) {
		return super.findList(formSetting);
	}

	public Page<FormSetting> findPage(Page<FormSetting> page, FormSetting formSetting) {
		return super.findPage(page, formSetting);
	}

	@Transactional(readOnly = false)
	public void save(FormSetting formSetting) {
		super.save(formSetting);
	}

	@Transactional(readOnly = false)
	public void delete(FormSetting formSetting) {
		super.delete(formSetting);
	}

	@Transactional(readOnly = false)
	public FormSetting queryByDefIdAndTaskId(String processDefId, String taskDefId) {
		return mapper.queryByDefIdAndTaskId(processDefId, taskDefId);
	}
	@Transactional(readOnly = false)
	public void deleteByDefIdAndTaskId(FormSetting formSetting){
		mapper.deleteByDefIdAndTaskId(formSetting);
	}
	@Transactional(readOnly = false)
	public void deleteByProcessDefId(String processDefId){
		FormSetting formSetting = new FormSetting();
		formSetting.setProcessDefId(processDefId);
		mapper.deleteByProcessDefId(formSetting);
	}

}
