。
This commit is contained in:
@ -3,17 +3,23 @@ package com.xkrs.dao;
|
||||
import com.xkrs.model.entity.DataSource;
|
||||
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.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: XinYi Song
|
||||
* @Date: 2022/1/19 16:41
|
||||
*/
|
||||
@Component
|
||||
public interface DataSourceDao extends JpaRepository<DataSource, Long>, JpaSpecificationExecutor<DataSource> {
|
||||
|
||||
@Query(value = "SELECT lot_no AS lotNo, machine_no AS machineNo, material_no AS materialNo, model_no AS modelNo, machine_type_no AS machineTypeNo, craft_item_name AS craftItemName FROM qc_inspection_data_source GROUP BY lot_no, machine_no, material_no, model_no, machine_type_no, craft_item_name", nativeQuery = true)
|
||||
List<Map<String, String>> selectAllDataSourceGroup();
|
||||
|
||||
@Query(value = "SELECT * FROM qc_inspection_data_source WHERE (lot_no IS NULL OR lot_no = ?1) AND (machine_no IS NULL OR machine_no = ?2) AND (material_no IS NULL OR material_no = ?3) AND (model_no IS NULL OR model_no = ?4) AND (machine_type_no IS NULL OR machine_type_no = ?5) AND (craft_item_name IS NULL OR craft_item_name = ?6)", nativeQuery = true)
|
||||
List<DataSource> selectDataSource(String lotNo, String machineNo, String materialNo, String modelNo, String machineTypeNo, String craftItemName);
|
||||
|
||||
@Modifying(clearAutomatically = true)
|
||||
@Query(value = "UPDATE qc_inspection_data_source SET picture_path = ?7 WHERE lot_no = ?1 AND machine_no = ?2 AND material_no = ?3 AND model_no = ?4 AND machine_type_no = ?5 AND craft_item_name = ?6", nativeQuery = true)
|
||||
void updatePicturePath(String lotNo, String machineNo, String materialNo, String modelNo, String machineTypeNo, String craftItemName, String filePath);
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
@ -26,7 +27,7 @@ public interface PictureDao extends JpaRepository<PictureEntity, Long>, JpaSpeci
|
||||
* @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);
|
||||
@Query(value = "SELECT * FROM qc_inspection_picture WHERE (lot_no IS NULL OR lot_no = ?1) AND (machine_no IS NULL OR machine_no = ?2) AND (material_no IS NULL OR material_no = ?3) AND (model_no IS NULL OR model_no = ?4) AND (machine_type_no IS NULL OR machine_type_no = ?5) AND (craft_item_name IS NULL OR craft_item_name = ?6)", nativeQuery = true)
|
||||
List<PictureEntity> selectPicture(String lotNo, String machineNo, String materialNo, String modelNo, String machineTypeNo, String craftItemName);
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user