package cn.ysk.cashier.repository;
import cn.ysk.cashier.pojo.TbPlatformDict;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @website https://eladmin.vip
 * @author ww
 * @date 2024-03-29
 **/
public interface TbPlatformDictRepository extends JpaRepository<TbPlatformDict, Integer>, JpaSpecificationExecutor<TbPlatformDict> {


    @Query("SELECT count(1) FROM TbPlatformDict WHERE name = :name AND type =:type")
    int  isExist(@Param("type")String type, @Param("name") String name);

    @Query
    List<TbPlatformDict> findAllByTypeAndIsShowCash(String type,Integer isShowCash);
}