liujie
2023-06-12 9c47fbfef3cc65bf67fb44917e33162177bf4f9c
src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderMapper.xml
@@ -219,7 +219,7 @@
        left JOIN t_country t5 on t1.e_state = t5.id
        LEFT JOIN t_goods t6 on t6.order_id = t1.id
        left join t_user t7 on t1.user_id = t7.id
        where (t1.s_driverId = #{id})
        where (t1.s_driverId = #{id} or t1.s_driverId_one=#{id} or t1.e_driverId_one = #{id} or t1.e_driverId = #{id} )
        <if test="containerNo !=null and containerNo !=''">
            and t6.container_number like concat("%",#{containerNo},"%")
        </if>
@@ -232,69 +232,69 @@
        <if test="type !=1">
            and t1.status =1
        </if>
        union all
        select t7.phone phone, CONCAT(t2.`name`,t3.`name`) start,2 type,t1.id orderId,t1.status,CONCAT(t1.e_address,t4.name,t5.name,t1.e_zip_code) end,t1.shipment_date pickUpTime,t6.container_number ccontainerNumber ,t1.type sendType from t_order t1
        left JOIN t_port t2 on t1.`port` = t2.id
        LEFT JOIN t_country t3 on t2.city =t3.id
        left JOIN t_country t4 on t1.e_city =t4.id
        left JOIN t_country t5 on t1.e_state = t5.id
        LEFT JOIN t_goods t6 on t6.order_id = t1.id
        left join t_user t7 on t1.user_id = t7.id
        where (t1.s_driverId_one = #{id} )
        <if test="containerNo !=null and containerNo !=''">
            and t6.container_number like concat("%",#{containerNo},"%")
        </if>
        <if test="sTime !=null">
            and t1.shipment_date between #{sTime} and #{eTime}
        </if>
        <if test="type ==1">
            and t1.status !=1
        </if>
        <if test="type !=1">
            and t1.status =1
        </if>
        union all
        select t7.phone phone, CONCAT(t2.`name`,t3.`name`) start,3 type,t1.id orderId,t1.status,CONCAT(t1.e_address,t4.name,t5.name,t1.e_zip_code) end,t1.shipment_date pickUpTime,t6.container_number ccontainerNumber,t1.type sendType from t_order t1
        left JOIN t_port t2 on t1.`port` = t2.id
        LEFT JOIN t_country t3 on t2.city =t3.id
        left JOIN t_country t4 on t1.e_city =t4.id
        left JOIN t_country t5 on t1.e_state = t5.id
        LEFT JOIN t_goods t6 on t6.order_id = t1.id
        left join t_user t7 on t1.user_id = t7.id
        where ( t1.e_driverId_one = #{id})
        <if test="containerNo !=null and containerNo !=''">
            and t6.container_number like concat("%",#{containerNo},"%")
        </if>
        <if test="sTime !=null">
            and t1.shipment_date between #{sTime} and #{eTime}
        </if>
        <if test="type ==1">
            and t1.status !=1
        </if>
        <if test="type !=1">
            and t1.status =1
        </if>
        union all
        select t7.phone phone, CONCAT(t2.`name`,t3.`name`) start,4 type,t1.id orderId,t1.status,CONCAT(t1.e_address,t4.name,t5.name,t1.e_zip_code) end,t1.shipment_date pickUpTime,t6.container_number ccontainerNumber ,t1.type sendType from t_order t1
        left JOIN t_port t2 on t1.`port` = t2.id
        LEFT JOIN t_country t3 on t2.city =t3.id
        left JOIN t_country t4 on t1.e_city =t4.id
        left JOIN t_country t5 on t1.e_state = t5.id
        LEFT JOIN t_goods t6 on t6.order_id = t1.id
        left join t_user t7 on t1.user_id = t7.id
        where ( t1.e_driverId = #{id} )
        <if test="containerNo !=null and containerNo !=''">
            and t6.container_number like concat("%",#{containerNo},"%")
        </if>
        <if test="sTime !=null">
            and t1.shipment_date between #{sTime} and #{eTime}
        </if>
        <if test="type ==1">
            and t1.status !=1
        </if>
        <if test="type !=1">
            and t1.status =1
        </if>
<!--        union all-->
<!--        select t7.phone phone, CONCAT(t2.`name`,t3.`name`) start,2 type,t1.id orderId,t1.status,CONCAT(t1.e_address,t4.name,t5.name,t1.e_zip_code) end,t1.shipment_date pickUpTime,t6.container_number ccontainerNumber ,t1.type sendType from t_order t1-->
<!--        left JOIN t_port t2 on t1.`port` = t2.id-->
<!--        LEFT JOIN t_country t3 on t2.city =t3.id-->
<!--        left JOIN t_country t4 on t1.e_city =t4.id-->
<!--        left JOIN t_country t5 on t1.e_state = t5.id-->
<!--        LEFT JOIN t_goods t6 on t6.order_id = t1.id-->
<!--        left join t_user t7 on t1.user_id = t7.id-->
<!--        where (t1.s_driverId_one = #{id} )-->
<!--        <if test="containerNo !=null and containerNo !=''">-->
<!--            and t6.container_number like concat("%",#{containerNo},"%")-->
<!--        </if>-->
<!--        <if test="sTime !=null">-->
<!--            and t1.shipment_date between #{sTime} and #{eTime}-->
<!--        </if>-->
<!--        <if test="type ==1">-->
<!--            and t1.status !=1-->
<!--        </if>-->
<!--        <if test="type !=1">-->
<!--            and t1.status =1-->
<!--        </if>-->
<!--        union all-->
<!--        select t7.phone phone, CONCAT(t2.`name`,t3.`name`) start,3 type,t1.id orderId,t1.status,CONCAT(t1.e_address,t4.name,t5.name,t1.e_zip_code) end,t1.shipment_date pickUpTime,t6.container_number ccontainerNumber,t1.type sendType from t_order t1-->
<!--        left JOIN t_port t2 on t1.`port` = t2.id-->
<!--        LEFT JOIN t_country t3 on t2.city =t3.id-->
<!--        left JOIN t_country t4 on t1.e_city =t4.id-->
<!--        left JOIN t_country t5 on t1.e_state = t5.id-->
<!--        LEFT JOIN t_goods t6 on t6.order_id = t1.id-->
<!--        left join t_user t7 on t1.user_id = t7.id-->
<!--        where ( t1.e_driverId_one = #{id})-->
<!--        <if test="containerNo !=null and containerNo !=''">-->
<!--            and t6.container_number like concat("%",#{containerNo},"%")-->
<!--        </if>-->
<!--        <if test="sTime !=null">-->
<!--            and t1.shipment_date between #{sTime} and #{eTime}-->
<!--        </if>-->
<!--        <if test="type ==1">-->
<!--            and t1.status !=1-->
<!--        </if>-->
<!--        <if test="type !=1">-->
<!--            and t1.status =1-->
<!--        </if>-->
<!--        union all-->
<!--        select t7.phone phone, CONCAT(t2.`name`,t3.`name`) start,4 type,t1.id orderId,t1.status,CONCAT(t1.e_address,t4.name,t5.name,t1.e_zip_code) end,t1.shipment_date pickUpTime,t6.container_number ccontainerNumber ,t1.type sendType from t_order t1-->
<!--        left JOIN t_port t2 on t1.`port` = t2.id-->
<!--        LEFT JOIN t_country t3 on t2.city =t3.id-->
<!--        left JOIN t_country t4 on t1.e_city =t4.id-->
<!--        left JOIN t_country t5 on t1.e_state = t5.id-->
<!--        LEFT JOIN t_goods t6 on t6.order_id = t1.id-->
<!--        left join t_user t7 on t1.user_id = t7.id-->
<!--        where ( t1.e_driverId = #{id} )-->
<!--        <if test="containerNo !=null and containerNo !=''">-->
<!--            and t6.container_number like concat("%",#{containerNo},"%")-->
<!--        </if>-->
<!--        <if test="sTime !=null">-->
<!--            and t1.shipment_date between #{sTime} and #{eTime}-->
<!--        </if>-->
<!--        <if test="type ==1">-->
<!--            and t1.status !=1-->
<!--        </if>-->
<!--        <if test="type !=1">-->
<!--            and t1.status =1-->
<!--        </if>-->
    </select>
</mapper>