package com.ag.rate.account.dao;

import com.ag.base.IBaseRepository;
import com.ag.entity.fee.AccountPoints;
import org.springframework.stereotype.Repository;

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

/**
 * Created by Administrator on 2017/5/15 0015.
 */
@Repository
public class AccountPointsDao {
    @Resource(name="baseRepositoryImpl")
    private IBaseRepository<AccountPoints> pointRepo;

    public int delete(AccountPoints delAP) {
        return pointRepo.delete(delAP, "POINT_CODE", "TENANCY_ID");
    }

    public int[] save(List<AccountPoints> accountPoints) {
        return pointRepo.saveAll(accountPoints);
    }

    public List<AccountPoints> findByPointId(AccountPoints point) {
        return pointRepo.findByEntity(point, AccountPoints.class);
    }

    public int[] delete(List<AccountPoints> list) {
        return pointRepo.deleteAll(list, "ID");
    }
}
