瀏覽代碼

安品导出加条件,首页加接口

lazhaoqian 3 年之前
父節點
當前提交
e27743cc8b

+ 11 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/anpin/StockControl.java

@@ -29,6 +29,7 @@ import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @Author ZhaoQian La
@@ -428,5 +429,15 @@ public class StockControl extends BaseController {
         ExcelUtil<MarketOut> util = new ExcelUtil<MarketOut>(MarketOut.class);
         return util.exportExcel(list, "销售出库");
     }
+    /**
+     * 导出销售出库
+     */
+    @Log(title = "导出销售出库", businessType = BusinessType.EXPORT)
+    @GetMapping("/statistics")
+    public AjaxResult statistics(TWarehouseBills tWarehouseBills)
+    {
+        List<Map<String, Object>> statistics = tWarehousebillsService.statistics(tWarehouseBills);
+        return AjaxResult.success(statistics);
+    }
 
 }

+ 7 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/mapper/TWarehouseBillsMapper.java

@@ -244,4 +244,11 @@ public interface TWarehouseBillsMapper extends BaseMapper<TWarehouseBills> {
      * @return
      */
     List<MarketOut> marketOut(TWarehouseBills tWarehousebills);
+
+    /**
+     * 首页统计 采购 出库 入库 销售
+     * @param tWarehousebills
+     * @return
+     */
+    List<Map<String,Object>> statistics (TWarehouseBills tWarehousebills);
 }

+ 6 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/ITWarehouseBillsService.java

@@ -552,4 +552,10 @@ public interface ITWarehouseBillsService {
      * @return
      */
     public List<MarketOut> marketOut(TWarehouseBills tWarehousebills);
+    /**
+     * 首页统计 采购 出库 入库 销售
+     * @param tWarehousebills
+     * @return
+     */
+    List<Map<String,Object>> statistics (TWarehouseBills tWarehousebills);
 }

+ 5 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseBillsServiceImpl.java

@@ -2303,6 +2303,11 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
         return tWarehouseBillsMapper.marketOut(tWarehousebills);
     }
 
+    @Override
+    public List<Map<String, Object>> statistics(TWarehouseBills tWarehousebills) {
+        return tWarehouseBillsMapper.statistics(tWarehousebills);
+    }
+
     /**
      * app仓储新行提交业务
      *

+ 316 - 2
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehousebillsMapper.xml

@@ -2951,10 +2951,125 @@
                           ON tr.f_id = tw.f_sbu
                 LEFT JOIN t_warehouse th ON tw.f_warehouseid = th.f_id
                 LEFT JOIN t_warehousebillsfees tb ON tb.f_pid = tw.f_id
-        where
+        <where>
             tw.del_flag = '0'
           and tb.del_flag = '0'
           and tw.f_billtype = 'RK'
+        <if test="fFeeid != null ">and tb.f_feeid = #{fFeeid}</if>
+        <if test="fBillno != null  and fBillno != ''">and tw.f_billno = #{fBillno}</if>
+        <if test="fCustomsdeclartion != null  and fCustomsdeclartion != ''">and tw.f_customsdeclartion =
+            #{fCustomsdeclartion}
+        </if>
+        <if test="fOriginalbillno != null  and fOriginalbillno != ''">and tw.f_originalbillno = #{fOriginalbillno}
+        </if>
+        <if test="fDeptid != null ">and tw.f_deptid = #{fDeptid}</if>
+        <if test="fBsdeptid != null ">and tw.f_bsdeptid = #{fBsdeptid}</if>
+        <if test="fContacts != null  and fContacts != ''">and tw.f_contacts = #{fContacts}</if>
+        <if test="fTel != null  and fTel != ''">and tw.f_tel = #{fTel}</if>
+        <if test="fCorpid != null ">and tw.f_corpid = #{fCorpid}</if>
+        <if test="fTocorpid != null ">and tw.f_tocorpid = #{fTocorpid}</if>
+        <if test="fStltypeid != null ">and tw.f_stltypeid = #{fStltypeid}</if>
+        <if test="fBscorpno != null  and fBscorpno != ''">and tw.f_bscorpno = #{fBscorpno}</if>
+        <if test="fWarehouseid != null ">and tw.f_warehouseid = #{fWarehouseid}</if>
+        <if test="fStorekeeper != null  and fStorekeeper != ''">and tw.f_storekeeper = #{fStorekeeper}</if>
+        <if test="fChargedate != null ">and tw.f_chargedate = #{fChargedate}</if>
+        <if test="fBsdate != null ">and tw.f_bsdate = #{fBsdate}</if>
+        <if test="fPlanqty != null ">and tw.f_planqty = #{fPlanqty}</if>
+        <if test="fPlangrossweight != null ">and tw.f_plangrossweight = #{fPlangrossweight}</if>
+        <if test="fPlannetweight != null ">and tw.f_plannetweight = #{fPlannetweight}</if>
+        <if test="fPlanvolumn != null ">and tw.f_planvolumn = #{fPlanvolumn}</if>
+        <if test="fQty != null ">and tw.f_qty = #{fQty}</if>
+        <if test="fGrossweight != null ">and tw.f_grossweight = #{fGrossweight}</if>
+        <if test="fNetweight != null ">and tw.f_netweight = #{fNetweight}</if>
+        <if test="fVolumn != null ">and tw.f_volumn = #{fVolumn}</if>
+        <if test="fBillingway != null ">and tw.f_billingway = #{fBillingway}</if>
+        <if test="fTrademodeid != null ">and tw.f_trademodeid = #{fTrademodeid}</if>
+        <if test="fSbu != null ">and tw.f_sbu = #{fSbu}</if>
+        <if test="fFeetunit != null  and fFeetunit != ''">and tw.f_feetunit = #{fFeetunit}</if>
+        <if test="fMblno != null  and fMblno != ''">and tw.f_mblno = #{fMblno}</if>
+        <if test="fMarks != null  and fMarks != ''">and tw.f_marks = #{fMarks}</if>
+        <if test="fVslvoy != null  and fVslvoy != ''">and tw.f_vslvoy = #{fVslvoy}</if>
+        <if test="fEta != null ">and tw.f_eta = #{fEta}</if>
+        <if test="fCustomno != null  and fCustomno != ''">and tw.f_customno = #{fCustomno}</if>
+        <if test="fIfweigh != null  and fIfweigh != ''">and tw.f_ifweigh = #{fIfweigh}</if>
+        <if test="fIfpledge != null  and fIfpledge != ''">and tw.f_ifpledge = #{fIfpledge}</if>
+        <if test="fIfdamage != null  and fIfdamage != ''">and tw.f_ifdamage = #{fIfdamage}</if>
+        <if test="fBankcorpid != null  and fBankcorpid != ''">and tw.f_bankcorpid = #{fBankcorpid}</if>
+        <if test="fBilltype != null  and fBilltype != ''">and tw.f_billtype = #{fBilltype}</if>
+        <if test="fBillstatus != null ">and tw.f_billstatus = #{fBillstatus}</if>
+        <if test="fBillstatus != null and fBillstatus == 7">and tw.f_billstatus != '6'</if>
+        <if test="fItemsStatus != null ">and tw.f_items_status = #{fItemsStatus}</if>
+        <if test="fBillingDeadline != null ">and tw.f_billing_deadline = #{fBillingDeadline}</if>
+        <if test="fProductName != null  and fProductName != ''">and tw.f_product_name like concat('%',
+            #{fProductName},
+            '%')
+        </if>
+        <if test="fReviewDate != null ">and tw.f_review_date = #{fReviewDate}</if>
+        <if test="fTruckno != null  and fTruckno != ''">and tw.f_truckno = #{fTruckno}</if>
+        <if test="fDriverName != null  and fDriverName != ''">and tw.f_driver_name like concat('%', #{fDriverName},
+            '%')
+        </if>
+        <if test="fDriverTel != null  and fDriverTel != ''">and tw.f_driver_tel = #{fDriverTel}</if>
+        <if test="fDriverIdCar != null  and fDriverIdCar != ''">and tw.f_driver_id_car = #{fDriverIdCar}</if>
+        <if test="fBusinessType != null  and fBusinessType != ''">and tw.f_business_type = #{fBusinessType}</if>
+        <if test="fLabour != null ">and tw.f_labour = #{fLabour}</if>
+        <if test="fFleet != null ">and tw.f_fleet = #{fFleet}</if>
+        <if test="fInwarehouseid != null ">and tw.f_inwarehouseid = #{fInwarehouseid}</if>
+        <if test="fBstime != null ">and tw.f_bstime = #{fBstime}</if>
+        <if test="fCartype != null ">and tw.f_cartype = #{fCartype}</if>
+        <if test="fGoodsid != null ">and tw.f_goodsid = #{fGoodsid}</if>
+        <if test="fNewTrademodeid != null ">and tw.f_new_trademodeid = #{fNewTrademodeid}</if>
+        <if test="fLoadportid != null ">and tw.f_loadportid = #{fLoadportid}</if>
+        <if test="fDestportid != null ">and tw.f_destportid = #{fDestportid}</if>
+        <if test="fServiceitems != null  and fServiceitems != ''">and tw.f_serviceitems = #{fServiceitems}</if>
+        <if test="fInvoceobj != null  and fInvoceobj != ''">and tw.f_invoceobj = #{fInvoceobj}</if>
+        <if test="fSign != null ">and tw.f_sign = #{fSign}</if>
+        <if test="fDetentioncargo != null ">and tw.f_detentioncargo = #{fDetentioncargo}</if>
+        <if test="fBooksmarks != null  and fBooksmarks != ''">and tw.f_booksmarks = #{fBooksmarks}</if>
+        <if test="fShippername != null  and fShippername != ''">and tw.f_shippername like concat('%',
+            #{fShippername},
+            '%')
+        </if>
+        <if test="fShipperattn != null  and fShipperattn != ''">and tw.f_shipperattn = #{fShipperattn}</if>
+        <if test="fShippertel != null  and fShippertel != ''">and tw.f_shippertel = #{fShippertel}</if>
+        <if test="fConsigneername != null  and fConsigneername != ''">and tw.f_consigneername like concat('%',
+            #{fConsigneername}, '%')
+        </if>
+        <if test="fConsigneeattn != null  and fConsigneeattn != ''">and tw.f_consigneeattn = #{fConsigneeattn}</if>
+        <if test="fConsigneetel != null  and fConsigneetel != ''">and tw.f_consigneetel = #{fConsigneetel}</if>
+        <if test="fInsurance != null  and fInsurance != ''">and tw.f_insurance = #{fInsurance}</if>
+        <if test="fInsuranceamt != null ">and tw.f_insuranceamt = #{fInsuranceamt}</if>
+        <if test="fClosedate != null ">and tw.f_closedate = #{fClosedate}</if>
+        <if test="fDocmentdate != null ">and tw.f_docmentdate = #{fDocmentdate}</if>
+        <if test="fVslid != null ">and tw.f_vslid = #{fVslid}</if>
+        <if test="fVoyid != null ">and tw.f_voyid = #{fVoyid}</if>
+        <if test="fTypeid != null ">and tw.f_typeid = #{fTypeid}</if>
+        <if test="fPaymode != null ">and tw.f_paymode = #{fPaymode}</if>
+        <if test="fLaneid != null ">and tw.f_laneid = #{fLaneid}</if>
+        <if test="fCntval != null  and fCntval != ''">and tw.f_cntval = #{fCntval}</if>
+        <if test="createBy != null  and createBy != ''">and tw.create_by = #{createBy}</if>
+        <if test="remark != null  and remark != ''">and tw.remark = #{remark}</if>
+        <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
+            and tw.create_time &gt;= #{cLoadDate[0]}
+        </if>
+        <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
+            and tw.create_time &lt;= #{cLoadDate[1]}
+        </if>
+        <if test='moneys != null and moneys[0] != null and moneys[0]!= ""'>
+            and tw.f_money &gt;= #{moneys[0]}
+        </if>
+        <if test='moneys != null and moneys[1] != null and moneys[1]!= ""'>
+            and tw.f_money &lt;= #{moneys[1]}
+        </if>
+        <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
+            and tw.f_bsdate &gt;= #{timeInterval[0]}
+        </if>
+        <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
+            and tw.f_bsdate &lt;= #{timeInterval[1]}
+        </if>
+        <if test="fTakeOrders != null "> and tw.f_take_orders = #{fTakeOrders}</if>
+        <if test="fReason != null  and fReason != ''"> and tw.f_reason = #{fReason}</if>
+        </where>
         ORDER BY tw.f_bsdate DESC,tw.f_id DESC
     </select>
     <select id="marketOut" parameterType="TWarehousebills" resultType="com.ruoyi.anpin.MarketOut">
@@ -2996,10 +3111,209 @@
         ON tr.f_id = tw.f_sbu
         LEFT JOIN t_warehouse th ON tw.f_warehouseid = th.f_id
         LEFT JOIN t_warehousebillsfees tb ON tb.f_pid = tw.f_id
-        where
+        <where>
             tw.del_flag = '0'
             and tb.del_flag = '0'
             and tw.f_billtype = 'XS'
+            <if test="fFeeid != null ">and tb.f_feeid = #{fFeeid}</if>
+            <if test="fBillno != null  and fBillno != ''">and tw.f_billno = #{fBillno}</if>
+            <if test="fCustomsdeclartion != null  and fCustomsdeclartion != ''">and tw.f_customsdeclartion =
+                #{fCustomsdeclartion}
+            </if>
+            <if test="fOriginalbillno != null  and fOriginalbillno != ''">and tw.f_originalbillno = #{fOriginalbillno}
+            </if>
+            <if test="fDeptid != null ">and tw.f_deptid = #{fDeptid}</if>
+            <if test="fBsdeptid != null ">and tw.f_bsdeptid = #{fBsdeptid}</if>
+            <if test="fContacts != null  and fContacts != ''">and tw.f_contacts = #{fContacts}</if>
+            <if test="fTel != null  and fTel != ''">and tw.f_tel = #{fTel}</if>
+            <if test="fCorpid != null ">and tw.f_corpid = #{fCorpid}</if>
+            <if test="fTocorpid != null ">and tw.f_tocorpid = #{fTocorpid}</if>
+            <if test="fStltypeid != null ">and tw.f_stltypeid = #{fStltypeid}</if>
+            <if test="fBscorpno != null  and fBscorpno != ''">and tw.f_bscorpno = #{fBscorpno}</if>
+            <if test="fWarehouseid != null ">and tw.f_warehouseid = #{fWarehouseid}</if>
+            <if test="fStorekeeper != null  and fStorekeeper != ''">and tw.f_storekeeper = #{fStorekeeper}</if>
+            <if test="fChargedate != null ">and tw.f_chargedate = #{fChargedate}</if>
+            <if test="fBsdate != null ">and tw.f_bsdate = #{fBsdate}</if>
+            <if test="fPlanqty != null ">and tw.f_planqty = #{fPlanqty}</if>
+            <if test="fPlangrossweight != null ">and tw.f_plangrossweight = #{fPlangrossweight}</if>
+            <if test="fPlannetweight != null ">and tw.f_plannetweight = #{fPlannetweight}</if>
+            <if test="fPlanvolumn != null ">and tw.f_planvolumn = #{fPlanvolumn}</if>
+            <if test="fQty != null ">and tw.f_qty = #{fQty}</if>
+            <if test="fGrossweight != null ">and tw.f_grossweight = #{fGrossweight}</if>
+            <if test="fNetweight != null ">and tw.f_netweight = #{fNetweight}</if>
+            <if test="fVolumn != null ">and tw.f_volumn = #{fVolumn}</if>
+            <if test="fBillingway != null ">and tw.f_billingway = #{fBillingway}</if>
+            <if test="fTrademodeid != null ">and tw.f_trademodeid = #{fTrademodeid}</if>
+            <if test="fSbu != null ">and tw.f_sbu = #{fSbu}</if>
+            <if test="fFeetunit != null  and fFeetunit != ''">and tw.f_feetunit = #{fFeetunit}</if>
+            <if test="fMblno != null  and fMblno != ''">and tw.f_mblno = #{fMblno}</if>
+            <if test="fMarks != null  and fMarks != ''">and tw.f_marks = #{fMarks}</if>
+            <if test="fVslvoy != null  and fVslvoy != ''">and tw.f_vslvoy = #{fVslvoy}</if>
+            <if test="fEta != null ">and tw.f_eta = #{fEta}</if>
+            <if test="fCustomno != null  and fCustomno != ''">and tw.f_customno = #{fCustomno}</if>
+            <if test="fIfweigh != null  and fIfweigh != ''">and tw.f_ifweigh = #{fIfweigh}</if>
+            <if test="fIfpledge != null  and fIfpledge != ''">and tw.f_ifpledge = #{fIfpledge}</if>
+            <if test="fIfdamage != null  and fIfdamage != ''">and tw.f_ifdamage = #{fIfdamage}</if>
+            <if test="fBankcorpid != null  and fBankcorpid != ''">and tw.f_bankcorpid = #{fBankcorpid}</if>
+            <if test="fBilltype != null  and fBilltype != ''">and tw.f_billtype = #{fBilltype}</if>
+            <if test="fBillstatus != null ">and tw.f_billstatus = #{fBillstatus}</if>
+            <if test="fBillstatus != null and fBillstatus == 7">and tw.f_billstatus != '6'</if>
+            <if test="fItemsStatus != null ">and tw.f_items_status = #{fItemsStatus}</if>
+            <if test="fBillingDeadline != null ">and tw.f_billing_deadline = #{fBillingDeadline}</if>
+            <if test="fProductName != null  and fProductName != ''">and tw.f_product_name like concat('%',
+                #{fProductName},
+                '%')
+            </if>
+            <if test="fReviewDate != null ">and tw.f_review_date = #{fReviewDate}</if>
+            <if test="fTruckno != null  and fTruckno != ''">and tw.f_truckno = #{fTruckno}</if>
+            <if test="fDriverName != null  and fDriverName != ''">and tw.f_driver_name like concat('%', #{fDriverName},
+                '%')
+            </if>
+            <if test="fDriverTel != null  and fDriverTel != ''">and tw.f_driver_tel = #{fDriverTel}</if>
+            <if test="fDriverIdCar != null  and fDriverIdCar != ''">and tw.f_driver_id_car = #{fDriverIdCar}</if>
+            <if test="fBusinessType != null  and fBusinessType != ''">and tw.f_business_type = #{fBusinessType}</if>
+            <if test="fLabour != null ">and tw.f_labour = #{fLabour}</if>
+            <if test="fFleet != null ">and tw.f_fleet = #{fFleet}</if>
+            <if test="fInwarehouseid != null ">and tw.f_inwarehouseid = #{fInwarehouseid}</if>
+            <if test="fBstime != null ">and tw.f_bstime = #{fBstime}</if>
+            <if test="fCartype != null ">and tw.f_cartype = #{fCartype}</if>
+            <if test="fGoodsid != null ">and tw.f_goodsid = #{fGoodsid}</if>
+            <if test="fNewTrademodeid != null ">and tw.f_new_trademodeid = #{fNewTrademodeid}</if>
+            <if test="fLoadportid != null ">and tw.f_loadportid = #{fLoadportid}</if>
+            <if test="fDestportid != null ">and tw.f_destportid = #{fDestportid}</if>
+            <if test="fServiceitems != null  and fServiceitems != ''">and tw.f_serviceitems = #{fServiceitems}</if>
+            <if test="fInvoceobj != null  and fInvoceobj != ''">and tw.f_invoceobj = #{fInvoceobj}</if>
+            <if test="fSign != null ">and tw.f_sign = #{fSign}</if>
+            <if test="fDetentioncargo != null ">and tw.f_detentioncargo = #{fDetentioncargo}</if>
+            <if test="fBooksmarks != null  and fBooksmarks != ''">and tw.f_booksmarks = #{fBooksmarks}</if>
+            <if test="fShippername != null  and fShippername != ''">and tw.f_shippername like concat('%',
+                #{fShippername},
+                '%')
+            </if>
+            <if test="fShipperattn != null  and fShipperattn != ''">and tw.f_shipperattn = #{fShipperattn}</if>
+            <if test="fShippertel != null  and fShippertel != ''">and tw.f_shippertel = #{fShippertel}</if>
+            <if test="fConsigneername != null  and fConsigneername != ''">and tw.f_consigneername like concat('%',
+                #{fConsigneername}, '%')
+            </if>
+            <if test="fConsigneeattn != null  and fConsigneeattn != ''">and tw.f_consigneeattn = #{fConsigneeattn}</if>
+            <if test="fConsigneetel != null  and fConsigneetel != ''">and tw.f_consigneetel = #{fConsigneetel}</if>
+            <if test="fInsurance != null  and fInsurance != ''">and tw.f_insurance = #{fInsurance}</if>
+            <if test="fInsuranceamt != null ">and tw.f_insuranceamt = #{fInsuranceamt}</if>
+            <if test="fClosedate != null ">and tw.f_closedate = #{fClosedate}</if>
+            <if test="fDocmentdate != null ">and tw.f_docmentdate = #{fDocmentdate}</if>
+            <if test="fVslid != null ">and tw.f_vslid = #{fVslid}</if>
+            <if test="fVoyid != null ">and tw.f_voyid = #{fVoyid}</if>
+            <if test="fTypeid != null ">and tw.f_typeid = #{fTypeid}</if>
+            <if test="fPaymode != null ">and tw.f_paymode = #{fPaymode}</if>
+            <if test="fLaneid != null ">and tw.f_laneid = #{fLaneid}</if>
+            <if test="fCntval != null  and fCntval != ''">and tw.f_cntval = #{fCntval}</if>
+            <if test="createBy != null  and createBy != ''">and tw.create_by = #{createBy}</if>
+            <if test="remark != null  and remark != ''">and tw.remark = #{remark}</if>
+            <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
+                and tw.create_time &gt;= #{cLoadDate[0]}
+            </if>
+            <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
+                and tw.create_time &lt;= #{cLoadDate[1]}
+            </if>
+            <if test='moneys != null and moneys[0] != null and moneys[0]!= ""'>
+                and tw.f_money &gt;= #{moneys[0]}
+            </if>
+            <if test='moneys != null and moneys[1] != null and moneys[1]!= ""'>
+                and tw.f_money &lt;= #{moneys[1]}
+            </if>
+            <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
+                and tw.f_bsdate &gt;= #{timeInterval[0]}
+            </if>
+            <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
+                and tw.f_bsdate &lt;= #{timeInterval[1]}
+            </if>
+            <if test="fTakeOrders != null "> and tw.f_take_orders = #{fTakeOrders}</if>
+            <if test="fReason != null  and fReason != ''"> and tw.f_reason = #{fReason}</if>
+        </where>
         ORDER BY tw.f_bsdate DESC,tw.f_id DESC
     </select>
+    <select id="statistics" resultType="map">
+        SELECT
+            temp.billType,
+            CASE
+
+                WHEN temp.billType = 'CK' THEN
+                    '出库'
+                WHEN temp.billType = 'RK' THEN
+                    '入库'
+                WHEN temp.billType = 'SQ' THEN
+                    '采购'
+                WHEN temp.billType = 'XS' THEN
+                    '销售'
+                END AS billTypeName,
+            IFNULL( temp.num, 0 ) AS allNum,
+            IFNULL( temp.money, 0 ) AS allMoney,
+            IFNULL( success.num, 0 ) AS entryNum,
+            IFNULL( success.money, 0 ) AS entryMoney,
+            IFNULL( fail.num, 0 ) AS notNum,
+            IFNULL( fail.money, 0 ) AS notMoney
+        FROM
+            (
+                SELECT
+                    f_billstatus AS billStatus,
+                    f_billtype AS billType,
+                    COUNT( 1 ) AS num,
+                    IFNULL( SUM( f_money ), 0 ) AS money
+                FROM
+                    t_warehousebills
+                WHERE
+                    del_flag = 0
+                  AND f_billtype != 'DB'
+        <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
+            and f_bsdate &gt;= #{timeInterval[0]}
+        </if>
+        <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
+            and f_bsdate &lt;= #{timeInterval[1]}
+        </if>
+                GROUP BY
+                    f_billtype
+            ) temp
+                LEFT JOIN (
+                SELECT
+                    f_billstatus AS billStatus,
+                    f_billtype AS billType,
+                    COUNT( 1 ) AS num,
+                    IFNULL( SUM( f_money ), 0 ) AS money
+                FROM
+                    t_warehousebills
+                WHERE
+                    del_flag = 0
+                  AND f_billtype != 'DB'
+                  AND f_billstatus = 6
+        <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
+            and f_bsdate &gt;= #{timeInterval[0]}
+        </if>
+        <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
+            and f_bsdate &lt;= #{timeInterval[1]}
+        </if>
+                GROUP BY
+                    f_billtype
+            ) success ON temp.billType = success.billType
+                LEFT JOIN (
+                SELECT
+                    f_billstatus AS billStatus,
+                    f_billtype AS billType,
+                    COUNT( 1 ) AS num,
+                    IFNULL( SUM( f_money ), 0 ) AS money
+                FROM
+                    t_warehousebills
+                WHERE
+                    del_flag = 0
+                  AND f_billtype != 'DB'
+                  AND f_billstatus != 6
+        <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
+            and f_bsdate &gt;= #{timeInterval[0]}
+        </if>
+        <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
+        and f_bsdate &lt;= #{timeInterval[1]}
+        </if>
+                GROUP BY
+                    f_billtype
+            ) fail ON temp.billType = fail.billType
+    </select>
 </mapper>