工业测量
This commit is contained in:
48
src/main/java/com/xkrs/dao/DataDictDao.java
Normal file
48
src/main/java/com/xkrs/dao/DataDictDao.java
Normal file
@ -0,0 +1,48 @@
|
||||
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);
|
||||
}
|
64
src/main/java/com/xkrs/dao/DataSourceDao.java
Normal file
64
src/main/java/com/xkrs/dao/DataSourceDao.java
Normal file
@ -0,0 +1,64 @@
|
||||
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, 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, 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();
|
||||
}
|
52
src/main/java/com/xkrs/dao/FileDao.java
Normal file
52
src/main/java/com/xkrs/dao/FileDao.java
Normal file
@ -0,0 +1,52 @@
|
||||
package com.xkrs.dao;
|
||||
|
||||
import com.xkrs.model.entity.FileEntity;
|
||||
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> {
|
||||
|
||||
/**
|
||||
* 根据机种号,批次号,机器号,产品号查询文件信息
|
||||
* @param fileModelNumber
|
||||
* @param fileBatchNumber
|
||||
* @param fileMachineCode
|
||||
* @param fileProductNumber
|
||||
* @return
|
||||
*/
|
||||
FileEntity 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);
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user