<?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.ruoyi.warehouseBusiness.mapper.TWarehousebillsLoggerMapper">
    
    <resultMap type="TWarehousebillsLogger" id="TWarehousebillsLoggerResult">
        <result property="fId"    column="f_id"    />
        <result property="fBillno"    column="f_billno"    />
        <result property="fCustomsdeclartion"    column="f_customsdeclartion"    />
        <result property="fOriginalbillno"    column="f_originalbillno"    />
        <result property="fDeptid"    column="f_deptid"    />
        <result property="fBsdeptid"    column="f_bsdeptid"    />
        <result property="fContacts"    column="f_contacts"    />
        <result property="fTel"    column="f_tel"    />
        <result property="fCorpid"    column="f_corpid"    />
        <result property="fTocorpid"    column="f_tocorpid"    />
        <result property="fStltypeid"    column="f_stltypeid"    />
        <result property="fBscorpno"    column="f_bscorpno"    />
        <result property="fWarehouseid"    column="f_warehouseid"    />
        <result property="fStorekeeper"    column="f_storekeeper"    />
        <result property="fChargedate"    column="f_chargedate"    />
        <result property="fBsdate"    column="f_bsdate"    />
        <result property="fPlanqty"    column="f_planqty"    />
        <result property="fPlangrossweight"    column="f_plangrossweight"    />
        <result property="fPlannetweight"    column="f_plannetweight"    />
        <result property="fPlanvolumn"    column="f_planvolumn"    />
        <result property="fQty"    column="f_qty"    />
        <result property="fGrossweight"    column="f_grossweight"    />
        <result property="fNetweight"    column="f_netweight"    />
        <result property="fVolumn"    column="f_volumn"    />
        <result property="fBillingway"    column="f_billingway"    />
        <result property="fTrademodeid"    column="f_trademodeid"    />
        <result property="fSbu"    column="f_sbu"    />
        <result property="fFeetunit"    column="f_feetunit"    />
        <result property="fMblno"    column="f_mblno"    />
        <result property="fMarks"    column="f_marks"    />
        <result property="fVslvoy"    column="f_vslvoy"    />
        <result property="fEta"    column="f_eta"    />
        <result property="fCustomno"    column="f_customno"    />
        <result property="fIfweigh"    column="f_ifweigh"    />
        <result property="fIfpledge"    column="f_ifpledge"    />
        <result property="fIfdamage"    column="f_ifdamage"    />
        <result property="fBankcorpid"    column="f_bankcorpid"    />
        <result property="fBilltype"    column="f_billtype"    />
        <result property="fBillstatus"    column="f_billstatus"    />
        <result property="fItemsStatus"    column="f_items_status"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="remark"    column="remark"    />
        <result property="fBillingDeadline"    column="f_billing_deadline"    />
        <result property="fProductName"    column="f_product_name"    />
        <result property="fReviewDate"    column="f_review_date"    />
        <result property="fTruckno"    column="f_truckno"    />
        <result property="fDriverName"    column="f_driver_name"    />
        <result property="fDriverTel"    column="f_driver_tel"    />
        <result property="fDriverIdCar"    column="f_driver_id_car"    />
        <result property="fBusinessType"    column="f_business_type"    />
        <result property="fLabour"    column="f_labour"    />
        <result property="fFleet"    column="f_fleet"    />
        <result property="fInwarehouseid"    column="f_inwarehouseid"    />
        <result property="fBstime"    column="f_bstime"    />
        <result property="fCartype"    column="f_cartype"    />
        <result property="fGoodsid"    column="f_goodsid"    />
        <result property="fNewTrademodeid"    column="f_new_trademodeid"    />
        <result property="fLoadportid"    column="f_loadportid"    />
        <result property="fDestportid"    column="f_destportid"    />
        <result property="fServiceitems"    column="f_serviceitems"    />
        <result property="fInvoceobj"    column="f_invoceobj"    />
        <result property="fSign"    column="f_sign"    />
        <result property="fDetentioncargo"    column="f_detentioncargo"    />
        <result property="fBooksmarks"    column="f_booksmarks"    />
        <result property="fShippername"    column="f_shippername"    />
        <result property="fShipperattn"    column="f_shipperattn"    />
        <result property="fShippertel"    column="f_shippertel"    />
        <result property="fConsigneername"    column="f_consigneername"    />
        <result property="fConsigneeattn"    column="f_consigneeattn"    />
        <result property="fConsigneetel"    column="f_consigneetel"    />
        <result property="fInsurance"    column="f_insurance"    />
        <result property="fInsuranceamt"    column="f_insuranceamt"    />
        <result property="fClosedate"    column="f_closedate"    />
        <result property="fDocmentdate"    column="f_docmentdate"    />
        <result property="fVslid"    column="f_vslid"    />
        <result property="fVoyid"    column="f_voyid"    />
        <result property="fTypeid"    column="f_typeid"    />
        <result property="fPaymode"    column="f_paymode"    />
        <result property="fLaneid"    column="f_laneid"    />
        <result property="fCntval"    column="f_cntval"    />
        <result property="freeContainerDate"    column="free_container_date"    />
        <result property="fBusinessAttribution"    column="f_business_attribution"    />
        <result property="fSupervisionUnit"    column="f_supervision_unit"    />
        <result property="fDeclarationElements"    column="f_declaration_elements"    />
        <result property="fPartNumber"    column="f_part_number"    />
        <result property="fIfinspection"    column="f_ifinspection"    />
        <result property="fValue"    column="f_value"    />
        <result property="fWeighingDate"    column="f_weighing_date"    />
        <result property="fIfsampling"    column="f_ifsampling"    />
        <result property="sendSampleDate"    column="send_sample_date"    />
        <result property="fIfweightRecovery"    column="f_ifweight_recovery"    />
        <result property="weightRecoveryDate"    column="weight_recovery_date"    />
        <result property="warehouseStatus"    column="warehouse_status"    />
        <result property="fTimes"    column="f_times"    />
        <result property="fDateChanged"    column="f_date_changed"    />
        <result property="fChargetype"    column="f_chargetype"    />
        <result property="fWeighWeight"    column="f_weigh_weight"    />
        <result property="fPredictBranch"    column="f_predict_branch"    />
        <result property="fGrade"    column="f_grade"    />
        <result property="fDeliveryDetails"    column="f_delivery_details"    />
        <result property="fSalesmanId"    column="f_salesman_id"    />
        <result property="fItemstatus"    column="f_itemstatus"    />
        <result property="fUpdeteStatus"    column="f_updete_status"    />
        <result property="fSubmitUpdate"    column="f_submit_update"    />
        <result property="fDeleteStatus"    column="f_delete_status"    />
    </resultMap>

    <sql id="selectTWarehousebillsLoggerVo">
        select f_id, f_billno, f_customsdeclartion, f_originalbillno, f_deptid, f_bsdeptid, f_contacts, f_tel, f_corpid, f_tocorpid, f_stltypeid, f_bscorpno, f_warehouseid, f_storekeeper, f_chargedate, f_bsdate, f_planqty, f_plangrossweight, f_plannetweight, f_planvolumn, f_qty, f_grossweight, f_netweight, f_volumn, f_billingway, f_trademodeid, f_sbu, f_feetunit, f_mblno, f_marks, f_vslvoy, f_eta, f_customno, f_ifweigh, f_ifpledge, f_ifdamage, f_bankcorpid, f_billtype, f_billstatus, f_items_status, del_flag, create_by, create_time, update_by, update_time, remark, f_billing_deadline, f_product_name, f_review_date, f_truckno, f_driver_name, f_driver_tel, f_driver_id_car, f_business_type, f_labour, f_fleet, f_inwarehouseid, f_bstime, f_cartype, f_goodsid, f_new_trademodeid, f_loadportid, f_destportid, f_serviceitems, f_invoceobj, f_sign, f_detentioncargo, f_booksmarks, f_shippername, f_shipperattn, f_shippertel, f_consigneername, f_consigneeattn, f_consigneetel, f_insurance, f_insuranceamt, f_closedate, f_docmentdate, f_vslid, f_voyid, f_typeid, f_paymode, f_laneid, f_cntval, free_container_date, f_business_attribution, f_supervision_unit, f_declaration_elements, f_part_number, f_ifinspection, f_value, f_weighing_date, f_ifsampling, send_sample_date, f_ifweight_recovery, weight_recovery_date, warehouse_status, f_times, f_date_changed, f_chargetype, f_weigh_weight, f_predict_branch, f_grade, f_delivery_details, f_salesman_id, f_itemstatus, f_updete_status, f_submit_update, f_delete_status from t_warehousebills_logger
    </sql>

    <select id="selectTWarehousebillsLoggerList" parameterType="TWarehousebillsLogger" resultMap="TWarehousebillsLoggerResult">
        <include refid="selectTWarehousebillsLoggerVo"/>
        <where>  
            <if test="fBillno != null  and fBillno != ''"> and f_billno = #{fBillno}</if>
            <if test="fCustomsdeclartion != null  and fCustomsdeclartion != ''"> and f_customsdeclartion = #{fCustomsdeclartion}</if>
            <if test="fOriginalbillno != null  and fOriginalbillno != ''"> and f_originalbillno = #{fOriginalbillno}</if>
            <if test="fDeptid != null "> and f_deptid = #{fDeptid}</if>
            <if test="fBsdeptid != null "> and f_bsdeptid = #{fBsdeptid}</if>
            <if test="fContacts != null  and fContacts != ''"> and f_contacts = #{fContacts}</if>
            <if test="fTel != null  and fTel != ''"> and f_tel = #{fTel}</if>
            <if test="fCorpid != null "> and f_corpid = #{fCorpid}</if>
            <if test="fTocorpid != null "> and f_tocorpid = #{fTocorpid}</if>
            <if test="fStltypeid != null "> and f_stltypeid = #{fStltypeid}</if>
            <if test="fBscorpno != null  and fBscorpno != ''"> and f_bscorpno = #{fBscorpno}</if>
            <if test="fWarehouseid != null "> and f_warehouseid = #{fWarehouseid}</if>
            <if test="fStorekeeper != null  and fStorekeeper != ''"> and f_storekeeper = #{fStorekeeper}</if>
            <if test="fChargedate != null "> and f_chargedate = #{fChargedate}</if>
            <if test="fBsdate != null "> and f_bsdate = #{fBsdate}</if>
            <if test="fPlanqty != null "> and f_planqty = #{fPlanqty}</if>
            <if test="fPlangrossweight != null "> and f_plangrossweight = #{fPlangrossweight}</if>
            <if test="fPlannetweight != null "> and f_plannetweight = #{fPlannetweight}</if>
            <if test="fPlanvolumn != null "> and f_planvolumn = #{fPlanvolumn}</if>
            <if test="fQty != null "> and f_qty = #{fQty}</if>
            <if test="fGrossweight != null "> and f_grossweight = #{fGrossweight}</if>
            <if test="fNetweight != null "> and f_netweight = #{fNetweight}</if>
            <if test="fVolumn != null "> and f_volumn = #{fVolumn}</if>
            <if test="fBillingway != null "> and f_billingway = #{fBillingway}</if>
            <if test="fTrademodeid != null "> and f_trademodeid = #{fTrademodeid}</if>
            <if test="fSbu != null "> and f_sbu = #{fSbu}</if>
            <if test="fFeetunit != null  and fFeetunit != ''"> and f_feetunit = #{fFeetunit}</if>
            <if test="fMblno != null  and fMblno != ''"> and f_mblno = #{fMblno}</if>
            <if test="fMarks != null  and fMarks != ''"> and f_marks = #{fMarks}</if>
            <if test="fVslvoy != null  and fVslvoy != ''"> and f_vslvoy = #{fVslvoy}</if>
            <if test="fEta != null "> and f_eta = #{fEta}</if>
            <if test="fCustomno != null  and fCustomno != ''"> and f_customno = #{fCustomno}</if>
            <if test="fIfweigh != null  and fIfweigh != ''"> and f_ifweigh = #{fIfweigh}</if>
            <if test="fIfpledge != null  and fIfpledge != ''"> and f_ifpledge = #{fIfpledge}</if>
            <if test="fIfdamage != null  and fIfdamage != ''"> and f_ifdamage = #{fIfdamage}</if>
            <if test="fBankcorpid != null  and fBankcorpid != ''"> and f_bankcorpid = #{fBankcorpid}</if>
            <if test="fBilltype != null  and fBilltype != ''"> and f_billtype = #{fBilltype}</if>
            <if test="fBillstatus != null "> and f_billstatus = #{fBillstatus}</if>
            <if test="fItemsStatus != null "> and f_items_status = #{fItemsStatus}</if>
            <if test="fBillingDeadline != null "> and f_billing_deadline = #{fBillingDeadline}</if>
            <if test="fProductName != null  and fProductName != ''"> and f_product_name like concat('%', #{fProductName}, '%')</if>
            <if test="fReviewDate != null "> and f_review_date = #{fReviewDate}</if>
            <if test="fTruckno != null  and fTruckno != ''"> and f_truckno = #{fTruckno}</if>
            <if test="fDriverName != null  and fDriverName != ''"> and f_driver_name like concat('%', #{fDriverName}, '%')</if>
            <if test="fDriverTel != null  and fDriverTel != ''"> and f_driver_tel = #{fDriverTel}</if>
            <if test="fDriverIdCar != null  and fDriverIdCar != ''"> and f_driver_id_car = #{fDriverIdCar}</if>
            <if test="fBusinessType != null  and fBusinessType != ''"> and f_business_type = #{fBusinessType}</if>
            <if test="fLabour != null "> and f_labour = #{fLabour}</if>
            <if test="fFleet != null "> and f_fleet = #{fFleet}</if>
            <if test="fInwarehouseid != null "> and f_inwarehouseid = #{fInwarehouseid}</if>
            <if test="fBstime != null "> and f_bstime = #{fBstime}</if>
            <if test="fCartype != null "> and f_cartype = #{fCartype}</if>
            <if test="fGoodsid != null "> and f_goodsid = #{fGoodsid}</if>
            <if test="fNewTrademodeid != null "> and f_new_trademodeid = #{fNewTrademodeid}</if>
            <if test="fLoadportid != null "> and f_loadportid = #{fLoadportid}</if>
            <if test="fDestportid != null "> and f_destportid = #{fDestportid}</if>
            <if test="fServiceitems != null  and fServiceitems != ''"> and f_serviceitems = #{fServiceitems}</if>
            <if test="fInvoceobj != null  and fInvoceobj != ''"> and f_invoceobj = #{fInvoceobj}</if>
            <if test="fSign != null "> and f_sign = #{fSign}</if>
            <if test="fDetentioncargo != null "> and f_detentioncargo = #{fDetentioncargo}</if>
            <if test="fBooksmarks != null  and fBooksmarks != ''"> and f_booksmarks = #{fBooksmarks}</if>
            <if test="fShippername != null  and fShippername != ''"> and f_shippername like concat('%', #{fShippername}, '%')</if>
            <if test="fShipperattn != null  and fShipperattn != ''"> and f_shipperattn = #{fShipperattn}</if>
            <if test="fShippertel != null  and fShippertel != ''"> and f_shippertel = #{fShippertel}</if>
            <if test="fConsigneername != null  and fConsigneername != ''"> and f_consigneername like concat('%', #{fConsigneername}, '%')</if>
            <if test="fConsigneeattn != null  and fConsigneeattn != ''"> and f_consigneeattn = #{fConsigneeattn}</if>
            <if test="fConsigneetel != null  and fConsigneetel != ''"> and f_consigneetel = #{fConsigneetel}</if>
            <if test="fInsurance != null  and fInsurance != ''"> and f_insurance = #{fInsurance}</if>
            <if test="fInsuranceamt != null "> and f_insuranceamt = #{fInsuranceamt}</if>
            <if test="fClosedate != null "> and f_closedate = #{fClosedate}</if>
            <if test="fDocmentdate != null "> and f_docmentdate = #{fDocmentdate}</if>
            <if test="fVslid != null "> and f_vslid = #{fVslid}</if>
            <if test="fVoyid != null "> and f_voyid = #{fVoyid}</if>
            <if test="fTypeid != null "> and f_typeid = #{fTypeid}</if>
            <if test="fPaymode != null "> and f_paymode = #{fPaymode}</if>
            <if test="fLaneid != null "> and f_laneid = #{fLaneid}</if>
            <if test="fCntval != null  and fCntval != ''"> and f_cntval = #{fCntval}</if>
            <if test="freeContainerDate != null "> and free_container_date = #{freeContainerDate}</if>
            <if test="fBusinessAttribution != null "> and f_business_attribution = #{fBusinessAttribution}</if>
            <if test="fSupervisionUnit != null "> and f_supervision_unit = #{fSupervisionUnit}</if>
            <if test="fDeclarationElements != null  and fDeclarationElements != ''"> and f_declaration_elements = #{fDeclarationElements}</if>
            <if test="fPartNumber != null  and fPartNumber != ''"> and f_part_number = #{fPartNumber}</if>
            <if test="fIfinspection != null "> and f_ifinspection = #{fIfinspection}</if>
            <if test="fValue != null "> and f_value = #{fValue}</if>
            <if test="fWeighingDate != null "> and f_weighing_date = #{fWeighingDate}</if>
            <if test="fIfsampling != null "> and f_ifsampling = #{fIfsampling}</if>
            <if test="sendSampleDate != null "> and send_sample_date = #{sendSampleDate}</if>
            <if test="fIfweightRecovery != null "> and f_ifweight_recovery = #{fIfweightRecovery}</if>
            <if test="weightRecoveryDate != null "> and weight_recovery_date = #{weightRecoveryDate}</if>
            <if test="warehouseStatus != null "> and warehouse_status = #{warehouseStatus}</if>
            <if test="fTimes != null "> and f_times = #{fTimes}</if>
            <if test="fDateChanged != null  and fDateChanged != ''"> and f_date_changed = #{fDateChanged}</if>
            <if test="fChargetype != null  and fChargetype != ''"> and f_chargetype = #{fChargetype}</if>
            <if test="fWeighWeight != null "> and f_weigh_weight = #{fWeighWeight}</if>
            <if test="fPredictBranch != null "> and f_predict_branch = #{fPredictBranch}</if>
            <if test="fGrade != null  and fGrade != ''"> and f_grade = #{fGrade}</if>
            <if test="fDeliveryDetails != null  and fDeliveryDetails != ''"> and f_delivery_details = #{fDeliveryDetails}</if>
            <if test="fSalesmanId != null "> and f_salesman_id = #{fSalesmanId}</if>
            <if test="fItemstatus != null "> and f_itemstatus = #{fItemstatus}</if>
            <if test="fUpdeteStatus != null "> and f_updete_status = #{fUpdeteStatus}</if>
            <if test="fSubmitUpdate != null "> and f_submit_update = #{fSubmitUpdate}</if>
            <if test="fDeleteStatus != null "> and f_delete_status = #{fDeleteStatus}</if>
        </where>
    </select>
    
    <select id="selectTWarehousebillsLoggerById" parameterType="Long" resultMap="TWarehousebillsLoggerResult">
        <include refid="selectTWarehousebillsLoggerVo"/>
        where f_id = #{fId}
    </select>
        
    <insert id="insertTWarehousebillsLogger" parameterType="TWarehousebillsLogger" useGeneratedKeys="true" keyProperty="fId">
        insert into t_warehousebills_logger
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="fBillno != null">f_billno,</if>
            <if test="fCustomsdeclartion != null">f_customsdeclartion,</if>
            <if test="fOriginalbillno != null">f_originalbillno,</if>
            <if test="fDeptid != null">f_deptid,</if>
            <if test="fBsdeptid != null">f_bsdeptid,</if>
            <if test="fContacts != null">f_contacts,</if>
            <if test="fTel != null">f_tel,</if>
            <if test="fCorpid != null">f_corpid,</if>
            <if test="fTocorpid != null">f_tocorpid,</if>
            <if test="fStltypeid != null">f_stltypeid,</if>
            <if test="fBscorpno != null">f_bscorpno,</if>
            <if test="fWarehouseid != null">f_warehouseid,</if>
            <if test="fStorekeeper != null">f_storekeeper,</if>
            <if test="fChargedate != null">f_chargedate,</if>
            <if test="fBsdate != null">f_bsdate,</if>
            <if test="fPlanqty != null">f_planqty,</if>
            <if test="fPlangrossweight != null">f_plangrossweight,</if>
            <if test="fPlannetweight != null">f_plannetweight,</if>
            <if test="fPlanvolumn != null">f_planvolumn,</if>
            <if test="fQty != null">f_qty,</if>
            <if test="fGrossweight != null">f_grossweight,</if>
            <if test="fNetweight != null">f_netweight,</if>
            <if test="fVolumn != null">f_volumn,</if>
            <if test="fBillingway != null">f_billingway,</if>
            <if test="fTrademodeid != null">f_trademodeid,</if>
            <if test="fSbu != null">f_sbu,</if>
            <if test="fFeetunit != null">f_feetunit,</if>
            <if test="fMblno != null">f_mblno,</if>
            <if test="fMarks != null">f_marks,</if>
            <if test="fVslvoy != null">f_vslvoy,</if>
            <if test="fEta != null">f_eta,</if>
            <if test="fCustomno != null">f_customno,</if>
            <if test="fIfweigh != null">f_ifweigh,</if>
            <if test="fIfpledge != null">f_ifpledge,</if>
            <if test="fIfdamage != null">f_ifdamage,</if>
            <if test="fBankcorpid != null">f_bankcorpid,</if>
            <if test="fBilltype != null">f_billtype,</if>
            <if test="fBillstatus != null">f_billstatus,</if>
            <if test="fItemsStatus != null">f_items_status,</if>
            <if test="delFlag != null">del_flag,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="remark != null">remark,</if>
            <if test="fBillingDeadline != null">f_billing_deadline,</if>
            <if test="fProductName != null">f_product_name,</if>
            <if test="fReviewDate != null">f_review_date,</if>
            <if test="fTruckno != null">f_truckno,</if>
            <if test="fDriverName != null">f_driver_name,</if>
            <if test="fDriverTel != null">f_driver_tel,</if>
            <if test="fDriverIdCar != null">f_driver_id_car,</if>
            <if test="fBusinessType != null">f_business_type,</if>
            <if test="fLabour != null">f_labour,</if>
            <if test="fFleet != null">f_fleet,</if>
            <if test="fInwarehouseid != null">f_inwarehouseid,</if>
            <if test="fBstime != null">f_bstime,</if>
            <if test="fCartype != null">f_cartype,</if>
            <if test="fGoodsid != null">f_goodsid,</if>
            <if test="fNewTrademodeid != null">f_new_trademodeid,</if>
            <if test="fLoadportid != null">f_loadportid,</if>
            <if test="fDestportid != null">f_destportid,</if>
            <if test="fServiceitems != null">f_serviceitems,</if>
            <if test="fInvoceobj != null">f_invoceobj,</if>
            <if test="fSign != null">f_sign,</if>
            <if test="fDetentioncargo != null">f_detentioncargo,</if>
            <if test="fBooksmarks != null">f_booksmarks,</if>
            <if test="fShippername != null">f_shippername,</if>
            <if test="fShipperattn != null">f_shipperattn,</if>
            <if test="fShippertel != null">f_shippertel,</if>
            <if test="fConsigneername != null">f_consigneername,</if>
            <if test="fConsigneeattn != null">f_consigneeattn,</if>
            <if test="fConsigneetel != null">f_consigneetel,</if>
            <if test="fInsurance != null">f_insurance,</if>
            <if test="fInsuranceamt != null">f_insuranceamt,</if>
            <if test="fClosedate != null">f_closedate,</if>
            <if test="fDocmentdate != null">f_docmentdate,</if>
            <if test="fVslid != null">f_vslid,</if>
            <if test="fVoyid != null">f_voyid,</if>
            <if test="fTypeid != null">f_typeid,</if>
            <if test="fPaymode != null">f_paymode,</if>
            <if test="fLaneid != null">f_laneid,</if>
            <if test="fCntval != null">f_cntval,</if>
            <if test="freeContainerDate != null">free_container_date,</if>
            <if test="fBusinessAttribution != null">f_business_attribution,</if>
            <if test="fSupervisionUnit != null">f_supervision_unit,</if>
            <if test="fDeclarationElements != null">f_declaration_elements,</if>
            <if test="fPartNumber != null">f_part_number,</if>
            <if test="fIfinspection != null">f_ifinspection,</if>
            <if test="fValue != null">f_value,</if>
            <if test="fWeighingDate != null">f_weighing_date,</if>
            <if test="fIfsampling != null">f_ifsampling,</if>
            <if test="sendSampleDate != null">send_sample_date,</if>
            <if test="fIfweightRecovery != null">f_ifweight_recovery,</if>
            <if test="weightRecoveryDate != null">weight_recovery_date,</if>
            <if test="warehouseStatus != null">warehouse_status,</if>
            <if test="fTimes != null">f_times,</if>
            <if test="fDateChanged != null">f_date_changed,</if>
            <if test="fChargetype != null and fChargetype != ''">f_chargetype,</if>
            <if test="fWeighWeight != null">f_weigh_weight,</if>
            <if test="fPredictBranch != null">f_predict_branch,</if>
            <if test="fGrade != null">f_grade,</if>
            <if test="fDeliveryDetails != null">f_delivery_details,</if>
            <if test="fSalesmanId != null">f_salesman_id,</if>
            <if test="fItemstatus != null">f_itemstatus,</if>
            <if test="fUpdeteStatus != null">f_updete_status,</if>
            <if test="fSubmitUpdate != null">f_submit_update,</if>
            <if test="fDeleteStatus != null">f_delete_status,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="fBillno != null">#{fBillno},</if>
            <if test="fCustomsdeclartion != null">#{fCustomsdeclartion},</if>
            <if test="fOriginalbillno != null">#{fOriginalbillno},</if>
            <if test="fDeptid != null">#{fDeptid},</if>
            <if test="fBsdeptid != null">#{fBsdeptid},</if>
            <if test="fContacts != null">#{fContacts},</if>
            <if test="fTel != null">#{fTel},</if>
            <if test="fCorpid != null">#{fCorpid},</if>
            <if test="fTocorpid != null">#{fTocorpid},</if>
            <if test="fStltypeid != null">#{fStltypeid},</if>
            <if test="fBscorpno != null">#{fBscorpno},</if>
            <if test="fWarehouseid != null">#{fWarehouseid},</if>
            <if test="fStorekeeper != null">#{fStorekeeper},</if>
            <if test="fChargedate != null">#{fChargedate},</if>
            <if test="fBsdate != null">#{fBsdate},</if>
            <if test="fPlanqty != null">#{fPlanqty},</if>
            <if test="fPlangrossweight != null">#{fPlangrossweight},</if>
            <if test="fPlannetweight != null">#{fPlannetweight},</if>
            <if test="fPlanvolumn != null">#{fPlanvolumn},</if>
            <if test="fQty != null">#{fQty},</if>
            <if test="fGrossweight != null">#{fGrossweight},</if>
            <if test="fNetweight != null">#{fNetweight},</if>
            <if test="fVolumn != null">#{fVolumn},</if>
            <if test="fBillingway != null">#{fBillingway},</if>
            <if test="fTrademodeid != null">#{fTrademodeid},</if>
            <if test="fSbu != null">#{fSbu},</if>
            <if test="fFeetunit != null">#{fFeetunit},</if>
            <if test="fMblno != null">#{fMblno},</if>
            <if test="fMarks != null">#{fMarks},</if>
            <if test="fVslvoy != null">#{fVslvoy},</if>
            <if test="fEta != null">#{fEta},</if>
            <if test="fCustomno != null">#{fCustomno},</if>
            <if test="fIfweigh != null">#{fIfweigh},</if>
            <if test="fIfpledge != null">#{fIfpledge},</if>
            <if test="fIfdamage != null">#{fIfdamage},</if>
            <if test="fBankcorpid != null">#{fBankcorpid},</if>
            <if test="fBilltype != null">#{fBilltype},</if>
            <if test="fBillstatus != null">#{fBillstatus},</if>
            <if test="fItemsStatus != null">#{fItemsStatus},</if>
            <if test="delFlag != null">#{delFlag},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="remark != null">#{remark},</if>
            <if test="fBillingDeadline != null">#{fBillingDeadline},</if>
            <if test="fProductName != null">#{fProductName},</if>
            <if test="fReviewDate != null">#{fReviewDate},</if>
            <if test="fTruckno != null">#{fTruckno},</if>
            <if test="fDriverName != null">#{fDriverName},</if>
            <if test="fDriverTel != null">#{fDriverTel},</if>
            <if test="fDriverIdCar != null">#{fDriverIdCar},</if>
            <if test="fBusinessType != null">#{fBusinessType},</if>
            <if test="fLabour != null">#{fLabour},</if>
            <if test="fFleet != null">#{fFleet},</if>
            <if test="fInwarehouseid != null">#{fInwarehouseid},</if>
            <if test="fBstime != null">#{fBstime},</if>
            <if test="fCartype != null">#{fCartype},</if>
            <if test="fGoodsid != null">#{fGoodsid},</if>
            <if test="fNewTrademodeid != null">#{fNewTrademodeid},</if>
            <if test="fLoadportid != null">#{fLoadportid},</if>
            <if test="fDestportid != null">#{fDestportid},</if>
            <if test="fServiceitems != null">#{fServiceitems},</if>
            <if test="fInvoceobj != null">#{fInvoceobj},</if>
            <if test="fSign != null">#{fSign},</if>
            <if test="fDetentioncargo != null">#{fDetentioncargo},</if>
            <if test="fBooksmarks != null">#{fBooksmarks},</if>
            <if test="fShippername != null">#{fShippername},</if>
            <if test="fShipperattn != null">#{fShipperattn},</if>
            <if test="fShippertel != null">#{fShippertel},</if>
            <if test="fConsigneername != null">#{fConsigneername},</if>
            <if test="fConsigneeattn != null">#{fConsigneeattn},</if>
            <if test="fConsigneetel != null">#{fConsigneetel},</if>
            <if test="fInsurance != null">#{fInsurance},</if>
            <if test="fInsuranceamt != null">#{fInsuranceamt},</if>
            <if test="fClosedate != null">#{fClosedate},</if>
            <if test="fDocmentdate != null">#{fDocmentdate},</if>
            <if test="fVslid != null">#{fVslid},</if>
            <if test="fVoyid != null">#{fVoyid},</if>
            <if test="fTypeid != null">#{fTypeid},</if>
            <if test="fPaymode != null">#{fPaymode},</if>
            <if test="fLaneid != null">#{fLaneid},</if>
            <if test="fCntval != null">#{fCntval},</if>
            <if test="freeContainerDate != null">#{freeContainerDate},</if>
            <if test="fBusinessAttribution != null">#{fBusinessAttribution},</if>
            <if test="fSupervisionUnit != null">#{fSupervisionUnit},</if>
            <if test="fDeclarationElements != null">#{fDeclarationElements},</if>
            <if test="fPartNumber != null">#{fPartNumber},</if>
            <if test="fIfinspection != null">#{fIfinspection},</if>
            <if test="fValue != null">#{fValue},</if>
            <if test="fWeighingDate != null">#{fWeighingDate},</if>
            <if test="fIfsampling != null">#{fIfsampling},</if>
            <if test="sendSampleDate != null">#{sendSampleDate},</if>
            <if test="fIfweightRecovery != null">#{fIfweightRecovery},</if>
            <if test="weightRecoveryDate != null">#{weightRecoveryDate},</if>
            <if test="warehouseStatus != null">#{warehouseStatus},</if>
            <if test="fTimes != null">#{fTimes},</if>
            <if test="fDateChanged != null">#{fDateChanged},</if>
            <if test="fChargetype != null and fChargetype != ''">#{fChargetype},</if>
            <if test="fWeighWeight != null">#{fWeighWeight},</if>
            <if test="fPredictBranch != null">#{fPredictBranch},</if>
            <if test="fGrade != null">#{fGrade},</if>
            <if test="fDeliveryDetails != null">#{fDeliveryDetails},</if>
            <if test="fSalesmanId != null">#{fSalesmanId},</if>
            <if test="fItemstatus != null">#{fItemstatus},</if>
            <if test="fUpdeteStatus != null">#{fUpdeteStatus},</if>
            <if test="fSubmitUpdate != null">#{fSubmitUpdate},</if>
            <if test="fDeleteStatus != null">#{fDeleteStatus},</if>
         </trim>
    </insert>

    <update id="updateTWarehousebillsLogger" parameterType="TWarehousebillsLogger">
        update t_warehousebills_logger
        <trim prefix="SET" suffixOverrides=",">
            <if test="fBillno != null">f_billno = #{fBillno},</if>
            <if test="fCustomsdeclartion != null">f_customsdeclartion = #{fCustomsdeclartion},</if>
            <if test="fOriginalbillno != null">f_originalbillno = #{fOriginalbillno},</if>
            <if test="fDeptid != null">f_deptid = #{fDeptid},</if>
            <if test="fBsdeptid != null">f_bsdeptid = #{fBsdeptid},</if>
            <if test="fContacts != null">f_contacts = #{fContacts},</if>
            <if test="fTel != null">f_tel = #{fTel},</if>
            <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
            <if test="fTocorpid != null">f_tocorpid = #{fTocorpid},</if>
            <if test="fStltypeid != null">f_stltypeid = #{fStltypeid},</if>
            <if test="fBscorpno != null">f_bscorpno = #{fBscorpno},</if>
            <if test="fWarehouseid != null">f_warehouseid = #{fWarehouseid},</if>
            <if test="fStorekeeper != null">f_storekeeper = #{fStorekeeper},</if>
            <if test="fChargedate != null">f_chargedate = #{fChargedate},</if>
            <if test="fBsdate != null">f_bsdate = #{fBsdate},</if>
            <if test="fPlanqty != null">f_planqty = #{fPlanqty},</if>
            <if test="fPlangrossweight != null">f_plangrossweight = #{fPlangrossweight},</if>
            <if test="fPlannetweight != null">f_plannetweight = #{fPlannetweight},</if>
            <if test="fPlanvolumn != null">f_planvolumn = #{fPlanvolumn},</if>
            <if test="fQty != null">f_qty = #{fQty},</if>
            <if test="fGrossweight != null">f_grossweight = #{fGrossweight},</if>
            <if test="fNetweight != null">f_netweight = #{fNetweight},</if>
            <if test="fVolumn != null">f_volumn = #{fVolumn},</if>
            <if test="fBillingway != null">f_billingway = #{fBillingway},</if>
            <if test="fTrademodeid != null">f_trademodeid = #{fTrademodeid},</if>
            <if test="fSbu != null">f_sbu = #{fSbu},</if>
            <if test="fFeetunit != null">f_feetunit = #{fFeetunit},</if>
            <if test="fMblno != null">f_mblno = #{fMblno},</if>
            <if test="fMarks != null">f_marks = #{fMarks},</if>
            <if test="fVslvoy != null">f_vslvoy = #{fVslvoy},</if>
            <if test="fEta != null">f_eta = #{fEta},</if>
            <if test="fCustomno != null">f_customno = #{fCustomno},</if>
            <if test="fIfweigh != null">f_ifweigh = #{fIfweigh},</if>
            <if test="fIfpledge != null">f_ifpledge = #{fIfpledge},</if>
            <if test="fIfdamage != null">f_ifdamage = #{fIfdamage},</if>
            <if test="fBankcorpid != null">f_bankcorpid = #{fBankcorpid},</if>
            <if test="fBilltype != null">f_billtype = #{fBilltype},</if>
            <if test="fBillstatus != null">f_billstatus = #{fBillstatus},</if>
            <if test="fItemsStatus != null">f_items_status = #{fItemsStatus},</if>
            <if test="delFlag != null">del_flag = #{delFlag},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="fBillingDeadline != null">f_billing_deadline = #{fBillingDeadline},</if>
            <if test="fProductName != null">f_product_name = #{fProductName},</if>
            <if test="fReviewDate != null">f_review_date = #{fReviewDate},</if>
            <if test="fTruckno != null">f_truckno = #{fTruckno},</if>
            <if test="fDriverName != null">f_driver_name = #{fDriverName},</if>
            <if test="fDriverTel != null">f_driver_tel = #{fDriverTel},</if>
            <if test="fDriverIdCar != null">f_driver_id_car = #{fDriverIdCar},</if>
            <if test="fBusinessType != null">f_business_type = #{fBusinessType},</if>
            <if test="fLabour != null">f_labour = #{fLabour},</if>
            <if test="fFleet != null">f_fleet = #{fFleet},</if>
            <if test="fInwarehouseid != null">f_inwarehouseid = #{fInwarehouseid},</if>
            <if test="fBstime != null">f_bstime = #{fBstime},</if>
            <if test="fCartype != null">f_cartype = #{fCartype},</if>
            <if test="fGoodsid != null">f_goodsid = #{fGoodsid},</if>
            <if test="fNewTrademodeid != null">f_new_trademodeid = #{fNewTrademodeid},</if>
            <if test="fLoadportid != null">f_loadportid = #{fLoadportid},</if>
            <if test="fDestportid != null">f_destportid = #{fDestportid},</if>
            <if test="fServiceitems != null">f_serviceitems = #{fServiceitems},</if>
            <if test="fInvoceobj != null">f_invoceobj = #{fInvoceobj},</if>
            <if test="fSign != null">f_sign = #{fSign},</if>
            <if test="fDetentioncargo != null">f_detentioncargo = #{fDetentioncargo},</if>
            <if test="fBooksmarks != null">f_booksmarks = #{fBooksmarks},</if>
            <if test="fShippername != null">f_shippername = #{fShippername},</if>
            <if test="fShipperattn != null">f_shipperattn = #{fShipperattn},</if>
            <if test="fShippertel != null">f_shippertel = #{fShippertel},</if>
            <if test="fConsigneername != null">f_consigneername = #{fConsigneername},</if>
            <if test="fConsigneeattn != null">f_consigneeattn = #{fConsigneeattn},</if>
            <if test="fConsigneetel != null">f_consigneetel = #{fConsigneetel},</if>
            <if test="fInsurance != null">f_insurance = #{fInsurance},</if>
            <if test="fInsuranceamt != null">f_insuranceamt = #{fInsuranceamt},</if>
            <if test="fClosedate != null">f_closedate = #{fClosedate},</if>
            <if test="fDocmentdate != null">f_docmentdate = #{fDocmentdate},</if>
            <if test="fVslid != null">f_vslid = #{fVslid},</if>
            <if test="fVoyid != null">f_voyid = #{fVoyid},</if>
            <if test="fTypeid != null">f_typeid = #{fTypeid},</if>
            <if test="fPaymode != null">f_paymode = #{fPaymode},</if>
            <if test="fLaneid != null">f_laneid = #{fLaneid},</if>
            <if test="fCntval != null">f_cntval = #{fCntval},</if>
            <if test="freeContainerDate != null">free_container_date = #{freeContainerDate},</if>
            <if test="fBusinessAttribution != null">f_business_attribution = #{fBusinessAttribution},</if>
            <if test="fSupervisionUnit != null">f_supervision_unit = #{fSupervisionUnit},</if>
            <if test="fDeclarationElements != null">f_declaration_elements = #{fDeclarationElements},</if>
            <if test="fPartNumber != null">f_part_number = #{fPartNumber},</if>
            <if test="fIfinspection != null">f_ifinspection = #{fIfinspection},</if>
            <if test="fValue != null">f_value = #{fValue},</if>
            <if test="fWeighingDate != null">f_weighing_date = #{fWeighingDate},</if>
            <if test="fIfsampling != null">f_ifsampling = #{fIfsampling},</if>
            <if test="sendSampleDate != null">send_sample_date = #{sendSampleDate},</if>
            <if test="fIfweightRecovery != null">f_ifweight_recovery = #{fIfweightRecovery},</if>
            <if test="weightRecoveryDate != null">weight_recovery_date = #{weightRecoveryDate},</if>
            <if test="warehouseStatus != null">warehouse_status = #{warehouseStatus},</if>
            <if test="fTimes != null">f_times = #{fTimes},</if>
            <if test="fDateChanged != null">f_date_changed = #{fDateChanged},</if>
            <if test="fChargetype != null and fChargetype != ''">f_chargetype = #{fChargetype},</if>
            <if test="fWeighWeight != null">f_weigh_weight = #{fWeighWeight},</if>
            <if test="fPredictBranch != null">f_predict_branch = #{fPredictBranch},</if>
            <if test="fGrade != null">f_grade = #{fGrade},</if>
            <if test="fDeliveryDetails != null">f_delivery_details = #{fDeliveryDetails},</if>
            <if test="fSalesmanId != null">f_salesman_id = #{fSalesmanId},</if>
            <if test="fItemstatus != null">f_itemstatus = #{fItemstatus},</if>
            <if test="fUpdeteStatus != null">f_updete_status = #{fUpdeteStatus},</if>
            <if test="fSubmitUpdate != null">f_submit_update = #{fSubmitUpdate},</if>
            <if test="fDeleteStatus != null">f_delete_status = #{fDeleteStatus},</if>
        </trim>
        where f_id = #{fId}
    </update>

    <delete id="deleteTWarehousebillsLoggerById" parameterType="Long">
        delete from t_warehousebills_logger where f_id = #{fId}
    </delete>

    <delete id="deleteTWarehousebillsLoggerByIds" parameterType="String">
        delete from t_warehousebills_logger where f_id in 
        <foreach item="fId" collection="array" open="(" separator="," close=")">
            #{fId}
        </foreach>
    </delete>
    <insert id="copyTwarehousebills" parameterType="Long">
        INSERT INTO t_warehousebills_logger
        SELECT
            tw.f_id,
            tw.f_billno,
            tw.f_customsdeclartion,
            tw.f_originalbillno,
            tw.f_deptid,
            tw.f_bsdeptid,
            tw.f_contacts,
            tw.f_tel,
            tw.f_corpid,
            tw.f_tocorpid,
            tw.f_stltypeid,
            tw.f_bscorpno,
            tw.f_warehouseid,
            tw.f_storekeeper,
            tw.f_chargedate,
            tw.f_bsdate,
            tw.f_planqty,
            tw.f_plangrossweight,
            tw.f_plannetweight,
            tw.f_planvolumn,
            tw.f_qty,
            tw.f_grossweight,
            tw.f_netweight,
            tw.f_volumn,
            tw.f_billingway,
            tw.f_trademodeid,
            tw.f_sbu,
            tw.f_feetunit,
            tw.f_mblno,
            tw.f_marks,
            tw.f_vslvoy,
            tw.f_eta,
            tw.f_customno,
            tw.f_ifweigh,
            tw.f_ifpledge,
            tw.f_ifdamage,
            tw.f_bankcorpid,
            tw.f_billtype,
            tw.f_billstatus,
            tw.f_items_status,
            tw.del_flag,
            tw.create_by,
            tw.create_time,
            tw.update_by,
            tw.update_time,
            tw.remark,
            tw.f_billing_deadline,
            tw.f_product_name,
            tw.f_review_date,
            tw.f_truckno,
            tw.f_driver_name,
            tw.f_driver_tel,
            tw.f_driver_id_car,
            tw.f_business_type,
            tw.f_labour,
            tw.f_fleet,
            tw.f_inwarehouseid,
            tw.f_bstime,
            tw.f_cartype,
            tw.f_goodsid,
            tw.f_new_trademodeid,
            tw.f_loadportid,
            tw.f_destportid,
            tw.f_serviceitems,
            tw.f_invoceobj,
            tw.f_sign,
            tw.f_detentioncargo,
            tw.f_booksmarks,
            tw.f_shippername,
            tw.f_shipperattn,
            tw.f_shippertel,
            tw.f_consigneername,
            tw.f_consigneeattn,
            tw.f_consigneetel,
            tw.f_insurance,
            tw.f_insuranceamt,
            tw.f_closedate,
            tw.f_docmentdate,
            tw.f_vslid,
            tw.f_voyid,
            tw.f_typeid,
            tw.f_paymode,
            tw.f_laneid,
            tw.f_cntval,
            tw.free_container_date,
            tw.f_business_attribution,
            tw.f_supervision_unit,
            tw.f_declaration_elements,
            tw.f_part_number,
            tw.f_ifinspection,
            tw.f_value,
            tw.f_weighing_date,
            tw.f_ifsampling,
            tw.send_sample_date,
            tw.f_ifweight_recovery,
            tw.weight_recovery_date,
            tw.warehouse_status,
            tw.f_times,
            tw.f_date_changed,
            tw.f_chargetype,
            tw.f_weigh_weight,
            tw.f_predict_branch,
            tw.f_grade,
            tw.f_delivery_details,
            tw.f_salesman_id,
            tw.f_itemstatus,
            tw.f_updete_status,
            tw.f_submit_update,
            tw.f_delete_status
        FROM
            t_warehousebills tw
        WHERE tw.f_id = #{fId}
    </insert>
    
</mapper>