<?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="org.jeecg.modules.fbsDispatchList.mapper.FbsDispatchListMapper">
    <select id="getWatingSendList" resultType="java.util.HashMap">

         SELECT top 6 <!--c.cWhName '仓库',a.cInvCode '物料编码',d.cInvName '物料名称',d.cInvStd '规格',
                a.iQuantity - a.fOutQuantity '已做发货单未出库数据',b.dDate '到货日期'-->
                c.cWhName warehouseName,a.cInvCode materialCode,d.cInvName materialName,d.cInvStd specs,
                a.iQuantity - a.fOutQuantity sendSum,CONVERT(varchar(30),b.dDate,23) planSendDate
        FROM
             DispatchLists a
             left join DispatchList b on a.DLID  = b.DLID
             left join Warehouse c on a.cWhCode = c.cWhCode
             left join Inventory d on a.cInvCode = d.cInvCode
          where  (a.iQuantity - a.fOutQuantity) &gt; 0
					order by b.dDate desc

    </select>

     <select id="getSendSum" resultType="int">

         SELECT COUNT (1)
        FROM
             DispatchLists a
             left join DispatchList b on a.DLID  = b.DLID
             left join Warehouse c on a.cWhCode = c.cWhCode
             left join Inventory d on a.cInvCode = d.cInvCode
          where  (a.iQuantity - a.fOutQuantity) &lt;= 0

    </select>
</mapper>