guozhaoshun hace 6 años
padre
commit
eb61f6bdde

+ 2 - 0
rankin-user-service/src/main/java/cn/rankin/userservice/repository/QRCodeRepository.java

@@ -2,6 +2,7 @@ package cn.rankin.userservice.repository;
 
 import cn.rankin.common.utils.jpa.BasicJpaRepository;
 import cn.rankin.data.api.user.entity.QRCode;
+import org.springframework.data.jpa.repository.Modifying;
 import org.springframework.data.jpa.repository.Query;
 
 public interface QRCodeRepository extends BasicJpaRepository<QRCode, String> {
@@ -9,6 +10,7 @@ public interface QRCodeRepository extends BasicJpaRepository<QRCode, String> {
     @Query(value = "select qr.* from u_qrcode qr where qr.eid = ?1 ORDER BY qr.gmt_created DESC limit 1",nativeQuery = true)
     QRCode findLastOne(String eid);
 
+    @Modifying
     @Query(value = "update QRCode qr set qr.status = 1 where qr.eid = ?1 and qr.status = 0 ")
     void updateStatusFail(String eid);
 }