package com.cirle.scientific.dao;

import com.cirle.scientific.po.QkjShare;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface QkjShareDao extends PagingAndSortingRepository<QkjShare, Long>, JpaSpecificationExecutor<QkjShare> {
    @Query(value = "SELECT * FROM qkj_share WHERE share_memcard = ?1 AND click_memcard = ?2" +
            " AND obj_type = ?3 and obj_id= ?4", nativeQuery = true)
    List<QkjShare> getQkjShare(String shareMemcard, String clickMemcard, Integer objType, Integer objId);


    @Query(value = "SELECT * FROM qkj_share WHERE  obj_type = ?1 and obj_id= ?2", nativeQuery = true)
    List<QkjShare> getQkjShareByObjTYpeAndObjId(Integer objType, Integer objId);

}
