陶杰
2024-12-21 ae3dd677f3bbbc26d7c41aebc0e6048e2d20593c
src/main/resources/mapper/payment/DeliveryOrderMapper.xml
@@ -6,7 +6,10 @@
        SELECT q.*, o.warehouse_name, o.warehouse_location_code, o.payment_time
        FROM t_delivery_order q
        join t_order o on q.order_id = o.id
        left join t_warehouse w on o.warehouse_id=w.id
        left join t_warehouse_location wl on o.warehouse_location_id=wl.id
        WHERE q.deleted = 0 and o.deleted = 0
--         and w.deleted=0 and wl.deleted=0
        and q.supplier_id = #{supplierId}
        <if test="condition.orderNo != null and condition.orderNo != ''">
            AND q.order_no LIKE concat('%', #{condition.orderNo},'%')
@@ -17,13 +20,20 @@
                #{item}
            </foreach>
        </if>
<!--        <if test="condition.startDate != null">-->
<!--            AND q.create_time &gt; #{condition.startDate}-->
<!--        </if>-->
<!--        <if test="condition.endDate != null">-->
<!--            AND q.create_time &lt;= #{condition.endDate}-->
<!--        </if>-->
        <if test="condition.startDate != null">
            AND q.create_time &gt; #{condition.startDate}
            AND o.payment_time &gt;= #{condition.startDate}
        </if>
        <if test="condition.endDate != null">
            AND q.create_time &lt;= #{condition.endDate}
            AND o.payment_time &lt; #{condition.endDate}
        </if>
        ORDER BY o.payment_time
--         ORDER BY o.payment_time
        order by w.seq,wl.seq asc
    </select>
    <select id="selectDoStationList" resultType="com.mzl.flower.dto.response.payment.DeliveryOrderStationListDTO">
@@ -130,11 +140,17 @@
            AND o.warehouse_location_code LIKE concat('%', #{condition.warehouseLocationCode},'%')
        </if>
<!--        <if test="condition.startDate != null">-->
<!--            AND q.create_time &gt; #{condition.startDate}-->
<!--        </if>-->
<!--        <if test="condition.endDate != null">-->
<!--            AND q.create_time &lt;= #{condition.endDate}-->
<!--        </if>-->
        <if test="condition.startDate != null">
            AND q.create_time &gt; #{condition.startDate}
            AND o.payment_time &gt;= #{condition.startDate}
        </if>
        <if test="condition.endDate != null">
            AND q.create_time &lt;= #{condition.endDate}
            AND o.payment_time &lt; #{condition.endDate}
        </if>
        ) tt
        GROUP BY tt.id, tt.supplierName, tt.supplierTel, tt.stationName
@@ -177,11 +193,17 @@
            AND o.warehouse_location_code LIKE concat('%', #{condition.warehouseLocationCode},'%')
        </if>
<!--        <if test="condition.startDate != null">-->
<!--            AND q.create_time &gt; #{condition.startDate}-->
<!--        </if>-->
<!--        <if test="condition.endDate != null">-->
<!--            AND q.create_time &lt;= #{condition.endDate}-->
<!--        </if>-->
        <if test="condition.startDate != null">
            AND q.create_time &gt; #{condition.startDate}
            AND o.payment_time &gt;= #{condition.startDate}
        </if>
        <if test="condition.endDate != null">
            AND q.create_time &lt;= #{condition.endDate}
            AND o.payment_time &lt; #{condition.endDate}
        </if>
        ORDER BY q.arrive_time
@@ -213,11 +235,17 @@
            t.warehouse_location_code LIKE concat('%', #{name},'%')
            )
        </if>
<!--        <if test="startDate != null">-->
<!--            AND o.create_time &gt; #{startDate}-->
<!--        </if>-->
<!--        <if test="endDate != null">-->
<!--            AND o.create_time &lt;= #{endDate}-->
<!--        </if>-->
        <if test="startDate != null">
            AND o.create_time &gt; #{startDate}
            AND t.payment_time &gt;= #{startDate}
        </if>
        <if test="endDate != null">
            AND o.create_time &lt;= #{endDate}
            AND t.payment_time &lt; #{endDate}
        </if>
        <if test="statusList != null and statusList.size > 0">