彭雪彬
2025-07-14 c1d20b425b10e8ba59f102dd1ab413055883eed0
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?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.oying.modules.sh.mapper.OrderProductSnapshotMapper">
    <resultMap id="BaseResultMap" type="com.oying.modules.sh.domain.OrderProductSnapshot">
        <id column="snapshot_id" property="snapshotId"/>
        <result column="order_num" property="orderNum"/>
        <result column="store_id" property="storeId"/>
        <result column="product_id" property="productId"/>
        <result column="product_code" property="productCode"/>
        <result column="product_barcode" property="productBarcode"/>
        <result column="product_name" property="productName"/>
        <result column="product_title" property="productTitle"/>
        <result column="product_main_image" property="productMainImage"/>
        <result column="product_description" property="productDescription"/>
        <result column="param_data" property="paramData"/>
        <result column="unit_price" property="unitPrice"/>
        <result column="detail_count" property="detailCount"/>
        <result column="original_price" property="originalPrice"/>
        <result column="paid_price" property="paidPrice"/>
        <result column="actually_pay_price" property="actuallyPayPrice"/>
        <result column="pay_state" property="payState"/>
    </resultMap>
 
    <sql id="Base_Column_List">
        snapshot_id, order_num, store_id, product_id, product_code, product_barcode, product_name, product_title, product_main_image, product_description, param_data, unit_price, detail_count, original_price, paid_price, actually_pay_price, pay_state
    </sql>
 
    <select id="findAll" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from sh_order_product_snapshot
        <where>
            <if test="criteria.orderNum != null">
                and order_num = #{criteria.orderNum}
            </if>
            <if test="criteria.storeId != null">
                and store_id = #{criteria.storeId}
            </if>
            <if test="criteria.productId != null">
                and product_id = #{criteria.productId}
            </if>
            <if test="criteria.productCode != null">
                and product_code like concat('%',#{criteria.productCode},'%')
            </if>
            <if test="criteria.productBarcode != null">
                and product_barcode like concat('%',#{criteria.productBarcode},'%')
            </if>
            <if test="criteria.productName != null">
                and product_name like concat('%',#{criteria.productName},'%')
            </if>
            <if test="criteria.productTitle != null">
                and product_title like concat('%',#{criteria.productTitle},'%')
            </if>
            <if test="criteria.payState != null">
                and pay_state = #{criteria.payState}
            </if>
        </where>
        order by snapshot_id desc
    </select>
    <select id="queryOrderProductSnapshot" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from sh_order_product_snapshot
        where order_num = #{orderNum}
        order by snapshot_id desc
    </select>
</mapper>