package com.ssj.dao.sys.fx.dao;

import com.ssj.bean.sys.fx.domain.Materiel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface MaterielDao extends JpaRepository<Materiel,String> {
    @Query(nativeQuery = true,value = "select * from tb_materiel where state=1 and userd_count>0 and materie_code=?1 order by create_time asc ")
    List<Materiel> findMaterielByCode(String materielCode);

    @Query(nativeQuery = true,value = "select * from tb_materiel where state=1 and materiel_name=?1 limit 1")
    Materiel findMaterielByName(String templateName);
}
