【发布时间】:2021-12-27 09:26:40
【问题描述】:
我想更新 work_withdraw 表。我的目标是执行更新选择 同时功能。我想设置我的存款表挂起列 work_withdraw数量列中的数据,当用户调用更新api时
.在此处输入图片描述
我想在 work_withdraw 表数量列中设置待处理数据。 这是我的查询但我无法更新 work_withdraw 表 通过使用 JPA 查询 DepositRepository.kt
package com.nilmani.workload.repository
import com.nilmani.workload.entity.Deposit
import com.nilmani.workload.entity.WorkWithdraw
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.Modifying
import org.springframework.data.jpa.repository.Query
import org.springframework.transaction.annotation.Transactional
import org.springframework.web.bind.annotation.RequestParam
interface DepositRepository:JpaRepository<Deposit,Long> {
@Modifying
@Transactional
@Query("update Ww SET Ww .quantity = d .pending FROM WorkWithdraw AS Ww INNER JOIN Deposit AS d ON Ww.id = d.id")
fun getPendingStatus(@RequestParam("id")id: WorkWithdraw):Long
}
我想在管理员进入时自动更新表 worker_withdraw worker_withdraw id 但我的查询不存在作为我想要的结果类型
【问题讨论】:
标签: mysql spring-data-jpa