Pu Zhibing
2024-10-16 c4664502dfdaffff555b532e65b51a57ac8b29c2
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
68
69
70
71
72
73
74
75
<?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.ruoyi.order.mapper.TExchangeOrderMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.order.api.model.TExchangeOrder">
        <id column="id" property="id" />
        <result column="code" property="code" />
        <result column="app_user_id" property="appUserId" />
        <result column="order_type" property="orderType" />
        <result column="goods_id" property="goodsId" />
        <result column="coupon_id" property="couponId" />
        <result column="purchase_quantity" property="purchaseQuantity" />
        <result column="app_user_address_id" property="appUserAddressId" />
        <result column="points" property="points" />
        <result column="remark" property="remark" />
        <result column="status" property="status" />
        <result column="express_company" property="expressCompany" />
        <result column="express_number" property="expressNumber" />
        <result column="consigner_id" property="consignerId" />
        <result column="consigner_time" property="consignerTime" />
        <result column="receiving_time" property="receivingTime" />
        <result column="cancellation_time" property="cancellationTime" />
        <result column="cancellation_id" property="cancellationId" />
        <result column="create_time" property="createTime" />
        <result column="del_flag" property="delFlag" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, code, app_user_id, order_type, goods_id, coupon_id, purchase_quantity, app_user_address_id, points, remark, status, express_company, express_number, consigner_id, consigner_time, receiving_time, cancellation_time, cancellation_id, create_time, del_flag
    </sql>
    <select id="pageList" resultType="com.ruoyi.order.api.model.TExchangeOrder">
        select t1.*
        from t_exchange_order t1
        where 1=1
        <if test="null != req.code and req.code!=''">
            and t1.code  LIKE CONCAT('%',#{req.code},'%')
        </if>
        <if test="null != req.status">
            and t1.status = #{req.status}
        </if>
        <if test="null != req.userIds and req.userIds.size()>0" >
            and t1.app_user_id in
            <foreach collection="req.userIds" item="item" index="index" separator="," open="(" close=")">
                #{item}
            </foreach>
        </if>
        <if test="null != req.userIds and req.userIds.size()>0" >
            and t1.app_user_id in
            <foreach collection="req.userIds" item="item" index="index" separator="," open="(" close=")">
                #{item}
            </foreach>
        </if>
 
        <if test="null != req.couponIds and req.couponIds.size()>0" >
            and t1.coupon_id in
            <foreach collection="req.couponIds" item="item" index="index" separator="," open="(" close=")">
                #{item}
            </foreach>
        </if>
        <if test="null != req.goodsIds and req.goodsIds.size()>0" >
            and t1.goods_id in
            <foreach collection="req.goodsIds" item="item" index="index" separator="," open="(" close=")">
                #{item}
            </foreach>
        </if>
        <if test="startTime1 != null and startTime1!=''">
            and (t1.create_time between #{startTime1} and #{startTime2})
        </if>
        AND t1.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()}
        order by t1.create_time desc
    </select>
 
</mapper>