package com.kmall.admin.dao;

import com.kmall.admin.dto.OrderRecognitionDto;
import com.kmall.admin.dto.SendTempDto;
import com.kmall.admin.entity.OrderEntity;
import com.kmall.api.entity.OrderVo;
import org.apache.ibatis.annotations.Param;
import com.kmall.manager.dao.BaseDao;

import java.util.List;
import java.util.Map;

/**
 * @author Scott
 * @email
 * @date 2017-08-13 10:41:09
 */
public interface OrderDao extends BaseDao<OrderEntity> {
    void riderOrderUpdate(OrderEntity orderVo);

    /**
     * 获取活动Id
     *
     * @param activityId
     */
    List<OrderEntity> queryObjectByActivityId(@Param("activityId") Integer activityId);

    OrderEntity queryObjectBySysUser(Long id);
    /**
     * 已付款订单会员数
     *
     * @return
     */
    int getYfkOrderUserSum(Map<String, Object> map);

    /**
     * 有订单会员数
     *
     * @return
     */
    int getOderUserSum(Map<String, Object> map);

    /**
     * 今日订单数
     *
     * @return
     */
    int getTodayUserOrder(Map<String, Object> map);

    /**
     * 今日会员购物总额
     *
     * @return
     */
    int getTodayUserSales(Map<String, Object> map);

    /**
     * 总收入
     *
     * @return
     */
    int getIncomeSum(Map<String, Object> map);

    /**
     * 已支付订单数
     *
     * @return
     */
    int getPayedOrderCount(Map<String, Object> map);

    Double getTotalActualPrice(@Param("merchOrderSn")String merchOrderSn);

    List<OrderEntity> queryOffilineOrderList(Map<String, Object> map);

    List<OrderEntity> queryObjectByMerchOrderSn(@Param("merchOrderSn")String merchOrderSn);

    List<OrderEntity> queryExportList(Map<String, Object> map);

    OrderEntity queryObjectByOrderSn(@Param("orderSn")String orderSn);

    List<OrderEntity> promOrderList(Map<String, Object> map);

    int queryPromOrderTotal(Map<String, Object> map);

    List<OrderEntity> promOrderListExport(Map<String, Object> map);

    /**
     * 获取已排除不是推广订单的且已支付的实收金额
     * @param map
     * @return
     */
    Double getActualPriceByOutProm(Map<String, Object> map);

    List<OrderEntity> storeTopicOrderList(Map<String, Object> map);

    int queryStoreTopicOrderTotal(Map<String, Object> map);

    //查询与人脸识别认证表相关联的保税展示跨境商品订单
    List<OrderRecognitionDto> queryOrderListByRecognition(Map<String, Object> map);

    //根据订单id查询发送微信模板需要的订单信息
    SendTempDto queryOrderByRecogTemp(long orderId);

    int queryOrderListByRecognitionTotal(Map<String, Object> map);

    int saveOrderVo(OrderVo orderVo);

}
