调整数据库表结构
This commit is contained in:
		| @@ -1,48 +0,0 @@ | ||||
| package com.xkrs.dao; | ||||
|  | ||||
| import com.xkrs.model.entity.DataDict; | ||||
| 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; | ||||
|  | ||||
| /** | ||||
|  * @Author: XinYi Song | ||||
|  * @Date: 2022/1/19 10:03 | ||||
|  */ | ||||
| @Component | ||||
| public interface DataDictDao extends JpaRepository<DataDict,Long>, JpaSpecificationExecutor<DataDict> { | ||||
|  | ||||
|     /** | ||||
|      * 通过中文名称查询字典表数据 | ||||
|      * @param chineseName | ||||
|      * @return | ||||
|      */ | ||||
|     DataDict findByDictChineseName(String chineseName); | ||||
|  | ||||
|     /** | ||||
|      * 通过英文变量查询字典表的数据 | ||||
|      * @param englishName | ||||
|      * @return | ||||
|      */ | ||||
|     DataDict findByDictEnglishName(String englishName); | ||||
|  | ||||
|     /** | ||||
|      * 根据id查询字典信息 | ||||
|      * @param id | ||||
|      * @return | ||||
|      */ | ||||
|     DataDict findById(Integer id); | ||||
|  | ||||
|     /** | ||||
|      * 根据id修改字典的信息 | ||||
|      * @param id | ||||
|      * @param chineseName | ||||
|      */ | ||||
|     @Modifying(clearAutomatically=true) | ||||
|     @Query(value = "update data_dict set dict_chinese_name = ?2 where id = ?1",nativeQuery = true) | ||||
|     void updateDict(Integer id, String chineseName); | ||||
| } | ||||
| @@ -1,64 +0,0 @@ | ||||
| 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.Query; | ||||
| import org.springframework.stereotype.Component; | ||||
|  | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
|  | ||||
| /** | ||||
|  * @Author: XinYi Song | ||||
|  * @Date: 2022/1/19 16:41 | ||||
|  */ | ||||
| @Component | ||||
| public interface DataSourceDao extends JpaRepository<DataSource,Long>, JpaSpecificationExecutor<DataSource> { | ||||
|  | ||||
|     /** | ||||
|      * 查询测量数据信息 | ||||
|      * @param dataModelNumber | ||||
|      * @param dataBatchNumber | ||||
|      * @param dataMachineCode | ||||
|      * @param productNumber | ||||
|      * @return | ||||
|      */ | ||||
|     @Query(value = "select ds.data_model_number datamodelnumber, ds.data_batch_number databatchnumber, " + | ||||
|             "ds.data_machine_code datamachinecode, ds.product_number productnumber, ds.material material, dd.dict_chinese_name chinesename, " + | ||||
|             "ds.data_name dataname,ds.numerical_value numericalvalue " + | ||||
|             "from data_dict dd,data_source ds where ds.data_name = dd.dict_english_name and " + | ||||
|             "ds.data_model_number = :dataModelNumber and ds.data_batch_number = :dataBatchNumber and " + | ||||
|             "ds.data_machine_code = :dataMachineCode and ds.product_number = :productNumber",nativeQuery = true) | ||||
|     List<Map<String,String>> selectDataSource(String dataModelNumber, String dataBatchNumber, String dataMachineCode, String productNumber); | ||||
|  | ||||
|     /** | ||||
|      * 查询测量信息变量和测量值,用于模板的导入 | ||||
|      * @param dataModelNumber | ||||
|      * @param dataBatchNumber | ||||
|      * @param dataMachineCode | ||||
|      * @param productNumber | ||||
|      * @return | ||||
|      */ | ||||
|     @Query(value = "select data_name dataname,numerical_value numericalvalue from data_source " + | ||||
|             "where data_model_number = :dataModelNumber and data_batch_number = :dataBatchNumber " + | ||||
|             "and data_machine_code = :dataMachineCode and product_number = :productNumber",nativeQuery = true) | ||||
|     List<Map<String,String>> selectDataNameAndData(String dataModelNumber, String dataBatchNumber, String dataMachineCode, String productNumber); | ||||
|  | ||||
|     /** | ||||
|      * 通过英文变量查询信息 | ||||
|      * @param dataname | ||||
|      * @return | ||||
|      */ | ||||
|     DataSource findByDataName(String dataname); | ||||
|  | ||||
|     /** | ||||
|      * 查询全部的测量信息 | ||||
|      * @return | ||||
|      */ | ||||
|     @Query(value = "select ds.data_model_number datamodelnumber, ds.data_batch_number databatchnumber, " + | ||||
|             "ds.data_machine_code datamachinecode, ds.product_number productnumber, ds.material material, dd.dict_chinese_name chinesename," + | ||||
|             "ds.data_name dataname,ds.numerical_value numericalvalue from data_dict dd,data_source ds " + | ||||
|             "where ds.data_name = dd.dict_english_name",nativeQuery = true) | ||||
|     List<Map<String,String>> selectAllSource(); | ||||
| } | ||||
							
								
								
									
										27
									
								
								src/main/java/com/xkrs/dao/QcInspectionDataSourceDao.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								src/main/java/com/xkrs/dao/QcInspectionDataSourceDao.java
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| package com.xkrs.dao; | ||||
|  | ||||
| import com.xkrs.model.entity.QcInspectionDataSource; | ||||
| 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.List; | ||||
|  | ||||
| @Component | ||||
| public interface QcInspectionDataSourceDao extends JpaRepository<QcInspectionDataSource, Long>, JpaSpecificationExecutor<QcInspectionDataSource> { | ||||
|  | ||||
|     /** | ||||
|      * 查询质检数据源 | ||||
|      * | ||||
|      * @param lotNo      批次号 | ||||
|      * @param machineNo  机器号 | ||||
|      * @param materialNo 物料号 | ||||
|      * @param modelNo    模具号 | ||||
|      * @param partNo     零件号 | ||||
|      * @return | ||||
|      */ | ||||
|     @Query(value = "from QcInspectionDataSource where lotNo = ? and machineNo = ?and materialNo = ?and modelNo = ?and partNo = ?") | ||||
|     List<QcInspectionDataSource> selectDataSource(String lotNo, String machineNo, String materialNo, String modelNo, String partNo); | ||||
|  | ||||
| } | ||||
							
								
								
									
										58
									
								
								src/main/java/com/xkrs/dao/QcInspectionFileDao.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								src/main/java/com/xkrs/dao/QcInspectionFileDao.java
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,58 @@ | ||||
| package com.xkrs.dao; | ||||
|  | ||||
| import com.xkrs.model.entity.QcInspectionFile; | ||||
| 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; | ||||
|  | ||||
| /** | ||||
|  * @Author: XinYi Song | ||||
|  * @Date: 2022/1/20 15:23 | ||||
|  */ | ||||
| @Component | ||||
| public interface QcInspectionFileDao extends JpaRepository<QcInspectionFile, Long>, JpaSpecificationExecutor<QcInspectionFile> { | ||||
|  | ||||
|     /** | ||||
|      * 查询文件信息 | ||||
|      * | ||||
|      * @param lotNo      批次号 | ||||
|      * @param machineNo  机器号 | ||||
|      * @param materialNo 物料号 | ||||
|      * @param modelNo    模具号 | ||||
|      * @param partNo     零件号 | ||||
|      * @return | ||||
|      */ | ||||
|     QcInspectionFile 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 QcInspectionFile set templatePath = ?6 where lotNo = ?1 and machineNo = ?2 and materialNo = ?3 and modelNo = ?4 and partNo = ?5") | ||||
|     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 QcInspectionFile set filePath = ?6 where lotNo = ?1 and machineNo = ?2 and materialNo = ?3 and modelNo = ?4 and partNo = ?5") | ||||
|     void updateFilePath(String lotNo, String machineNo, String materialNo, String modelNo, String partNo, String filePath); | ||||
|  | ||||
|  | ||||
| } | ||||
							
								
								
									
										35
									
								
								src/main/java/com/xkrs/dao/QcInspectionItemDictDao.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								src/main/java/com/xkrs/dao/QcInspectionItemDictDao.java
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,35 @@ | ||||
| package com.xkrs.dao; | ||||
|  | ||||
| import com.xkrs.model.entity.QcInspectionItemDict; | ||||
| 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 QcInspectionItemDictDao extends JpaRepository<QcInspectionItemDict, Long>, JpaSpecificationExecutor<QcInspectionItemDict> { | ||||
|  | ||||
|     /** | ||||
|      * 通过检验项代码查询字典表的数据 | ||||
|      * @param inspectionItemCode | ||||
|      * @return | ||||
|      */ | ||||
|     QcInspectionItemDict findByInspectionItemCode(String inspectionItemCode); | ||||
|  | ||||
|     /** | ||||
|      * 根据id查询字典信息 | ||||
|      * @param id | ||||
|      * @return | ||||
|      */ | ||||
|     QcInspectionItemDict findById(Integer id); | ||||
|  | ||||
|     /** | ||||
|      * 根据id修改字典的信息 | ||||
|      * @param id | ||||
|      * @param inspectionItemName | ||||
|      */ | ||||
|     @Modifying(clearAutomatically=true) | ||||
|     @Query(value = "update QcInspectionItemDict set inspectionItemName = ?2 where id = ?1") | ||||
|     void updateDictById(Integer id, String inspectionItemName); | ||||
| } | ||||
| @@ -1,52 +1,52 @@ | ||||
| package com.xkrs.dao; | ||||
| 
 | ||||
| import com.xkrs.model.entity.FileEntity; | ||||
| 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; | ||||
| 
 | ||||
| /** | ||||
|  * @Author: XinYi Song | ||||
|  * @Date: 2022/1/20 15:23 | ||||
|  */ | ||||
| @Component | ||||
| public interface FileDao extends JpaRepository<FileEntity,Long>, JpaSpecificationExecutor<FileEntity> { | ||||
| public interface QcInspectionPictureDao extends JpaRepository<QcInspectionPicture, Long>, JpaSpecificationExecutor<QcInspectionPicture> { | ||||
| 
 | ||||
|     /** | ||||
|      * 根据机种号,批次号,机器号,产品号查询文件信息 | ||||
|      * | ||||
|      * @param fileModelNumber | ||||
|      * @param fileBatchNumber | ||||
|      * @param fileMachineCode | ||||
|      * @param fileProductNumber | ||||
|      * @return | ||||
|      */ | ||||
|     FileEntity findByFileModelNumberAndFileBatchNumberAndFileMachineCodeAndFileProductNumber(String fileModelNumber,String fileBatchNumber,String fileMachineCode,String fileProductNumber); | ||||
|     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); | ||||
|     @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); | ||||
|     @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); | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
							
								
								
									
										10
									
								
								src/main/java/com/xkrs/dao/QcInspectionSpecDao.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								src/main/java/com/xkrs/dao/QcInspectionSpecDao.java
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,10 @@ | ||||
| package com.xkrs.dao; | ||||
|  | ||||
| import com.xkrs.model.entity.QcInspectionSpec; | ||||
| import org.springframework.data.jpa.repository.JpaRepository; | ||||
| import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | ||||
| import org.springframework.stereotype.Component; | ||||
|  | ||||
| @Component | ||||
| public interface QcInspectionSpecDao extends JpaRepository<QcInspectionSpec, Long>, JpaSpecificationExecutor<QcInspectionSpec> { | ||||
| } | ||||
		Reference in New Issue
	
	Block a user