package com.uas.platform.b2b.dao;


import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.uas.platform.b2b.model.BarSendNotify;

@Repository
public interface BarSendNotifyDao extends JpaSpecificationExecutor<BarSendNotify>, JpaRepository<BarSendNotify, Long> {
    
	/**
	 * 根据ssid查询数据
	 * @param ssid
	 * @return
	 */
	@Query("from BarSendNotify s where  s.ssid = :ssid")
	public List<BarSendNotify> findBySsid(@Param("ssid") long ssid);
	
	/**
	 * 根据发送状态和客户UU号上传BarSendNotify
	 * @param sendStatus
	 * @return
	 */
	@Query("from BarSendNotify s where  s.saleSendItem.send.custUU = :custUU and s.sendStatus = :sendStatus")
	public List<BarSendNotify> findByCustUUAndSendStatus(@Param("custUU") Long custUU, @Param("sendStatus") Short sendStatus);
}
