43 lines
1.2 KiB
Java
43 lines
1.2 KiB
Java
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;
|
|
import java.util.Optional;
|
|
|
|
/**
|
|
* @Author: XinYi Song
|
|
* @Date: 2022/1/19 10:03
|
|
*/
|
|
@Component
|
|
public interface DataDictDao extends JpaRepository<DataDict,Long>, JpaSpecificationExecutor<DataDict> {
|
|
|
|
/**
|
|
* 通过质检项代码查询字典表的数据
|
|
* @param inspectionItemCode
|
|
* @return
|
|
*/
|
|
Optional<DataDict> findByInspectionItemCode(String inspectionItemCode);
|
|
|
|
/**
|
|
* 根据id查询字典信息
|
|
* @param id
|
|
* @return
|
|
*/
|
|
Optional<DataDict> findById(Integer id);
|
|
|
|
/**
|
|
* 根据id修改字典的信息
|
|
* @param id
|
|
* @param inspectionItemName
|
|
*/
|
|
@Modifying(clearAutomatically=true)
|
|
@Query(value = "UPDATE qc_inspection_item_dict SET inspection_item_name = ?2 where id = ?1",nativeQuery = true)
|
|
void updateDict(Integer id, String inspectionItemName);
|
|
}
|