package com.casic.missiles.mapper.business;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.casic.missiles.dto.cockpit.CityTopResponse;
import com.casic.missiles.dto.cockpit.BusTrendResponse;
import com.casic.missiles.model.business.BusinessOrder;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 业务管理-委托书 Mapper 接口
 * </p>
 *
 * @author wangpeng
 * @since 2023-02-02
 */
public interface BusinessOrderMapper extends BaseMapper<BusinessOrder> {

    @Select("SELECT IFNULL(max(RIGHT(order_code, 12)), 0) from  business_order")
    Long selectMaxCOrderNo();

    List<Long> selectIdsByStatus(@Param("orderStatus") String orderStatus);

    Integer ordersToday();

    Integer ordersThisYear();

    Integer ordersThisMonth();

    List<BusinessOrder> selectOrderForCockpit();

    List<CityTopResponse> selectOrderCityRank();

    List<BusTrendResponse> selectPreMonthCountByYear();

}
