package cn.ysk.cashier.cons.repository;

import cn.ysk.cashier.cons.domain.TbConsInfoFlow;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

/**
* @website https://eladmin.vip
* @author admin
* @date 2024-06-22
**/
public interface TbConsInfoFlowRepository extends JpaRepository<TbConsInfoFlow, Integer>, JpaSpecificationExecutor<TbConsInfoFlow> {


    @Query(value = "SELECT\n" +
            "\tp.`name` \n" +
            "FROM\n" +
            "\ttb_product_sku s\n" +
            "\tLEFT JOIN tb_product p ON s.product_id = p.id \n" +
            "WHERE\n" +
            "\ts.id = ?1",nativeQuery = true)
    String selectByPskId(Integer skuId);

}