package com.yc.ship.module.trade.service.order.impl;

import com.yc.ship.module.trade.controller.admin.order.vo.order.OrderShareVO;
import com.yc.ship.module.trade.dal.dataobject.order.TradeOrderRoomModelDO;
import com.yc.ship.module.trade.service.order.TradeOrderRoomModelService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;


import com.yc.ship.module.trade.dal.mysql.order.TradeOrderRoomModelMapper;

import java.util.Collections;
import java.util.List;


/**
 * 订单关联房型数据 Service 实现类
 *
 * @author 管理员
 */
@Service
@Validated
public class TradeOrderRoomModelServiceImpl implements TradeOrderRoomModelService {

    @Resource
    private TradeOrderRoomModelMapper orderRoomModelMapper;

    @Override
    public List<TradeOrderRoomModelDO> getListByOrderIds(List<Long> orderIds) {
        if(orderIds.isEmpty()) {
            return Collections.emptyList();
        }
        return orderRoomModelMapper.selectListByOrderIds(orderIds);
    }

    @Override
    public List<OrderShareVO> getOrderShareStatsByOrderIds(List<Long> orderIds) {
        if(orderIds.isEmpty()) {
            return Collections.emptyList();
        }
        return orderRoomModelMapper.selectOrderShareStatsByOrderIds(orderIds);
    }
}