package shop.alien.store.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import shop.alien.entity.store.StoreBusinessInfo;
import shop.alien.mapper.StoreBusinessInfoMapper;
import shop.alien.store.service.StoreBusinessInfoService;

import java.util.List;

/**
 * 二期-门店营业时间 服务实现类
 *
 * @author ssk
 * @since 2024-12-05
 */
@Transactional
@Service
public class StoreBusinessInfoServiceImpl extends ServiceImpl<StoreBusinessInfoMapper, StoreBusinessInfo> implements StoreBusinessInfoService {

    /**
     * 获取门店营业信息
     *
     * @param storeId 门店信息
     * @return list
     */
    @Override
    public List<StoreBusinessInfo> getStoreBusinessInfo(Long storeId) {
        LambdaQueryWrapper<StoreBusinessInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper
                .eq(StoreBusinessInfo::getStoreId, storeId)
                .orderByDesc(StoreBusinessInfo::getCreatedTime);
        return this.list(lambdaQueryWrapper);
    }

}
