wei.zhou

提交代码

1 +package com.erry.iclear.dateInterface.repository;
2 +
3 +import com.erry.iclear.dateInterface.entity.ChmConsignment;
4 +import com.erry.iclear.dateInterface.entity.ChmConsignmentDetail;
5 +import org.springframework.data.jpa.repository.JpaRepository;
6 +import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
7 +import org.springframework.data.jpa.repository.Modifying;
8 +import org.springframework.data.jpa.repository.Query;
9 +import org.springframework.data.repository.query.Param;
10 +import org.springframework.transaction.annotation.Transactional;
11 +
12 +import java.util.Date;
13 +import java.util.List;
14 +
15 +/**
16 + * @author Administrator
17 + */
18 +public interface ChmConsignmentDetailRepository extends JpaSpecificationExecutor<ChmConsignmentDetail>, JpaRepository<ChmConsignmentDetail, Long> {
19 +
20 +
21 + /**
22 + * 根据主单ID查找
23 + * @param consignmentId
24 + * @return
25 + */
26 + @Query( nativeQuery = true,value ="select * from T_CHM_CONSIGNMENT_DETAIL where CONSIGNMENT_ID = ?1 " )
27 + public List<ChmConsignmentDetail> findChmConsignmentDetailByConsignmentCode(Long consignmentId);
28 +
29 +
30 + @Modifying
31 + @Query("delete from ChmConsignmentDetail detail where detail.id IN(:chmConIdList)")
32 + public void deleteChmConsignmentDetailByChnConIdList(@Param("chmConIdList") List chmConIdList);
33 +
34 +
35 +}