guoyuji
2024-09-03 76bf2824bf55e8f4c3ccbc14b3b2719bf8fb219f
north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml
@@ -25,14 +25,22 @@
    <select id="selectMaxOrderIdByMonth">
        select
            ifnull(SUBSTR(order_id from 7),0)
            ifnull(SUBSTR(max(order_id) from 7),0)
        from
            `order` as a
        where
            date(a.create_time)  BETWEEN DATE_FORMAT(DATE(NOW()), '%Y-%m-01') AND DATE(NOW())
        order by id desc    limit  1
    </select>
    <select id="selectMaxOrderIdByYear">
       select ifnull((select
            SUBSTR(order_id from 5)
        from
            `order` as a
        where
            year(a.create_time)  = year(now())
        order by  id desc limit 1),0) temp
    </select>
    <update id="updateOrderParameter">
        update `order` o
@@ -115,6 +123,14 @@
               and o.salesman REGEXP #{order.salesman}
           </if>
            <if test="order.creator != null and order.creator != ''">
                and o.creator REGEXP #{order.creator}
            </if>
            <if test="order.verifier != null and order.verifier != ''">
                and o.verifier REGEXP #{order.verifier}
            </if>
           <if test="order.perimeter != null and order.perimeter != ''">
               and o.perimeter REGEXP #{order.perimeter}
           </if>
@@ -130,26 +146,26 @@
           <if test="order.deliveryAddress != null and order.deliveryAddress != ''">
               and o.delivery_address REGEXP #{order.deliveryAddress}
           </if>
        <if test="order.delivery != null and order.delivery != ''">
        <if test="order.delivery != null ">
            and o.delivery = #{order.delivery}
        </if>
        <if test="order.createOrder != null and order.createOrder != ''">
            and o.create_order = #{order.createOrder}
        </if>
        <if test="order.processReview != null and order.processReview != ''">
        <if test="order.processReview != null ">
            and o.process_review = #{order.processReview}
        </if>
        <if test="order.orderReview != null and order.orderReview != ''">
        <if test="order.orderReview != null ">
            and o.order_review = #{order.orderReview}
        </if>
        <if test="order.productionOrder != null and order.productionOrder != ''">
        <if test="order.productionOrder != null ">
            and o.production_order = #{order.productionOrder}
        </if>
        <if test="order.processingCard != null and order.processingCard != ''">
        <if test="order.processingCard != null ">
            and o.processing_card = #{order.processingCard}
        </if>
        <if test="order.warehousing != null and order.warehousing != ''">
        <if test="order.warehousing != null ">
            and o.warehousing = #{order.warehousing}
        </if>
        <if test="order.processingNote != null and order.processingNote != ''">
            and o.processing_note REGEXP #{order.processingNote}
        </if>
        group by o.id
        order by o.id desc
@@ -163,7 +179,7 @@
        from
        `order` as o
        where date (o.create_time)>=#{startDate} and date(o.create_time) &lt;= #{endDate}
            <if test="orderType!= null and orderType != ''">
            <if test="orderType!= null and orderType != 0">
                and o.create_order = #{orderType}
            </if>
@@ -203,6 +219,14 @@
                and o.salesman REGEXP #{order.salesman}
            </if>
            <if test="order.creator != null and order.creator != ''">
                and o.creator REGEXP #{order.creator}
            </if>
            <if test="order.verifier != null and order.verifier != ''">
                and o.verifier REGEXP #{order.verifier}
            </if>
            <if test="order.perimeter != null and order.perimeter != ''">
                and o.perimeter REGEXP #{order.perimeter}
            </if>
@@ -218,6 +242,27 @@
            <if test="order.deliveryAddress != null and order.deliveryAddress != ''">
                and o.delivery_address REGEXP #{order.deliveryAddress}
            </if>
        <if test="order.delivery != null ">
            and o.delivery = #{order.delivery}
        </if>
        <if test="order.processReview != null ">
            and o.process_review = #{order.processReview}
        </if>
        <if test="order.orderReview != null ">
            and o.order_review = #{order.orderReview}
        </if>
        <if test="order.productionOrder != null ">
            and o.production_order = #{order.productionOrder}
        </if>
        <if test="order.processingCard != null ">
            and o.processing_card = #{order.processingCard}
        </if>
        <if test="order.warehousing != null ">
            and o.warehousing = #{order.warehousing}
        </if>
        <if test="order.processingNote != null and order.processingNote != ''">
            and o.processing_note REGEXP #{order.processingNote}
        </if>
        order by o.id desc
    </select>
    
@@ -240,7 +285,7 @@
    </update>
    <update id="updateMoney">
        update `order` set money = #{order.money},calculate_type = #{order.calculateType} where order_id = #{order.orderId}
        update `order` set money = #{order.money},calculate_type = #{order.calculateType},other_money=#{order.otherMoney} where order_id = #{order.orderId}
    </update>
    <update id="cancelOrder">