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

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

import java.util.List;

/**
 * <h1><h1>
 *
 * @author tiantao
 * @date 2021/1/15 10:36
 */
@Repository
public interface IPlanOperationRecordDao extends BaseDao<PlanOperationRecord, Long> {
    @Query(value="SELECT * from c_plan_operation_record where batch_no = ?1 AND is_delete = 0 ", nativeQuery = true)
    PlanOperationRecord findByBatchNo(String batchNo);

    @Query(value="SELECT * from c_plan_operation_record where plan_id = ?1 AND is_delete = 0 AND status = 0 ORDER BY create_date DESC", nativeQuery = true)
    List<PlanOperationRecord> findByPlanId1(Long planId);


    int countByPlanId(Long planId);

}
