|
@@ -4,6 +4,7 @@ import cn.rankin.common.utils.enums.BaseStatusEnum;
|
|
|
import cn.rankin.common.utils.enums.EventTypeEnum;
|
|
|
import cn.rankin.common.utils.jpa.BasicJpaRepository;
|
|
|
import cn.rankin.data.api.user.entity.DownloadInfo;
|
|
|
+import cn.rankin.data.api.user.entity.Resource;
|
|
|
import cn.rankin.data.api.user.entity.UserDevice;
|
|
|
import org.springframework.data.jpa.repository.Modifying;
|
|
|
import org.springframework.data.jpa.repository.Query;
|
|
@@ -20,4 +21,14 @@ public interface UserDeviceRepository extends BasicJpaRepository<UserDevice, Str
|
|
|
@Modifying
|
|
|
@Query(value = "update UserDevice device set device.num = ?4 where device.userId = ?1 AND device.deviceCode= ?2 AND device.deviceModel = ?3")
|
|
|
int updateDevice(String uid, String deviceCode,String deviceModel,int num);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据用户编号查询设备信息
|
|
|
+ * @param userId the id of user
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Query(value = "select r.* from resource r where r.type != ?1", nativeQuery = true)
|
|
|
+ List<UserDevice> findByUserId(String userId);
|
|
|
+
|
|
|
+
|
|
|
}
|