package com.xkrs.dao; import com.xkrs.model.entity.QcInspectionFile; import com.xkrs.model.entity.QcInspectionPicture; 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; @Component public interface QcInspectionPictureDao extends JpaRepository, JpaSpecificationExecutor { /** * 根据机种号,批次号,机器号,产品号查询文件信息 * * @param fileModelNumber * @param fileBatchNumber * @param fileMachineCode * @param fileProductNumber * @return */ QcInspectionFile findByFileModelNumberAndFileBatchNumberAndFileMachineCodeAndFileProductNumber(String fileModelNumber, String fileBatchNumber, String fileMachineCode, String fileProductNumber); /** * 根据机种号,批次号,机器号,产品号修改模板上传信息 * * @param fileModelNumber * @param fileBatchNumber * @param fileMachineCode * @param fileProductNumber * @param fileUploadPath */ @Modifying(clearAutomatically = true) @Query(value = "update file set file_upload_path = ?5 where file_model_number = ?1 and file_batch_number = ?2 and file_machine_code = ?3 and file_product_number = ?4", nativeQuery = true) void updateFileUploadPath(String fileModelNumber, String fileBatchNumber, String fileMachineCode, String fileProductNumber, String fileUploadPath); /** * 根据机种号,批次号,机器号,产品号修改模板载下信息 * * @param fileModelNumber * @param fileBatchNumber * @param fileMachineCode * @param fileProductNumber * @param fileDownloadPath */ @Modifying(clearAutomatically = true) @Query(value = "update file set file_download_path = ?5 where file_model_number = ?1 and file_batch_number = ?2 and file_machine_code = ?3 and file_product_number = ?4", nativeQuery = true) void updateFileDownloadPath(String fileModelNumber, String fileBatchNumber, String fileMachineCode, String fileProductNumber, String fileDownloadPath); }