添加工艺项目
This commit is contained in:
		| @@ -18,19 +18,19 @@ import java.util.Optional; | ||||
| @Component | ||||
| public interface CraftItemDao extends JpaRepository<CraftItemEntity, Integer>, JpaSpecificationExecutor<CraftItemEntity> { | ||||
|  | ||||
|     Optional<CraftItemEntity> findByNo(String no); | ||||
|     Optional<CraftItemEntity> findByCraftItemNo(String no); | ||||
|  | ||||
|     /** | ||||
|      * 更新工艺项目名称 | ||||
|      */ | ||||
|     @Transactional(rollbackOn = Exception.class) | ||||
|     @Modifying(clearAutomatically = true) | ||||
|     @Query(value = "UPDATE craft_item SET update_time = ?2, name = ?3 WHERE id = ?1", nativeQuery = true) | ||||
|     @Query(value = "UPDATE craft_item SET update_time = ?2, craft_item_name = ?3 WHERE id = ?1", nativeQuery = true) | ||||
|     void updateNameById(Integer id, String updateTime, String name); | ||||
|  | ||||
|     /** | ||||
|      * 查询工艺项目 | ||||
|      */ | ||||
|     @Query(value = "SELECT id, no, name FROM craft_item WHERE no LIKE %?1% AND name LIKE %?2% ORDER BY create_time ASC", nativeQuery = true) | ||||
|     @Query(value = "SELECT id AS id, craft_item_no AS no, craft_item_name AS name FROM craft_item WHERE craft_item_no LIKE %?1% AND craft_item_name LIKE %?2% ORDER BY create_time ASC", nativeQuery = true) | ||||
|     List<Map<String, Object>> queryCraftItem(String no, String name); | ||||
| } | ||||
|   | ||||
| @@ -17,18 +17,18 @@ import java.util.Optional; | ||||
| @Component | ||||
| public interface QcItemDao extends JpaRepository<QcItemEntity, Integer>, JpaSpecificationExecutor<QcItemEntity> { | ||||
|  | ||||
|     Optional<QcItemEntity> findByNo(String no); | ||||
|     Optional<QcItemEntity> findByQcItemNo(String no); | ||||
|  | ||||
|     /** | ||||
|      * 更新检验项目名称 | ||||
|      */ | ||||
|     @Modifying(clearAutomatically = true) | ||||
|     @Query(value = "UPDATE qc_item SET update_time = ?2, name = ?3 WHERE id = ?1", nativeQuery = true) | ||||
|     @Query(value = "UPDATE qc_item SET update_time = ?2, qc_item_name = ?3 WHERE id = ?1", nativeQuery = true) | ||||
|     void updateNameById(Integer id, String updateTime, String name); | ||||
|  | ||||
|     /** | ||||
|      * 查询检验项目 | ||||
|      */ | ||||
|     @Query(value = "SELECT id, no, name, type FROM qc_item WHERE no LIKE %?1% AND name LIKE %?2% ORDER BY create_time ASC", nativeQuery = true) | ||||
|     @Query(value = "SELECT id AS id, qc_item_no AS no, qc_item_name AS name, qc_item_type AS type FROM qc_item WHERE qc_item_no LIKE %?1% AND qc_item_name LIKE %?2% ORDER BY create_time ASC", nativeQuery = true) | ||||
|     List<Map<String, Object>> queryQcItem(String no, String name); | ||||
| } | ||||
|   | ||||
| @@ -15,7 +15,7 @@ import java.util.Map; | ||||
| @Component | ||||
| public interface QcSourceDao extends JpaRepository<QcSourceEntity, Integer>, JpaSpecificationExecutor<QcSourceEntity> { | ||||
|  | ||||
|     @Query(value = "SELECT id, batch_no AS batchNo, machine_no AS machineNo, material_no AS materialNo, mould_no AS mouldNo, variety_no AS varietyNo, qc_item_no AS qcItemNo, qc_value AS qcValue FROM qc_source WHERE batch_no LIKE %?1% AND machine_no LIKE %?2% AND material_no LIKE %?3% AND mould_no LIKE %?4% AND variety_no LIKE %?5% ORDER BY create_time DESC", nativeQuery = true) | ||||
|     List<Map<String, Object>> queryQcSource(String batchNo, String machineNo, String materialNo, String mouldNo, String varietyNo); | ||||
|     @Query(value = "SELECT id, batch_no AS batchNo, machine_no AS machineNo, material_no AS materialNo, mould_no AS mouldNo, variety_no AS varietyNo, craft_item_no AS craftItemNo, qc_item_no AS qcItemNo, qc_value AS qcValue FROM qc_source WHERE batch_no LIKE %?1% AND machine_no LIKE %?2% AND material_no LIKE %?3% AND mould_no LIKE %?4% AND variety_no LIKE %?5% AND craft_item_no LIKE %?6% ORDER BY create_time DESC", nativeQuery = true) | ||||
|     List<Map<String, Object>> queryQcSource(String batchNo, String machineNo, String materialNo, String mouldNo, String varietyNo, String craftItemNo); | ||||
|  | ||||
| } | ||||
| @@ -14,7 +14,8 @@ import java.util.Optional; | ||||
| @Component | ||||
| public interface QcSpecDao extends JpaRepository<QcSpecEntity, Integer>, JpaSpecificationExecutor<QcSpecEntity> { | ||||
|  | ||||
|     Optional<QcSpecEntity> findByVarietyNoAndQcItemNo(String varietyNo, String qcItemNo); | ||||
|     @Query(value = "SELECT * FROM qc_spec WHERE variety_no = ?1 AND craft_item_no = ?2 AND qc_item_no = ?3 ORDER BY create_time ASC", nativeQuery = true) | ||||
|     Optional<QcSpecEntity> findExistsQcSpec(String varietyNo, String craftItemNo, String qcItemNo); | ||||
|  | ||||
|     /** | ||||
|      * 更新检验规格 | ||||
| @@ -26,6 +27,6 @@ public interface QcSpecDao extends JpaRepository<QcSpecEntity, Integer>, JpaSpec | ||||
|     /** | ||||
|      * 查询检验规格 | ||||
|      */ | ||||
|     @Query(value = "SELECT id, variety_no AS varietyNo, qc_item_no AS qcItemNo, max, mean, min, unit, method, standard, remark FROM qc_spec WHERE variety_no LIKE %?1% AND qc_item_no LIKE %?2% ORDER BY create_time ASC", nativeQuery = true) | ||||
|     List<Map<String, Object>> queryQcSpec(String varietyNo, String qcItemNo); | ||||
|     @Query(value = "SELECT id, variety_no AS varietyNo, craft_item_no AS craftItemNo, qc_item_no AS qcItemNo, max, mean, min, unit, method, standard, remark FROM qc_spec WHERE variety_no LIKE %?1% AND craft_item_no LIKE %?2% AND qc_item_no LIKE %?3% ORDER BY create_time ASC", nativeQuery = true) | ||||
|     List<Map<String, Object>> queryQcSpec(String varietyNo, String craftItemNo, String qcItemNo); | ||||
| } | ||||
		Reference in New Issue
	
	Block a user