package com.hr.repository.jpa;

import com.hr.dto.QueryDto;
import com.hr.fegin.dto.MyDemoDto;
import com.hr.repository.domain.Demo1Entity;
import com.hr.repository.domain.TestEntity;
import com.yy.basedevelop.common.data.BasePageResult;
import org.hibernate.annotations.processing.SQL;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;



public interface Demo1Jpa extends JpaRepository<Demo1Entity, String> {

    public Demo1Entity findByFid(Long id);


    public List<TestEntity> findByFname(String name);

//    @Query(nativeQuery=true,value="select t.* from demo1 t where t.fname like '%'||:#{#d.name}||'%' and fid in (:#{#d.ids})")
    public BasePageResult<MyDemoDto> queryList3(QueryDto dto);

    @Query(nativeQuery=true,value="select t.* from demo1 t where t.fname like '%'||:name||'%' and fid in (:ids)")
    public BasePageResult<MyDemoDto> queryList(@Param("name")   String name, @Param("ids") List<Integer> ids);

    public BasePageResult<MyDemoDto> select1(@Param("name") String fname,@Param("id") String id);
}
