huaz
2022-12-30 c3ad779e9ededcd8b9184da53921f24654e1840b
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/SysUserLevelInsuranceRepository.java
@@ -16,9 +16,12 @@
package me.zhengjie.modules.system.repository;
import me.zhengjie.modules.system.domain.SysUserLevelInsurance;
import me.zhengjie.modules.system.domain.SysUserLevelWage;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
/**
* @website https://eladmin.vip
@@ -34,4 +37,12 @@
     */
    @Query(value = "SELECT * FROM sys_user_level_insurance WHERE user_id = ?1 ORDER BY start_date DESC, create_time DESC LIMIT 1", nativeQuery = true)
    SysUserLevelInsurance findLastByUserId(Long userId);
    /**
     * 根据用户ID查询
     * @param userId /
     * @return /
     */
    @Query(value = "SELECT * FROM sys_user_level_insurance WHERE user_id = ?1", nativeQuery = true)
    List<SysUserLevelInsurance> findByUserId(Long userId);
}