2022-03-02 14:51:32 +08:00

33 lines
1.1 KiB
Java

package com.xkrs.dao;
import com.xkrs.model.entity.PictureEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Component;
import java.util.Optional;
/**
* @Author: XinYi Song
* @Date: 2022/1/19 16:41
*/
@Component
public interface PictureDao extends JpaRepository<PictureEntity, Long>, JpaSpecificationExecutor<PictureEntity> {
/**
* 查询图片信息
*
* @param lotNo 批次号
* @param machineNo 机器号
* @param materialNo 物料号
* @param modelNo 模具号
* @param machineTypeNo 机种号
* @param craftItemName 工艺项目名称
* @return
*/
@Query(value = "SELECT * FROM qc_inspection_picture WHERE lot_no = ? AND machine_no = ? AND material_no = ? AND model_no = ? AND machine_type_no = ? AND craft_item_name = ? ", nativeQuery = true)
Optional<PictureEntity> selectPicture(String lotNo, String machineNo, String materialNo, String modelNo, String machineTypeNo, String craftItemName);
}