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 { @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 findByUserId(@Param ("userId") Integer userId); }