wei.zhou

提交代码

package com.erry.iclear.dateInterface.repository;
import com.erry.iclear.dateInterface.entity.ChmConsignment;
import com.erry.iclear.dateInterface.entity.ChmConsignmentDetail;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
/**
* @author Administrator
*/
public interface ChmConsignmentDetailRepository extends JpaSpecificationExecutor<ChmConsignmentDetail>, JpaRepository<ChmConsignmentDetail, Long> {
/**
* 根据主单ID查找
* @param consignmentId
* @return
*/
@Query( nativeQuery = true,value ="select * from T_CHM_CONSIGNMENT_DETAIL where CONSIGNMENT_ID = ?1 " )
public List<ChmConsignmentDetail> findChmConsignmentDetailByConsignmentCode(Long consignmentId);
@Modifying
@Query("delete from ChmConsignmentDetail detail where detail.id IN(:chmConIdList)")
public void deleteChmConsignmentDetailByChnConIdList(@Param("chmConIdList") List chmConIdList);
}