package shop.alien.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import shop.alien.entity.store.StoreBusinessInfo;

import java.util.List;

/**
 * 门店营业时间 Mapper 接口
 *
 * @author ssk
 * @since 2024-12-05
 */
@Mapper
public interface StoreBusinessInfoMapper extends BaseMapper<StoreBusinessInfo> {

    /**
     * 获取商家的营业时间
     * @param businessSectionName
     * @return
     */
    @Select("SELECT sbi.id,sbi.store_id,sbi.business_type,sbi.business_date,sbi.start_time,sbi.end_time,sbi.delete_flag,sbi.created_time," +
            "sbi.created_user_id,sbi.updated_time,sbi.updated_user_id FROM store_business_info AS sbi LEFT JOIN store_info AS si " +
            "ON sbi.store_id = si.id WHERE sbi.delete_flag = 0 and si.delete_flag = 0 and si.business_section_name = #{businessSectionName}")
    List<StoreBusinessInfo> selectBusinessInfo(String businessSectionName);
}
