|  | @@ -160,7 +160,7 @@
 | 
	
		
			
				|  |  |              bill.f_driver_name AS fDriverName,
 | 
	
		
			
				|  |  |              bill.f_driver_tel AS fDriverTel,
 | 
	
		
			
				|  |  |              bill.f_driver_id_car AS fDriverIdCar,
 | 
	
		
			
				|  |  | -            bill.f_business_type AS fBusinessType,
 | 
	
		
			
				|  |  | +            dictIn.dict_label AS fBusinessType,
 | 
	
		
			
				|  |  |              ware.f_name AS fWarehouseid,
 | 
	
		
			
				|  |  |              bill.f_qty AS fQty,
 | 
	
		
			
				|  |  |              bill.f_netweight AS fNetweight,
 | 
	
	
		
			
				|  | @@ -170,8 +170,20 @@
 | 
	
		
			
				|  |  |              bill.f_grossweight AS fGrossweight,
 | 
	
		
			
				|  |  |              bill.f_product_name AS fProductName,
 | 
	
		
			
				|  |  |              bill.f_billing_deadline AS fBillingDeadline,
 | 
	
		
			
				|  |  | -            bill.f_billstatus AS fBillstatus,
 | 
	
		
			
				|  |  | -            bill.f_items_status AS fItemsStatus,
 | 
	
		
			
				|  |  | +            CASE WHEN  bill.f_billstatus = '1' THEN '录入'
 | 
	
		
			
				|  |  | +                WHEN  bill.f_billstatus = '2' THEN '暂存'
 | 
	
		
			
				|  |  | +                WHEN  bill.f_billstatus = '3' THEN '驳回'
 | 
	
		
			
				|  |  | +                WHEN  bill.f_billstatus = '4' THEN '请核'
 | 
	
		
			
				|  |  | +                WHEN  bill.f_billstatus = '5' THEN '审核中'
 | 
	
		
			
				|  |  | +                WHEN  bill.f_billstatus = '6' THEN '全部入账'
 | 
	
		
			
				|  |  | +            END
 | 
	
		
			
				|  |  | +                 AS fBillstatus,
 | 
	
		
			
				|  |  | +            CASE WHEN  bill.f_items_status = '1' THEN '计划'
 | 
	
		
			
				|  |  | +                 WHEN  bill.f_items_status = '2' THEN '待入库'
 | 
	
		
			
				|  |  | +                 WHEN  bill.f_items_status = '3' THEN '入库中'
 | 
	
		
			
				|  |  | +                 WHEN  bill.f_items_status = '4' THEN '已入库'
 | 
	
		
			
				|  |  | +            END
 | 
	
		
			
				|  |  | +                AS fItemsStatus,
 | 
	
		
			
				|  |  |              bill.f_billno AS fBillno,
 | 
	
		
			
				|  |  |              g.f_name AS fGoodsid,
 | 
	
		
			
				|  |  |              bill.f_storekeeper AS fStorekeeper
 | 
	
	
		
			
				|  | @@ -187,6 +199,7 @@
 | 
	
		
			
				|  |  |              LEFT JOIN t_warehouse ware1 ON ware1.f_id = bill.f_inwarehouseid
 | 
	
		
			
				|  |  |              LEFT JOIN t_warehousebillsitems item ON item.f_pid = bill.f_id
 | 
	
		
			
				|  |  |              LEFT JOIN t_goods goods ON goods.f_id = item.f_goodsid
 | 
	
		
			
				|  |  | +            LEFT JOIN sys_dict_data dictIn ON dictIn.dict_value = bill.f_business_type
 | 
	
		
			
				|  |  |          <where>
 | 
	
		
			
				|  |  |              <if test="fBillno != null  and fBillno != ''">and bill.f_billno like concat('%', #{fBillno}, '%')</if>
 | 
	
		
			
				|  |  |              <if test="fCustomsdeclartion != null  and fCustomsdeclartion != ''">and bill.f_customsdeclartion =
 | 
	
	
		
			
				|  | @@ -238,7 +251,21 @@
 | 
	
		
			
				|  |  |              <if test="fIfpledge != null  and fIfpledge != ''">and bill.f_ifpledge = #{fIfpledge}</if>
 | 
	
		
			
				|  |  |              <if test="fIfdamage != null  and fIfdamage != ''">and bill.f_ifdamage = #{fIfdamage}</if>
 | 
	
		
			
				|  |  |              <if test="fBankcorpid != null ">and bill.f_bankcorpid = #{fBankcorpid}</if>
 | 
	
		
			
				|  |  | -            <if test="fBilltype != null  and fBilltype != ''">and bill.f_billtype = #{fBilltype}</if>
 | 
	
		
			
				|  |  | +            <if test="fBilltype != null  and fBilltype == 'SJRK'">
 | 
	
		
			
				|  |  | +                and bill.f_billtype = #{fBilltype}
 | 
	
		
			
				|  |  | +                AND dictIn.dict_type = 'st_in_type'
 | 
	
		
			
				|  |  | +                AND dictIn.status = '0'
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="fBilltype != null  and fBilltype == 'SJCK'">
 | 
	
		
			
				|  |  | +                and bill.f_billtype = #{fBilltype}
 | 
	
		
			
				|  |  | +                AND dictIn.dict_type = 'st_out_type'
 | 
	
		
			
				|  |  | +                AND dictIn.status = '0'
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="fBilltype != null  and fBilltype == 'CKDB'">
 | 
	
		
			
				|  |  | +                and bill.f_billtype = #{fBilltype}
 | 
	
		
			
				|  |  | +                AND dictIn.dict_type = 'st_trans_type'
 | 
	
		
			
				|  |  | +                AND dictIn.status = '0'
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  |              <if test="fBillstatus != null  and fBillstatus != ''">and bill.f_billstatus = #{fBillstatus}</if>
 | 
	
		
			
				|  |  |              <if test="fItemsStatus != null  and fItemsStatus != ''">and bill.f_items_status = #{fItemsStatus}</if>
 | 
	
		
			
				|  |  |              <if test="createBy != null and createBy != ''">and bill.create_by = #{createBy}</if>
 | 
	
	
		
			
				|  | @@ -247,6 +274,126 @@
 | 
	
		
			
				|  |  |          ${params.dataScope}
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    <select id="selectWarehouseBusinessList1" parameterType="TWarehousebills" resultType="Map">
 | 
	
		
			
				|  |  | +        SELECT
 | 
	
		
			
				|  |  | +        DISTINCT
 | 
	
		
			
				|  |  | +        bill.f_id AS fId,
 | 
	
		
			
				|  |  | +        corp.f_name AS fCorpid,
 | 
	
		
			
				|  |  | +        corpTo.f_name AS fTocorpid,
 | 
	
		
			
				|  |  | +        bill.f_mblno AS fMblno,
 | 
	
		
			
				|  |  | +        corpSub.f_name AS fSbu,
 | 
	
		
			
				|  |  | +        bill.f_marks AS fMarks,
 | 
	
		
			
				|  |  | +        bill.remark AS remark,
 | 
	
		
			
				|  |  | +        bill.f_planqty AS fPlanqty,
 | 
	
		
			
				|  |  | +        bill.f_plangrossweight AS fPlangrossweight,
 | 
	
		
			
				|  |  | +        bill.f_plannetweight AS fPlannetweight,
 | 
	
		
			
				|  |  | +        bill.f_planvolumn AS fPlanvolumn,
 | 
	
		
			
				|  |  | +        bill.f_bsdate AS fBsdate,
 | 
	
		
			
				|  |  | +        bill.f_trademodeid AS fTrademodeid,
 | 
	
		
			
				|  |  | +        bill.f_truckno AS fTruckno,
 | 
	
		
			
				|  |  | +        bill.f_driver_name AS fDriverName,
 | 
	
		
			
				|  |  | +        bill.f_driver_tel AS fDriverTel,
 | 
	
		
			
				|  |  | +        bill.f_driver_id_car AS fDriverIdCar,
 | 
	
		
			
				|  |  | +        ware.f_name AS fWarehouseid,
 | 
	
		
			
				|  |  | +        bill.f_qty AS fQty,
 | 
	
		
			
				|  |  | +        bill.f_netweight AS fNetweight,
 | 
	
		
			
				|  |  | +        bill.create_time AS createTime,
 | 
	
		
			
				|  |  | +        ware1.f_name AS fInwarehouseid,
 | 
	
		
			
				|  |  | +        bill.create_by AS createBy,
 | 
	
		
			
				|  |  | +        bill.f_grossweight AS fGrossweight,
 | 
	
		
			
				|  |  | +        bill.f_product_name AS fProductName,
 | 
	
		
			
				|  |  | +        bill.f_billing_deadline AS fBillingDeadline,
 | 
	
		
			
				|  |  | +        CASE WHEN  bill.f_billstatus = '1' THEN '录入'
 | 
	
		
			
				|  |  | +        WHEN  bill.f_billstatus = '2' THEN '暂存'
 | 
	
		
			
				|  |  | +        WHEN  bill.f_billstatus = '3' THEN '驳回'
 | 
	
		
			
				|  |  | +        WHEN  bill.f_billstatus = '4' THEN '请核'
 | 
	
		
			
				|  |  | +        WHEN  bill.f_billstatus = '5' THEN '审核中'
 | 
	
		
			
				|  |  | +        WHEN  bill.f_billstatus = '6' THEN '全部入账'
 | 
	
		
			
				|  |  | +        END
 | 
	
		
			
				|  |  | +        AS fBillstatus,
 | 
	
		
			
				|  |  | +        CASE WHEN  bill.f_items_status = '1' THEN '计划'
 | 
	
		
			
				|  |  | +        WHEN  bill.f_items_status = '2' THEN '待入库'
 | 
	
		
			
				|  |  | +        WHEN  bill.f_items_status = '3' THEN '入库中'
 | 
	
		
			
				|  |  | +        WHEN  bill.f_items_status = '4' THEN '已入库'
 | 
	
		
			
				|  |  | +        END
 | 
	
		
			
				|  |  | +        AS fItemsStatus,
 | 
	
		
			
				|  |  | +        bill.f_billno AS fBillno,
 | 
	
		
			
				|  |  | +        g.f_name AS fGoodsid,
 | 
	
		
			
				|  |  | +        bill.f_storekeeper AS fStorekeeper
 | 
	
		
			
				|  |  | +        FROM
 | 
	
		
			
				|  |  | +        t_warehousebills bill
 | 
	
		
			
				|  |  | +        LEFT JOIN t_goods g ON g.f_id = bill.f_goodsid
 | 
	
		
			
				|  |  | +        left join sys_user u on bill.create_by = u.user_name
 | 
	
		
			
				|  |  | +        left join sys_dept d on bill.f_bsdeptid = d.dept_id
 | 
	
		
			
				|  |  | +        LEFT JOIN t_corps corp ON corp.f_id = bill.f_corpid
 | 
	
		
			
				|  |  | +        LEFT JOIN t_corps corpTo ON corpTo.f_id = bill.f_tocorpid
 | 
	
		
			
				|  |  | +        LEFT JOIN t_corps corpSub ON corpSub.f_id = bill.f_sbu
 | 
	
		
			
				|  |  | +        LEFT JOIN t_warehouse ware ON ware.f_id = bill.f_warehouseid
 | 
	
		
			
				|  |  | +        LEFT JOIN t_warehouse ware1 ON ware1.f_id = bill.f_inwarehouseid
 | 
	
		
			
				|  |  | +        LEFT JOIN t_warehousebillsitems item ON item.f_pid = bill.f_id
 | 
	
		
			
				|  |  | +        LEFT JOIN t_goods goods ON goods.f_id = item.f_goodsid
 | 
	
		
			
				|  |  | +        <where>
 | 
	
		
			
				|  |  | +            <if test="fBillno != null  and fBillno != ''">and bill.f_billno like concat('%', #{fBillno}, '%')</if>
 | 
	
		
			
				|  |  | +            <if test="fCustomsdeclartion != null  and fCustomsdeclartion != ''">and bill.f_customsdeclartion =
 | 
	
		
			
				|  |  | +                #{fCustomsdeclartion}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="fOriginalbillno != null  and fOriginalbillno != ''">and bill.f_originalbillno =
 | 
	
		
			
				|  |  | +                #{fOriginalbillno}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="fDeptid != null ">and bill.f_deptid = #{fDeptid}</if>
 | 
	
		
			
				|  |  | +            <if test="fInwarehouseid != null ">and bill.f_inwarehouseid = #{fInwarehouseid}</if>
 | 
	
		
			
				|  |  | +            <if test="fBsdeptid != null ">and bill.f_bsdeptid = #{fBsdeptid}</if>
 | 
	
		
			
				|  |  | +            <if test="fChargedate != null ">and bill.f_chargedate = #{fChargedate}</if>
 | 
	
		
			
				|  |  | +            <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
 | 
	
		
			
				|  |  | +                and bill.f_bsdate >= #{timeInterval[0]}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
 | 
	
		
			
				|  |  | +                and bill.f_bsdate <= #{timeInterval[1]}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="fGoodsid != null  and fGoodsid != ''">and item.f_goodsid = #{fGoodsid}</if>
 | 
	
		
			
				|  |  | +            <if test="fContacts != null  and fContacts != ''">and bill.f_contacts = #{fContacts}</if>
 | 
	
		
			
				|  |  | +            <if test="fTel != null  and fTel != ''">and bill.f_tel = #{fTel}</if>
 | 
	
		
			
				|  |  | +            <if test="fCorpid != null ">and bill.f_corpid = #{fCorpid}</if>
 | 
	
		
			
				|  |  | +            <if test="fBillingDeadline != null ">and bill.f_billing_deadline = #{fBillingDeadline}</if>
 | 
	
		
			
				|  |  | +            <if test="fTocorpid != null ">and bill.f_tocorpid = #{fTocorpid}</if>
 | 
	
		
			
				|  |  | +            <if test="fMarks != null  and fMarks != ''">and bill.f_marks like concat('%', #{fMarks}, '%')</if>
 | 
	
		
			
				|  |  | +            <if test="fStltypeid != null ">and bill.f_stltypeid = #{fStltypeid}</if>
 | 
	
		
			
				|  |  | +            <if test="fReviewDate != null "> and f_review_date = #{fReviewDate}</if>
 | 
	
		
			
				|  |  | +            <if test="fBscorpno != null  and fBscorpno != ''">and bill.f_bscorpno = #{fBscorpno}</if>
 | 
	
		
			
				|  |  | +            <if test="fWarehouseid != null ">and bill.f_warehouseid = #{fWarehouseid}</if>
 | 
	
		
			
				|  |  | +            <if test="fStorekeeper != null  and fStorekeeper != ''">and bill.f_storekeeper = #{fStorekeeper}</if>
 | 
	
		
			
				|  |  | +            <if test="fBsdate != null ">and bill.f_bsdate = #{fBsdate}</if>
 | 
	
		
			
				|  |  | +            <if test="fPlanqty != null ">and bill.f_planqty = #{fPlanqty}</if>
 | 
	
		
			
				|  |  | +            <if test="fPlangrossweight != null ">and bill.f_plangrossweight = #{fPlangrossweight}</if>
 | 
	
		
			
				|  |  | +            <if test="fPlannetweight != null ">and bill.f_plannetweight = #{fPlannetweight}</if>
 | 
	
		
			
				|  |  | +            <if test="fPlanvolumn != null ">and bill.f_planvolumn = #{fPlanvolumn}</if>
 | 
	
		
			
				|  |  | +            <if test="fQty != null ">and bill.f_qty = #{fQty}</if>
 | 
	
		
			
				|  |  | +            <if test="fGrossweight != null ">and bill.f_grossweight = #{fGrossweight}</if>
 | 
	
		
			
				|  |  | +            <if test="fNetweight != null ">and bill.f_netweight = #{fNetweight}</if>
 | 
	
		
			
				|  |  | +            <if test="fVolumn != null ">and bill.f_volumn = #{fVolumn}</if>
 | 
	
		
			
				|  |  | +            <if test="fTrademodeid != null ">and bill.f_trademodeid = #{fTrademodeid}</if>
 | 
	
		
			
				|  |  | +            <if test="fBillingway != null ">and bill.f_billingway = #{fBillingway}</if>
 | 
	
		
			
				|  |  | +            <if test="fSbu != null ">and bill.f_sbu = #{fSbu}</if>
 | 
	
		
			
				|  |  | +            <if test="fFeetunit != null  and fFeetunit != ''">and bill.f_feetunit = #{fFeetunit}</if>
 | 
	
		
			
				|  |  | +            <if test="fMblno != null  and fMblno != ''">and bill.f_mblno like concat('%', #{fMblno}, '%')</if>
 | 
	
		
			
				|  |  | +            <if test="fVslvoy != null  and fVslvoy != ''">and bill.f_vslvoy = #{fVslvoy}</if>
 | 
	
		
			
				|  |  | +            <if test="fEta != null ">and bill.f_eta = #{fEta}</if>
 | 
	
		
			
				|  |  | +            <if test="fCustomno != null  and fCustomno != ''">and bill.f_customno = #{fCustomno}</if>
 | 
	
		
			
				|  |  | +            <if test="fIfweigh != null  and fIfweigh != ''">and bill.f_ifweigh = #{fIfweigh}</if>
 | 
	
		
			
				|  |  | +            <if test="fIfpledge != null  and fIfpledge != ''">and bill.f_ifpledge = #{fIfpledge}</if>
 | 
	
		
			
				|  |  | +            <if test="fIfdamage != null  and fIfdamage != ''">and bill.f_ifdamage = #{fIfdamage}</if>
 | 
	
		
			
				|  |  | +            <if test="fBankcorpid != null ">and bill.f_bankcorpid = #{fBankcorpid}</if>
 | 
	
		
			
				|  |  | +            <if test="fBilltype != null  and fBilltype != ''">
 | 
	
		
			
				|  |  | +                and bill.f_billtype = #{fBilltype}
 | 
	
		
			
				|  |  | +            </if>
 | 
	
		
			
				|  |  | +            <if test="fBillstatus != null  and fBillstatus != ''">and bill.f_billstatus = #{fBillstatus}</if>
 | 
	
		
			
				|  |  | +            <if test="fItemsStatus != null  and fItemsStatus != ''">and bill.f_items_status = #{fItemsStatus}</if>
 | 
	
		
			
				|  |  | +            <if test="createBy != null and createBy != ''">and bill.create_by = #{createBy}</if>
 | 
	
		
			
				|  |  | +        </where>
 | 
	
		
			
				|  |  | +        ORDER BY  bill.f_billstatus , bill.f_bsdate  DESC
 | 
	
		
			
				|  |  | +        ${params.dataScope}
 | 
	
		
			
				|  |  | +    </select>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      <select id="selectTWarehousebillsById" parameterType="Long" resultMap="TWarehousebillsResult">
 | 
	
		
			
				|  |  |          <include refid="selectTWarehousebillsVo"/>
 | 
	
		
			
				|  |  |          where f_id = #{fId}
 |