package com.uas.finance.dao;

import com.uas.finance.model.CustomerInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 客户资料数据操作层
 * created by shicr on 2017/12/18
 **/
@Repository
public interface CustomerInfoDao extends JpaRepository<CustomerInfo, Long>, JpaSpecificationExecutor<CustomerInfo>{

    /**
     * 通过企业UU号和下载状态获取待下载的数据
     *
     * @param enuu
     * @param status
     * @return
     */
    List<CustomerInfo> findByEnuuAndErpstatus(Long enuu, Integer status);

    /**
     * 找到最新的客户资料
     * @param enuu
     * @return
     */
    List<CustomerInfo> findByEnuuOrderBySubmitTimeDesc(Long enuu);

}
