<?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="com.shkj.wms.mapper.BaseBarcodesOutMapper">


    <select id="selectVinOutboundList" resultType="com.shkj.wms.bo.BaseBarcodesOutAddBo">
      select vin, derive, traverse_date, color, bumper_type, vehicle_code, out_status ,'0' as isUrgent from base_barcodes_out
        where out_status="0"
        order by traverse_date asc
    </select>

    <select id="getBarcodesOutData" resultType="com.shkj.wms.vo.BaseBarcodesOutVo">
        select outs.vin,derive,vehicle_code,bumper_type,color,outs.batch,head.id as transId,out_status,outs.traverse_date,'1' as isUrgent
        from base_barcodes_out outs left join busin_billhead head
        on outs.vin=head.vin
        where ifnull(audit_flg,0)!=1
        <if test="queryKeywords !=null and queryKeywords !='' ">
            and ( outs.vehicle_code like concat('%', #{queryKeywords}, '%') or outs.derive like concat('%', #{queryKeywords}, '%'))
        </if>

    </select>
    <select id="getBarcodesnoOutData" resultType="com.shkj.wms.vo.BaseBarcodesOutVo">
        SELECT o.derive,
               o.goods_no,
               o.color,
               o.bumper_type,
               o.vehicle_code,
               o.traverse_date,
               b.batch,
               b.is_cancle,
               o.id
        FROM base_barcodes_out o
                 LEFT JOIN busin_billhead b ON o.vin = b.vin
        WHERE out_status = '1'
          and ifnull(audit_flg, '0')!='1'
	      and ifnull(is_cancle,'0')!='1'
          ORDER BY batch ASC
    </select>
</mapper>
