package com.cirle.scientific.dao;/*
 *24901
 *2022/12/22
 *9:02
 */

import com.cirle.scientific.po.QkjQuestionDetailApp;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;


/**
 * @author 24901
 */
public interface QkjQuestionDetailAppDao extends PagingAndSortingRepository<QkjQuestionDetailApp, Long>, JpaSpecificationExecutor<QkjQuestionDetailApp> {

    @Query(value = "select * from qkj_question_detail_app where obj_type = ?1 and obj_id = ?2 and status = 0 ", nativeQuery = true)
    List<QkjQuestionDetailApp> findAllByTypeAndObjId(Integer type, Integer ObjId);

    @Query(value = "select qu_id from qkj_question_detail_app where obj_type = ?1 and obj_id = ?2 and status = 0 ", nativeQuery = true)
    List<Integer> findQuIdByTypeAndObjId(Integer type, Integer ObjId);
}
