<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.erp.dashboard.repository.OrderRepository">

    <!-- 查询结果映射 -->
    <resultMap id="OrderStatsResultMap" type="com.erp.dashboard.dto.OrderStatsDTO">
        <result column="totalOrders" property="totalOrders"/>
        <result column="completedOrders" property="completedOrders"/>
        <result column="cancelledOrders" property="cancelledOrders"/>
        <result column="totalAmount" property="totalAmount"/>
    </resultMap>

    <resultMap id="RecentOrderResultMap" type="com.erp.dashboard.dto.RecentOrderDTO">
        <result column="id" property="id"/>
        <result column="short_id" property="shortId"/>
        <result column="platform" property="platform"/>
        <result column="shop_name" property="shopName"/>
        <result column="order_status" property="orderStatus"/>
        <result column="delivery_status" property="deliveryStatus"/>
        <result column="total_amount" property="totalAmount"/>
        <result column="goods_amount" property="goodsAmount"/>
        <result column="freight" property="freight"/>
        <result column="payment_time" property="paymentTime"/>
        <result column="warehouse_name" property="warehouseName"/>
        <result column="express_company" property="expressCompany"/>
        <result column="express_no" property="expressNo"/>
        <result column="itemCount" property="itemCount"/>
    </resultMap>

    <resultMap id="CloudWarehouseStatsResultMap" type="com.erp.dashboard.dto.CloudWarehouseStatsDTO">
        <result column="totalCloudOrders" property="totalCloudOrders"/>
        <result column="shippedOrders" property="shippedOrders"/>
    </resultMap>

</mapper>
