industrial_measurement/src/main/java/com/xkrs/dao/QcInspectionFileDao.java
2022-02-28 19:53:50 +08:00

61 lines
2.3 KiB
Java

package com.xkrs.dao;
import com.xkrs.model.entity.QcInspectionFileEntity;
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.Repository;
import java.util.List;
/**
* @Author: XinYi Song
* @Date: 2022/1/20 15:23
*/
@Repository
public interface QcInspectionFileDao extends JpaRepository<QcInspectionFileEntity, Long>, JpaSpecificationExecutor<QcInspectionFileEntity> {
/**
* 查询文件信息
*
* @param lotNo 批次号
* @param machineNo 机器号
* @param materialNo 物料号
* @param modelNo 模具号
* @param partNo 零件号
* @return
*/
@Query(value = "select * from qc_inspection_file where lot_no = ?1 and machine_no = ?2 and material_no = ?3 and model_no = ?4 and part_no = ?5", nativeQuery = true)
List<QcInspectionFileEntity> selectFile(String lotNo, String machineNo, String materialNo, String modelNo, String partNo);
/**
* 修改模板上传信息
*
* @param lotNo 批次号
* @param machineNo 机器号
* @param materialNo 物料号
* @param modelNo 模具号
* @param partNo 零件号
* @param templatePath 模版路径
*/
@Modifying(clearAutomatically = true)
@Query(value = "update qc_inspection_file set template_path = ?6 where lot_no = ?1 and machine_no = ?2 and material_no = ?3 and model_no = ?4 and part_no = ?5", nativeQuery = true)
void updateTemplatePath(String lotNo, String machineNo, String materialNo, String modelNo, String partNo, String templatePath);
/**
* 修改模板载下信息
*
* @param lotNo 批次号
* @param machineNo 机器号
* @param materialNo 物料号
* @param modelNo 模具号
* @param partNo 零件号
* @param filePath 文件路径
*/
@Modifying(clearAutomatically = true)
@Query(value = "update qc_inspection_file set file_path = ?6 where lot_no = ?1 and machine_no = ?2 and material_no = ?3 and model_no = ?4 and part_no = ?5", nativeQuery = true)
void updateFilePath(String lotNo, String machineNo, String materialNo, String modelNo, String partNo, String filePath);
}