package com.starry.admin.modules.shop.mapper;

import com.github.yulichang.base.MPJBaseMapper;
import com.starry.admin.modules.shop.module.entity.PlayCommodityInfoEntity;
import com.starry.admin.modules.shop.module.vo.PlayCommodityInfoVo;
import org.apache.ibatis.annotations.Select;

/**
 * 服务项目Mapper接口
 *
 * @author admin
 * @since 2024-03-31
 */
public interface PlayCommodityInfoMapper extends MPJBaseMapper<PlayCommodityInfoEntity> {

    // /**
    // * 查询服务项目信息
    // *
    // * @param id UUID
    // * @return 项目信息
    // */
    // @Select("select t.id as commodityId,t.price as commodityPrice,t.item_name as
    // serviceDuration,t1.item_name as commodityName from play_commodity_info t left
    // join play_commodity_info t1 on t.p_id = t1.id where t.id = #{id} limit 1")
    // PlayCommodityInfoVo queryCommodityInfo(String id);

    /**
     * 查询服务项目信息
     *
     * @param id
     *            UUID
     * @return 项目信息
     */
    @Select("select t.id as commodityId,t3.price as commodityPrice,t.item_name as serviceDuration,t1.item_name as commodityName from play_commodity_info t left join play_commodity_info t1 on t.p_id = t1.id left join play_commodity_and_level_info t3 ON t3.commodity_id = t.id where t3.price is not null and t.id  = #{id} and t3.level_id = #{levelId} limit 1")
    PlayCommodityInfoVo queryCommodityInfo(String id, String levelId);

}
