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

import java.util.List;

import com.jeeplus.modules.workattendance.entity.WorkAttendanceRule;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeeplus.common.persistence.Page;
import com.jeeplus.common.service.CrudService;
import com.jeeplus.modules.workattendance.entity.WorkAttendancePlace;
import com.jeeplus.modules.workattendance.dao.WorkAttendancePlaceDao;

/**
 * 考勤地点Service
 * @author 杨帆
 * @version 2018-09-05
 */
@Service
@Transactional(readOnly = true)
public class WorkAttendancePlaceService extends CrudService<WorkAttendancePlaceDao, WorkAttendancePlace> {

	public WorkAttendancePlace get(String id) {
		return super.get(id);
	}
	public List<WorkAttendancePlace> getByRuleId(String ruleId) {
		WorkAttendancePlace workAttendancePlace = new WorkAttendancePlace();
		workAttendancePlace.setWorkAttendanceRule(new WorkAttendanceRule(ruleId));
		return dao.getByRuleId(workAttendancePlace);
	}

	public List<WorkAttendancePlace> findList(WorkAttendancePlace workAttendancePlace) {
		return super.findList(workAttendancePlace);
	}
	
	public Page<WorkAttendancePlace> findPage(Page<WorkAttendancePlace> page, WorkAttendancePlace workAttendancePlace) {
		return super.findPage(page, workAttendancePlace);
	}
	
	@Transactional(readOnly = false)
	public void save(WorkAttendancePlace workAttendancePlace) {
		super.save(workAttendancePlace);
	}

	@Transactional(readOnly = false)
	public void insert(WorkAttendancePlace workAttendancePlace) {
		dao.insert(workAttendancePlace);
	}
	
	@Transactional(readOnly = false)
	public void delete(WorkAttendancePlace workAttendancePlace) {
		super.delete(workAttendancePlace);
	}
	@Transactional(readOnly = false)
	public void deleteByRuleId(String ruleId) {
		WorkAttendancePlace workAttendancePlace = new WorkAttendancePlace();
		workAttendancePlace.setWorkAttendanceRule(new WorkAttendanceRule(ruleId));
		dao.deleteByRuleId(workAttendancePlace);
	}

	
	
	
}