OrderExtMapper.xml 1.51 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.delivery.mapper.OrderExtMapper">

    <!--发货方,客户是否有订单判断-->
    <select id="IsHavingOrderConsignor" resultType="java.lang.Integer">
        SELECT count(*)
        FROM ecw_order o
        LEFT JOIN ecw_order_consignor r ON o.order_id = r.order_id
        and r.deleted = 0
        where o.deleted = 0
        and r.customer_id = #{customerId}
        and o.status >= 5
        <!--订单已取消88,有可能包含在类,暂时未做处理-->
    </select>

    <!--收货方客户,是否有已入仓订单-->
    <select id="IsHavingOrderConsignee" resultType="java.lang.Integer">
        SELECT count(*)
        FROM ecw_order o
                 LEFT JOIN ecw_order_consignee r ON o.order_id = r.order_id
            and r.deleted = 0
        where o.deleted = 0
          and r.customer_id = #{customerId}
          and o.status >= 5

    </select>


    <select id="IsHavingOrder" resultType="java.lang.Integer">
lanbaoming's avatar
lanbaoming committed
31 32 33 34 35 36 37 38 39 40 41
        SELECT COUNT(*)
        from (
                 select id as id
                 from ecw_target_log
                 where deleted = 0
                   and customer_id = #{customerId}
                 UNION
                 SELECT order_id as id
                 from ecw_order
                 where deleted = 0
                   and customer_id = #{customerId}) as a
42 43 44 45 46 47 48

    </select>


</mapper>