package com.xkrs.newpro.dao; import com.xkrs.newpro.model.entity.QcItemEntity; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Component; import java.util.Optional; @Component public interface QcItemDao extends JpaRepository, JpaSpecificationExecutor { Optional findByNo(String no); /** * 更新质检项名称 */ @Modifying(clearAutomatically = true) @Query(value = "UPDATE qc_item SET update_time = ?2,name = ?3 WHERE id = ?1", nativeQuery = true) void updateNameById(Integer id, String updateTime, String name); }