package com.yeejoin.amos.fas.business.dao.repository;

import com.yeejoin.amos.fas.dao.entity.PlanDetail;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.List;

/**
 * <h1><h1>
 *
 * @author tiantao
 * @date 2021/1/15 10:35
 */
@Repository
public interface IPlanDetailDao extends BaseDao<PlanDetail, Long> {

    @Query(value="SELECT * from c_plan_detail where status in (?1) AND is_delete = 0 ", nativeQuery = true)
    List<PlanDetail> findByStatus(Integer[] status);

    List<PlanDetail> getPlanDetailsByIdInAndIsDelete(List<Long> idList, Boolean isDelete);

    boolean existsByClassifyIdInAndIsDelete(Collection<Long> classifyList, Boolean isDelete);
}
