Commit 2a0d18888ae3dd396d01fe8d9baaf2d51cc2446c
1 parent
35a45502
join
Showing
2 changed files
with
16 additions
and
0 deletions
src/main/java/com/bsth/entity/schedule/EmployeeConfigInfo.java
| @@ -13,6 +13,13 @@ import java.util.Date; | @@ -13,6 +13,13 @@ import java.util.Date; | ||
| 13 | */ | 13 | */ |
| 14 | @Entity | 14 | @Entity |
| 15 | @Table(name = "bsth_c_s_ecinfo") | 15 | @Table(name = "bsth_c_s_ecinfo") |
| 16 | +@NamedEntityGraphs({ | ||
| 17 | + @NamedEntityGraph(name = "employeeConfigInfo_xl_cl", attributeNodes = { | ||
| 18 | + @NamedAttributeNode("jsy"), | ||
| 19 | + @NamedAttributeNode("spy"), | ||
| 20 | + @NamedAttributeNode("xl") | ||
| 21 | + }) | ||
| 22 | +}) | ||
| 16 | public class EmployeeConfigInfo { | 23 | public class EmployeeConfigInfo { |
| 17 | 24 | ||
| 18 | /** 主键Id */ | 25 | /** 主键Id */ |
src/main/java/com/bsth/repository/schedule/EmployeeConfigInfoRepository.java
| @@ -2,6 +2,11 @@ package com.bsth.repository.schedule; | @@ -2,6 +2,11 @@ package com.bsth.repository.schedule; | ||
| 2 | 2 | ||
| 3 | import com.bsth.entity.schedule.EmployeeConfigInfo; | 3 | import com.bsth.entity.schedule.EmployeeConfigInfo; |
| 4 | import com.bsth.repository.BaseRepository; | 4 | import com.bsth.repository.BaseRepository; |
| 5 | + | ||
| 6 | +import java.util.List; | ||
| 7 | + | ||
| 8 | +import org.springframework.data.jpa.repository.EntityGraph; | ||
| 9 | +import org.springframework.data.jpa.repository.Query; | ||
| 5 | import org.springframework.stereotype.Repository; | 10 | import org.springframework.stereotype.Repository; |
| 6 | 11 | ||
| 7 | /** | 12 | /** |
| @@ -9,4 +14,8 @@ import org.springframework.stereotype.Repository; | @@ -9,4 +14,8 @@ import org.springframework.stereotype.Repository; | ||
| 9 | */ | 14 | */ |
| 10 | @Repository | 15 | @Repository |
| 11 | public interface EmployeeConfigInfoRepository extends BaseRepository<EmployeeConfigInfo, Long> { | 16 | public interface EmployeeConfigInfoRepository extends BaseRepository<EmployeeConfigInfo, Long> { |
| 17 | + | ||
| 18 | + @EntityGraph(value = "employeeConfigInfo_xl_cl", type = EntityGraph.EntityGraphType.FETCH) | ||
| 19 | + @Query("select ec from EmployeeConfigInfo ec where ec.xl.id=?1") | ||
| 20 | + List<EmployeeConfigInfo> findByLine(Integer lineId); | ||
| 12 | } | 21 | } |