seatonwan9
2025-08-14 e4f9152bcacf02be0cb376dcb225eaf444b8951b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?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.webmanage.mapper.OrderDetailMapper">
 
    <!-- 基础结果映射 -->
    <resultMap id="BaseResultMap" type="com.webmanage.entity.OrderDetail">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="order_id" property="orderId" jdbcType="VARCHAR"/>
        <result column="pricing_id" property="pricingId" jdbcType="BIGINT"/>
        <result column="product_id" property="productId" jdbcType="BIGINT"/>
        <result column="suite_name" property="suiteName" jdbcType="VARCHAR"/>
        <result column="sales_form" property="salesForm" jdbcType="VARCHAR"/>
        <result column="customer_type" property="customerType" jdbcType="VARCHAR"/>
        <result column="account_limit" property="accountLimit" jdbcType="VARCHAR"/>
        <result column="concurrent_nodes" property="concurrentNodes" jdbcType="VARCHAR"/>
        <result column="price_type" property="priceType" jdbcType="VARCHAR"/>
        <result column="price_unit" property="priceUnit" jdbcType="VARCHAR"/>
        <result column="unit_price" property="unitPrice" jdbcType="NUMERIC"/>
        <result column="quantity" property="quantity" jdbcType="INTEGER"/>
        <result column="duration" property="duration" jdbcType="INTEGER"/>
        <result column="total_price" property="totalPrice" jdbcType="NUMERIC"/>
        <result column="provider_id" property="providerId" jdbcType="BIGINT"/>
        <result column="provider_name" property="providerName" jdbcType="VARCHAR"/>
        <result column="remarks" property="remarks" jdbcType="LONGVARCHAR"/>
        <result column="created_at" property="createdAt" jdbcType="TIMESTAMP"/>
        <result column="updated_at" property="updatedAt" jdbcType="TIMESTAMP"/>
        <result column="deleted" property="deleted" jdbcType="INTEGER"/>
    </resultMap>
 
    <!-- 基础字段列表 -->
    <sql id="Base_Column_List">
        id, order_id, pricing_id, product_id, suite_name, sales_form, customer_type,
        account_limit, concurrent_nodes, price_type, price_unit, unit_price, quantity,
        duration, total_price, provider_id, provider_name, remarks, created_at, updated_at, deleted
    </sql>
 
    <!-- 根据订单ID查询订单详情列表 -->
    <select id="selectByOrderId" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM order_detail
        WHERE deleted = 0 AND order_id = #{orderId}
        ORDER BY created_at ASC
    </select>
 
</mapper>