“djh”
2024-12-05 eee41a5fb58e6547a43929430f4b72908119db6e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package com.gkhy.testFourierSpecialGasMonitor.repository;
 
import com.gkhy.testFourierSpecialGasMonitor.entity.GasCategoryConfiguration;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.web.bind.annotation.RequestParam;
 
import java.util.List;
 
public interface GasCategoryConfigurationRepository extends JpaRepository<GasCategoryConfiguration,Integer>, JpaSpecificationExecutor<GasCategoryConfiguration> {
    @Query(value = "SELECT * FROM gas_category_configuration  WHERE del_flag = 0 AND gas_category_id = :id",nativeQuery = true)
    List<GasCategoryConfiguration> findByGasCategoryId(@Param("id") Integer id);
 
    @Query(value = "SELECT * FROM gas_category_configuration  WHERE del_flag = 0 AND gas_category_id = :gasCategoryId AND orientation = :orientation",nativeQuery = true)
    GasCategoryConfiguration findByGasCategoryIdAndOrientation(@Param("gasCategoryId") Integer gasCategoryId,@Param("orientation") Integer position);
 
    @Query(value = "SELECT * FROM gas_category_configuration  WHERE del_flag = 0 AND  orientation = :orientation",nativeQuery = true)
    GasCategoryConfiguration findByOrientation(@Param("orientation") Integer position);
}