自动化立体仓库 - WMS系统
1
zhang
2025-09-01 e01fce2ebdd2bdba72682aa314656b57e68f211c
src/main/resources/mapper/OrderMapper.xml
@@ -113,5 +113,36 @@
    <select id="selectOrderNosByOrderNoLike" resultType="java.lang.String">
        select order_no from man_order where settle = 4 and order_no like '%' + #{orderNo} + '%' and doc_type in(21,23)
    </select>
    <select id="getUnfulfilledOrders" resultType="com.zy.asrs.entity.OrderStatisticsDto">
        select
            mo.order_no orderNo,
            count(mo.order_no) sum,
           count(case when md.work_qty = 0 then 1 end) toShipQuantity,
           count(case when md.work_qty != 0 and md.qty = 0 then 1 end) workQuantity,
      count(case when md.anfme = md.qty then 1 end) completedQuantity
        from
            man_order mo
            LEFT JOIN man_order_detl md on
            mo.id = md.order_id
        where
            mo.doc_type = 21
          and mo.settle in(1, 2)
        <if test="orderNo != ''">
            and mo.order_no = #{orderNo}
        </if>
        GROUP BY
            mo.order_no
    </select>
    <select id="selectOrderByOrderNo" resultMap="BaseResultMap">
        select *
        from man_order
        where order_no = #{orderNo}
    </select>
    <select id="getOrderNosByDocType" resultType="String">
        select order_no
        from man_order
        where doc_type =#{docType}
        and status = 0
    </select>
</mapper>