package com.willalp.canteen.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.willalp.canteen.domain.HsCanteenOrder;
import com.willalp.canteen.domain.resp.CustomGetOrderResp;
import com.willalp.canteen.domain.vo.CustomGetOrderVo;
import com.willalp.canteen.domain.vo.HsCanteenOrderInfoVo;
import com.willalp.canteen.domain.vo.LiveUseMoneyMonthStatExcel;
import org.apache.ibatis.annotations.Param;

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

/**
 * 食堂订单Mapper接口
 *
 * @author songyu
 * @date 2021-12-03
 */
public interface HsCanteenOrderMapper extends BaseMapper<HsCanteenOrder>
{

    /**
     * 根据菜单编号获取订单信息
     *
     * @param menuCode
     * @return
     */
    List<HsCanteenOrderInfoVo> getOrderDataBasedOnMenu(@Param("menuCode") String menuCode);

    /**
     * 根据菜单编号获取订单信息
     *
     * @param menuCode
     * @return
     */
    List<LiveUseMoneyMonthStatExcel> getOrderDataBasedOnMenuAndMonthStat(@Param("menuCode") String menuCode,
                                                                         @Param("year") int year,
                                                                         @Param("month") int month);


    /**
     * 查询食堂订单
     *
     * @param orderId 食堂订单主键
     * @return 食堂订单
     */
    public HsCanteenOrder selectHsCanteenOrderByOrderId(String orderId);

    /**
     * 查询食堂订单列表
     *
     * @param hsCanteenOrder 食堂订单
     * @return 食堂订单集合
     */
    public List<HsCanteenOrder> selectHsCanteenOrderList(HsCanteenOrder hsCanteenOrder);


    /**
     * 获取当前时间可取订单
     * @param customGetOrderVo
     * @return
     */
    List<CustomGetOrderResp> getOrderNow(CustomGetOrderVo customGetOrderVo);

    /**
     * 获取当前时间可取订单
     * @param customGetOrderVo
     * @return
     */
    CustomGetOrderResp getMenuNow(CustomGetOrderVo customGetOrderVo);

    /**
     * 作废食堂订单
     * @param jgid
     * @param orderid
     */
    public void updateCanteenOrderZfpb(@Param("jgid") String jgid, @Param("orderid") String orderid);

    /**
     * 近一月订单量
     * @param hsCanteenOrder
     * @return
     */
    public List<HsCanteenOrder> selectHsCanteenOrderLists(HsCanteenOrder hsCanteenOrder);

    /**
     * 首页金额总额
     * @param hsCanteenOrder
     * @return
     */
    public String getSumpay(HsCanteenOrder hsCanteenOrder);

    /**
     * 首页订单总数
     * @param hsCanteenOrder
     * @return
     */
    public String getSumOrderNum(HsCanteenOrder hsCanteenOrder);

    public List<Map<String,Object>> checkSfzf(HsCanteenOrder hsCanteenOrder);

    public List<Map<String,Object>> getConsumeReport(Map<String,Object> params);


    /**
     * 今日未下单用户
     *
     * @return
     */
    List<HsCanteenOrder> todayNotOrderUser();
}
