无关风月
2024-08-24 d0a2f8a17bb7888602f0f421bb01a765ef04fd29
ruoyi-service/ruoyi-order/src/main/resources/mapper/order/TExchangeOrderMapper.xml
@@ -30,5 +30,35 @@
    <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.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 or null != req.couponIds and req.couponIds.size()>0" >
            and (t1.goods_id in
            <foreach collection="req.goodsIds" item="item" index="index" separator="," open="(" close=")">
                #{item}
            </foreach>
            or
            and t1.coupon_id in
            <foreach collection="req.couponIds" 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()}
    </select>
</mapper>