p-honggang.li
7 天以前 baac505052a5d9e63536eb7de32ba346d7e98ca7
src/main/resources/mapper/OrderInfoMapper.xml
@@ -24,13 +24,14 @@
        <result column="created_at" property="createdAt" jdbcType="TIMESTAMP"/>
        <result column="updated_at" property="updatedAt" jdbcType="TIMESTAMP"/>
        <result column="deleted" property="deleted" jdbcType="INTEGER"/>
        <result column="is_evaluate" property="isEvaluate" jdbcType="VARCHAR"/>
    </resultMap>
    <!-- 基础字段列表 -->
    <sql id="Base_Column_List">
        order_id, product_id, user_id, unit_id, product_name, provider_name, provider_id,
        apply_time, order_status, total_amount, payment_type, payment_status, workflow_id,
        current_step, approval_flow, buyer_remarks, seller_remarks, created_at, updated_at, deleted
        current_step, approval_flow, buyer_remarks, seller_remarks, created_at, updated_at, deleted, is_evaluate
    </sql>
    <!-- 分页查询买家订单列表 -->
@@ -152,7 +153,7 @@
        <include refid="Base_Column_List"/>
        FROM tb_order_info
        WHERE deleted = 0
        AND order_status IN ('待上传文件', '待授权', '待交易确认', '已完成', '已评价')
        AND order_status IN ('待上传文件', '待审批授权','待授权', '待交易确认', '已完成', '已取消')
        <if test="orderStatus != null and orderStatus != ''">
            AND order_status = #{orderStatus}
        </if>
@@ -171,6 +172,68 @@
        <if test="applyTimeEnd != null and applyTimeEnd != ''">
            AND apply_time &lt;= #{applyTimeEnd}::timestamp
        </if>
        <if test="workFlowIds != null and workFlowIds.size() > 0">
            AND workflow_id IN
            <foreach collection="workFlowIds" item="workFlowId" open="(" separator="," close=")">
                #{workFlowId}
            </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="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>
        <if test="workFlowIds != null and workFlowIds.size() > 0">
            AND workflow_id IN
            <foreach collection="workFlowIds" item="workFlowId" open="(" separator="," close=")">
                #{workFlowId}
            </foreach>
        </if>
        ORDER BY
        <choose>
            <when test="orderBy != null and orderBy != ''">