Bang Hu
2025-08-28 f28da0f4705921b88d94c4531fa89753c4bb9f52
src/main/resources/mapper/OrderInfoMapper.xml
@@ -190,6 +190,56 @@
        </choose>
    </select>
    <!-- 分页查询待审批订单列表(支持产品条件) -->
    <select id="selectPendingApprovalOrderPageWithProductConditions" resultMap="BaseResultMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM tb_order_info
        WHERE deleted = 0
        AND order_status IN ('待上传文件', '待授权', '待交易确认', '已完成', '已评价')
        <if test="orderStatus != null and orderStatus != ''">
            AND order_status = #{orderStatus}
        </if>
        <if test="productName != null and productName != ''">
            AND product_name LIKE CONCAT('%', #{productName}, '%')
        </if>
        <if test="providerName != null and providerName != ''">
            AND provider_name LIKE CONCAT('%', #{providerName}, '%')
        </if>
        <if test="orderId != null and orderId != ''">
            AND order_id LIKE CONCAT('%', #{orderId}, '%')
        </if>
        <if test="applyTimeStart != null and applyTimeStart != ''">
            AND apply_time >= #{applyTimeStart}::timestamp
        </if>
        <if test="applyTimeEnd != null and applyTimeEnd != ''">
            AND apply_time &lt;= #{applyTimeEnd}::timestamp
        </if>
        <if test="productIds != null and productIds.size() > 0">
            AND product_id IN
            <foreach collection="productIds" item="productId" open="(" separator="," close=")">
                #{productId}
            </foreach>
        </if>
        ORDER BY
        <choose>
            <when test="orderBy != null and orderBy != ''">
                ${orderBy}
            </when>
            <otherwise>
                created_at
            </otherwise>
        </choose>
        <choose>
            <when test="orderDirection != null and orderDirection == 'asc'">
                ASC
            </when>
            <otherwise>
                DESC
            </otherwise>
        </choose>
    </select>
    <!-- 分页查询买家订单列表(支持产品条件) -->
    <select id="selectBuyerOrderPageWithProductConditions" resultMap="BaseResultMap">
        SELECT