<?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.sunxung.factoring.inkassomapper.SteelWaiterMapper">



    <select id="findAllBillNumbers" resultType="java.lang.String">
        select SellBillNumber from SellBill where CompanyName = #{supplierName}
        <if test="keyword !=null and keyword != ''">
            and SellBillNumber like  CONCAT('%',#{keyword} ,'%' )
        </if>
    </select>
    <select id="getGoodsByBillNumber" resultType="com.sunxung.factoring.entity.steelwaiter.SellBillItem">
        select t1.* from SellBillItem t1
        left join SellBill t2 on t1.SellBillId = t2.id
        where t2.SellBillNumber = #{billNumber} and t2.CompanyName = #{companyName}
    </select>
    <select id="getBillByBillNumber" resultType="com.sunxung.factoring.entity.steelwaiter.SellBill">
        select * from SellBill where SellBillNumber = #{billNumber} and CompanyName = #{companyName}
    </select>
</mapper>
