廖井涛
2024-07-11 e55a701f5d4807a84eecc6aff5f69e35e9ee6af4
north-glass-erp/src/main/resources/mapper/sd/DeliveryDetailMapper.xml
@@ -148,11 +148,11 @@
    <insert id="insertDeliveryDetail"  useGeneratedKeys="true" >
        insert into sd.delivery_detail (delivery_id,delivery_number,order_number,
                                        area,order_id,quantity,money,delivery_detail_remakes,delivery_detail_state,other_columns,create_time)
                                        area,order_id,quantity,money,delivery_detail_remakes,delivery_detail_state,other_columns,create_time,price)
        values (
                   #{number} ,#{deliveryNumber},#{orderDetail.orderNumber},#{orderDetail.computeArea}*#{orderDetail.deliveryDetail.quantity},
                #{orderDetail.orderId},#{orderDetail.deliveryDetail.quantity},
                #{deliveryDetailMoney},'',1,#{orderDetail.otherColumns},now()
                #{deliveryDetailMoney},'',1,#{orderDetail.otherColumns},now(),#{orderDetail.price}
               )
    </insert>
@@ -170,7 +170,7 @@
               od.building_number,
               od.product_id,
               od.product_name,
               od.price,
               dd.price,
               fgi.storage_region,
               dd.money,
               od.width,
@@ -262,7 +262,7 @@
            </if>
        </where>
        order by dd.id desc
        order by dd.id
        limit #{offset},#{pageSize};
    </select>
@@ -371,7 +371,8 @@
               od.compute_gross_area,
               od.processing_note,
               od.edging_type,
               od.perimeter
               od.perimeter,
               od.other_columns
        from sd.order_detail od
                 left join sd.`order` o on od.order_id = o.order_id
                 left join mm.finished_goods_inventory fgi
@@ -876,8 +877,10 @@
    </select>
    <select id="getSelectDeliveryPrinting" resultMap="selectDeliveryDetailOrderDetail" >
        select dd.delivery_id,od.order_id,od.product_id,od.product_name,sum(dd.area) as area,sum(dd.money) as money,sum(dd.quantity) as quantity from
        select dd.delivery_id,od.order_id,od.product_id,pt.remarks as product_name,sum(dd.area) as area,sum(dd.money) as money,sum(dd.quantity) as quantity from
        delivery_detail dd left join order_detail od on dd.order_id=od.order_id and dd.order_number=od.order_number
                                                            left join product pt on pt.id=od.product_id
        <where>
            <if test="deliveryDetail.deliveryId != null and deliveryDetail.deliveryId != ''">
@@ -888,8 +891,9 @@
    </select>
    <select id="getSelectOrderPrinting"  >
        select od.order_id,od.product_id,od.product_name,sum(od.compute_gross_area) as area,sum(od.gross_amount) as money,sum(od.quantity) as quantity from
         order_detail od
        select od.order_id,od.product_id,p.remarks as product_name,sum(od.compute_gross_area) as area,sum(od.gross_amount) as gross_amount ,sum(od.quantity) as quantity from
         order_detail od left join product p on od.product_id=p.id
        <where>
            <if test="orderDetail.orderId != null and orderDetail.orderId != ''">
                and od.order_id like concat('%',#{orderDetail.orderId},'%')
@@ -901,7 +905,7 @@
    <select id="getSelectDeliveryDetailPrinting" >
        select od.order_id,
               od.order_number,
               od.product_name,
               p.remarks as product_name,
               od.width,
               od.height,
               dd.quantity,
@@ -909,12 +913,32 @@
               dd.area,
               ifnull(od.processing_note,"") as processingNote,
               ifnull(od.building_number,"") as buildingNumber,
               od.price
               dd.price,
               od.other_columns
        from delivery_detail dd
                 left join order_detail od on dd.order_id = od.order_id and dd.order_number = od.order_number
                 left join product p on od.product_id = p.id
        where delivery_id = #{deliveryId}
          and od.order_id = #{orderId}
          and od.product_id = #{productId}
    </select>
    <select id="getSelectotherMoney" >
        select bom.alias,oom.price,#{value}*dd.quantity  as count,oom.price*#{value}*dd.quantity as monery
        from delivery_detail dd
                 left join order_detail od on dd.order_id = od.order_id and dd.order_number = od.order_number
                left join order_other_money oom on oom.order_id=dd.order_id  and oom.column=#{key}
        left join basic_other_money bom on bom.`column`=oom.`column`
        where delivery_id = #{deliveryId}
          and od.order_id = #{orderId} and od.order_number=#{orderNumber} and (od.other_columns!='{}' or od.other_columns!=null)
    </select>
    <select id="getSelectOrderotherMoney" >
        select bom.alias,oom.price,#{value}*od.quantity as count,oom.price*#{value}*od.quantity as monery
                 from order_detail od
                 left join order_other_money oom on oom.order_id=od.order_id  and oom.column=#{key}
                 left join basic_other_money bom on bom.`column`=oom.`column`
        where  od.order_id = #{orderId} and od.order_number=#{orderNumber} and (od.other_columns!='{}' or od.other_columns!=null)
    </select>
    <select id="getSelectOrderDetailPrinting" >
@@ -927,8 +951,9 @@
               od.gross_amount,
               od.compute_gross_area,
               ifnull(od.processing_note,"") as processingNote,
               ifnull(od.remarks,"") as buildingNumber,
               od.price
               ifnull(od.building_number,"") as buildingNumber,
               od.price,
               od.other_columns
        from  order_detail od
        where  od.order_id = #{orderId}
          and od.product_id = #{productId}