lisy
2023-06-14 19d7560cd5b1f6498e9889d7f0e8a8e18ba4197f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.dsh.course.servs;
 
 
import com.dsh.course.entity.TCoursePackagePayment;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
 
import java.util.List;
 
public interface CoursePackagePaymentRepository extends JpaRepository<TCoursePackagePayment, Long> {
    @Query(value = "SELECT * FROM t_course_package_payment "
            + "UNION ALL "
            + "SELECT * FROM t_course_package_payment1 "
            + "UNION ALL "
            + "SELECT * FROM t_course_package_payment2 "
            + "UNION ALL "
            + "SELECT * FROM t_course_package_payment3 "
            + "UNION ALL "
            + "SELECT * FROM t_course_package_payment4 "
            + "UNION ALL "
            + "SELECT * FROM t_course_package_payment5 "
            + "WHERE user_id = :userId", nativeQuery = true)
    List<TCoursePackagePayment> findByUserId(@Param ("userId") Integer userId);
}