package com.service.impl;

import com.dao.DonationTypeMapper;
import com.entity.DonationType;
import com.service.DonationTypeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class DonationTypeServiceImpl implements DonationTypeService {
	@Resource
    private DonationTypeMapper donationTypeMapper;

	@Override
	public int add(DonationType po) {
		return donationTypeMapper.insertSelective(po);
	}
	@Override
	public int update(DonationType po) {
		return donationTypeMapper.updateByPrimaryKeySelective(po);
	}
	@Override
	public int delete(int id) {
		return donationTypeMapper.deleteByPrimaryKey(id);
	}
	@Override
	public List<DonationType> getAll(Map<String, Object> map) {
		return donationTypeMapper.getAll(map);
	}
	@Override
	public DonationType checkName(Map<String, Object> account) {
		return donationTypeMapper.checkName(account);
	}
	@Override
	public List<DonationType> getByPage(Map<String, Object> map) {
		return donationTypeMapper.getByPage(map);
	}
	@Override
	public int getCount(Map<String, Object> po) {
		return donationTypeMapper.getCount(po);
	}
	@Override
	public DonationType getById(int id) {
		return donationTypeMapper.selectByPrimaryKey(id);
	}

}
