1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108 |
- <?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.TWarehousebillsitemsMapper">
- <resultMap type="TWarehousebillsitems" id="TWarehousebillsitemsResult">
- <result property="fId" column="f_id"/>
- <result property="fPid" column="f_pid"/>
- <result property="fSrcid" column="f_srcid"/>
- <result property="fLineno" column="f_lineno"/>
- <result property="fBillno" column="f_billno"/>
- <result property="fShipper" column="f_shipper"/>
- <result property="fGoodsid" column="f_goodsid"/>
- <result property="fSrcBsdate" column="f_src_bsdate"/>
- <result property="fMblno" column="f_mblno"/>
- <result property="fOriginalbillno" column="f_originalbillno"/>
- <result property="fTransferWarehouselocid" column="f_transfer_warehouselocid"/>
- <result property="fWarehouselocid" column="f_warehouselocid"/>
- <result property="fOriginalbilldate" column="f_originalbilldate"/>
- <result property="fBsdate" column="f_bsdate"/>
- <result property="fBillingway" column="f_billingway"/>
- <result property="fChargedate" column="f_chargedate"/>
- <result property="fBoxno" column="f_boxno"/>
- <result property="fGoodsval" column="f_goodsval"/>
- <result property="fCntqty" column="f_cntqty"/>
- <result property="fPackagespecs" column="f_packagespecs"/>
- <result property="fCntrtype" column="f_cntrtype"/>
- <result property="fPlanvolumn" column="f_planvolumn"/>
- <result property="fPlanqty" column="f_planqty"/>
- <result property="fPlangrossweight" column="f_plangrossweight"/>
- <result property="fPlannetweight" column="f_plannetweight"/>
- <result property="fVolumn" column="f_volumn"/>
- <result property="fQty" column="f_qty"/>
- <result property="fGrossweight" column="f_grossweight"/>
- <result property="fNetweight" column="f_netweight"/>
- <result property="fCntrno" column="f_cntrno"/>
- <result property="fTruckno" column="f_truckno"/>
- <result property="fMarks" column="f_marks"/>
- <result property="fActualWeight" column="f_actual_weight"/>
- <result property="fBillstatus" column="f_billstatus"/>
- <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="fInventoryDays" column="f_inventory_days"/>
- <result property="fStorageFeeDeadline" column="f_storage_fee_deadline"/>
- <result property="fAmt" column="f_amt"/>
- <result property="fBillingDays" column="f_billing_days"/>
- <result property="fDriverName" column="f_driver_name"/>
- <result property="fDriverTel" column="f_driver_tel"/>
- <result property="fDriverIdCar" column="f_driver_id_car"/>
- <result property="fSerialNumber" column="f_serial_number"/>
- <result property="fIsPass" column="f_is_pass"/>
- <result property="fBilltype" column="f_billtype"/>
- <result property="fBillingQty" column="f_billing_qty"/>
- <result property="fBillingDeadline" column="f_billing_deadline"/>
- <result property="fBusinessType" column="f_business_type"/>
- <result property="fIsInventory" column="f_is_inventory"/>
- <result property="fWarehouseInformation" column="f_warehouse_information"/>
- <result property="fOrgwarehouseInformation" column="f_orgwarehouse_information"/>
- <result property="fLabour" column="f_labour"/>
- <result property="fFleet" column="f_fleet"/>
- <result property="fStevedore" column="f_stevedore"/>
- <result property="fLntype" column="f_lntype"/>
- <result property="fForkliftman" column="f_forkliftman"/>
- <result property="fLocalcntrno" column="f_localcntrno"/>
- <result property="fSealno" column="f_sealno"/>
- <result property="fNowCarton" column="f_now_carton" />
- <result property="fItemstatus" column="f_itemstatus" />
- <result property="fCartypeId" column="f_cartype_id" />
- <result property="fDc" column="f_dc" />
- <result property="fTocorpid" column="f_tocorpid" />
- <result property="isCalculateStorageFees" column="is_calculate_storage_fees" />
- </resultMap>
- <resultMap type="WarehouseTimeIntervalVO" id="WarehouseTimeIntervalResult">
- <result property="sumQty" column="f_qty" />
- <result property="warehouseId" column="f_warehouseid" />
- </resultMap>
- <resultMap type="CalculateStorageFeesInfoVO" id="StorageFeesInfoResult">
- <result property="warehouse" column="f_warehouseid"/>
- <result property="fId" column="f_id"/>
- <result property="warehouse" column="f_warehouseid"/>
- <result property="fBillno" column="f_billno"/>
- <result property="fGoodsid" column="f_goodsid"/>
- <result property="fBsdate" column="f_bsdate"/>
- <result property="fBillingway" column="f_billingway"/>
- <result property="fChargedate" column="f_chargedate"/>
- <result property="fSrcBsdate" column="f_src_bsdate"/>
- <result property="fOriginalbilldate" column="f_originalbilldate"/>
- <result property="fMblno" column="f_mblno"/>
- <result property="fVolumn" column="f_volumn"/>
- <result property="fMarks" column="f_marks"/>
- <result property="fBillingDays" column="f_billing_days"/>
- <result property="fIsInventory" column="f_is_inventory"/>
- <result property="fQty" column="f_qty"/>
- <result property="fOrgwarehouseInformation" column="f_orgwarehouse_information"/>
- <result property="fGrossweight" column="f_grossweight"/>
- <result property="fNetweight" column="f_netweight"/>
- <result property="fBilltype" column="f_billtype"/>
- <result property="fTypeid" column="f_typeid"/>
- <result property="goodsName" column="f_name"/>
- </resultMap>
- <sql id="selectTWarehousebillsitemsVo">
- select f_id, f_pid, f_srcid, f_lineno, f_billno, f_shipper, f_goodsid, f_mblno, f_src_bsdate, f_originalbillno, f_transfer_warehouselocid, f_warehouselocid,
- f_originalbilldate, f_bsdate, f_billingway, f_chargedate, f_boxno, f_goodsval, f_cntqty, f_packagespecs, f_cntrtype, f_planvolumn,
- f_planqty, f_plangrossweight, f_plannetweight, f_volumn, f_qty, f_grossweight, f_netweight, f_cntrno, f_truckno, f_marks, f_actual_weight, f_billstatus,
- del_flag, create_by, create_time, update_by, update_time, remark, f_inventory_days, f_storage_fee_deadline, f_amt, f_billing_days,
- f_driver_name, f_driver_tel, f_driver_id_car, f_serial_number, f_is_pass, f_billtype, f_billing_qty, f_billing_deadline, f_business_type,
- f_is_inventory, f_warehouse_information, f_orgwarehouse_information, f_labour, f_fleet, f_stevedore, f_lntype, f_forkliftman,
- f_localcntrno, f_sealno,f_now_carton,f_itemstatus,f_cartype_id,f_dc,is_calculate_storage_fees from t_warehousebillsitems
- </sql>
- <select id="selectTWarehousebillsitemsList" parameterType="TWarehousebillsitems"
- resultMap="TWarehousebillsitemsResult">
- <include refid="selectTWarehousebillsitemsVo"/>
- <where>
- del_flag = '0'
- <if test="fPid != null ">and f_pid = #{fPid}</if>
- <if test="fLineno != null ">and f_lineno = #{fLineno}</if>
- <if test="fGoodsid != null ">and f_goodsid = #{fGoodsid}</if>
- <if test="fMblno != null and fMblno != ''">and f_mblno = #{fMblno}</if>
- <if test="fBillno != null and fBillno != ''">and f_billno = #{fBillno}</if>
- <if test="fShipper != null and fShipper != ''">and f_shipper like concat('%', #{fShipper}, '%')</if>
- <if test="fSrcBsdate != null ">and f_src_bsdate = #{fSrcBsdate}</if>
- <if test="fWarehouselocid != null ">and f_warehouselocid = #{fWarehouselocid}</if>
- <if test="fBsdate != null ">and f_bsdate = #{fBsdate}</if>
- <if test="fLabour != null ">and f_labour = #{fLabour}</if>
- <if test="fLabour != null ">and f_labour = #{fLabour}</if>
- <if test="fFleet != null ">and f_fleet = #{fFleet}</if>
- <if test="fOriginalbillno != null and fOriginalbillno != ''">and f_originalbillno = #{fOriginalbillno}</if>
- <if test="fBoxno != null and fBoxno != ''">and f_boxno = #{fBoxno}</if>
- <if test="fOriginalbilldate != null ">and f_originalbilldate = #{fOriginalbilldate}</if>
- <if test="fStorageFeeDeadline != null "> and f_storage_fee_deadline = #{fStorageFeeDeadline}</if>
- <if test="fTransferWarehouselocid != null "> and f_transfer_warehouselocid = #{fTransferWarehouselocid}</if>
- <if test="fCntqty != null ">and f_cntqty = #{fCntqty}</if>
- <if test="fGoodsval != null ">and f_goodsval = #{fGoodsval}</if>
- <if test="fCntrtype != null and fCntrtype != ''">and f_cntrtype = #{fCntrtype}</if>
- <if test="fPlanqty != null ">and f_planqty = #{fPlanqty}</if>
- <if test="fPlanvolumn != null ">and f_planvolumn = #{fPlanvolumn}</if>
- <if test="fChargedate != null ">and f_chargedate = #{fChargedate}</if>
- <if test="fIsInventory != null ">and f_is_inventory = #{fIsInventory}</if>
- <if test="fPackagespecs != null ">and f_packagespecs = #{fPackagespecs}</if>
- <if test="fBusinessType != null "> and f_business_type = #{fBusinessType}</if>
- <if test="fWarehouseInformation != null "> and f_warehouse_information = #{fWarehouseInformation}</if>
- <if test="fOrgwarehouseInformation != null "> and f_orgwarehouse_information = #{fOrgwarehouseInformation}</if>
- <if test="fPlangrossweight != null ">and f_plangrossweight = #{fPlangrossweight}</if>
- <if test="fPlannetweight != null ">and f_plannetweight = #{fPlannetweight}</if>
- <if test="fQty != null ">and f_qty = #{fQty}</if>
- <if test="fVolumn != null ">and f_volumn = #{fVolumn}</if>
- <if test="fGrossweight != null ">and f_grossweight = #{fGrossweight}</if>
- <if test="fNetweight != null ">and f_netweight = #{fNetweight}</if>
- <if test="fCntrno != null and fCntrno != ''">and f_cntrno = #{fCntrno}</if>
- <if test="fTruckno != null and fTruckno != ''">and f_truckno = #{fTruckno}</if>
- <if test="fBillstatus != null and fBillstatus != ''">and f_billstatus = #{fBillstatus}</if>
- <if test="fMarks != null and fMarks != ''">and f_marks = #{fMarks}</if>
- <if test="fActualWeight != null and fActualWeight != ''">and f_actual_weight = #{fActualWeight}</if>
- <if test="fInventoryDays != null ">and f_inventory_days = #{fInventoryDays}</if>
- <if test="fAmt != null ">and f_amt = #{fAmt}</if>
- <if test="fBillingDays != null ">and f_billing_days = #{fBillingDays}</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="fSerialNumber != null and fSerialNumber != ''">and f_serial_number = #{fSerialNumber}</if>
- <if test="fIsPass != null and fIsPass != ''">and f_is_pass = #{fIsPass}</if>
- <if test="fDc != null and fDc != ''">and f_dc = #{fDc}</if>
- </where>
- </select>
- <select id="selectTWarehousebillsitemsListByPidToType" parameterType="TWarehousebillsitems"
- resultMap="TWarehousebillsitemsResult">
- <include refid="selectTWarehousebillsitemsVo"/>
- where
- f_pid = #{fPid}
- and
- f_billtype = #{fBilltype} and del_flag = '0'
- </select>
- <select id="selectGoodsTransferitemsList" parameterType="TWarehousebillsitems" resultType="Map">
- SELECT DISTINCT
- item.f_id AS fId,
- item.f_pid AS fPid,
- item.f_srcid AS fSrcid,
- item.f_lineno AS fLineno,
- item.f_billno AS fBillno,
- item.f_shipper AS fShipper,
- item.f_goodsid AS fGoodsid,
- goods.f_name AS fGoodsids,
- goods.if_cntrno AS ifCntrno,
- item.f_warehouselocid AS fWarehouselocid,
- area.f_name AS fWarehouselocids,
- ware.f_name AS fWarehouseids,
- item.f_is_pass AS fIsPass,
- item.f_originalbillno AS fOriginalbillno,
- item.f_src_bsdate AS fSrcBsdate,
- item.f_mblno AS fMblno,
- item.f_bsdate AS fBsdate,
- item.f_boxno AS fBoxno,
- item.f_cntqty AS fCntqty,
- item.f_goodsval AS fGoodsval,
- item.f_cntrtype AS fCntrtype,
- item.f_planqty AS fPlanqty,
- item.f_planvolumn AS fPlanvolumn,
- item.f_billingway AS fBillingway,
- item.f_chargedate AS fChargedate,
- item.f_packagespecs AS fPackagespecs,
- item.f_plangrossweight AS fPlangrossweight,
- item.f_originalbilldate AS fOriginalbilldate,
- item.f_plannetweight AS fPlannetweight,
- item.f_transfer_warehouselocid AS fTransferWarehouselocid,
- w.f_storekeeper fStorekeeper,
- item.f_qty AS fQty,
- item.f_volumn AS fVolumn,
- item.f_driver_name AS fDriverName,
- item.f_driver_tel AS fDriverTel,
- item.f_driver_id_car AS fDriverIdCar,
- item.f_serial_number AS fSerialNumber,
- item.f_marks AS fMarks,
- item.f_actual_weight AS fActualWeight,
- item.f_grossweight AS fGrossweight,
- item.f_is_inventory AS fIsInventory,
- item.f_business_type AS fBusinessType,
- item.f_netweight AS fNetweight,
- item.f_cntrno AS fCntrno,
- item.f_truckno AS fTruckno,
- item.f_billstatus AS fBillstatus,
- item.f_itemstatus AS fItemstatus,
- item.remark,
- b.f_name AS fLabours,
- item.f_labour AS fLabour,
- f.f_name AS fFleets,
- item.f_fleet AS fFleet,
- item.f_stevedore AS fStevedore,
- item.f_forkliftman AS fForkliftman,
- item.f_localcntrno AS fLocalcntrno,
- l.dict_label AS fLntypes,
- item.f_lntype AS fLntype,
- item.f_sealno AS fSealno,
- item.f_warehouse_information AS fWarehouseInformation,
- item.f_orgwarehouse_information AS fOrgwarehouseInformation,
- item.f_now_carton AS fNowCarton,
- item.f_cartype_id AS fCartypeId,
- item.f_dc AS fDc,
- item.create_time AS createTime
- FROM
- t_warehousebills w
- LEFT JOIN t_warehousebillsitems item ON item.f_pid = w.f_id
- LEFT JOIN t_goods goods ON goods.f_id = item.f_goodsid
- LEFT JOIN t_warehouse_area area ON area.f_id = item.f_warehouselocid
- LEFT JOIN t_warehouse ware ON ware.f_id = area.f_warehouseid
- LEFT JOIN t_corps b ON b.f_id = item.f_labour
- LEFT JOIN t_corps f ON f.f_id = item.f_fleet
- LEFT JOIN sys_dict_data l ON l.dict_value = item.f_lntype
- AND l.dict_type = 'ln_way'
- WHERE
- item.f_pid = #{fPid} and w.del_flag = '0' and item.del_flag = '0'
- </select>
- <select id="selectTWarehousebillsitemsById" parameterType="Long" resultMap="TWarehousebillsitemsResult">
- <include refid="selectTWarehousebillsitemsVo"/>
- where f_id = #{fId} and del_flag = '0'
- </select>
- <insert id="insertTWarehousebillsitems" parameterType="TWarehousebillsitems" useGeneratedKeys="true" keyProperty="fId">
- insert into t_warehousebillsitems
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="fId != null">f_id,</if>
- <if test="fPid != null">f_pid,</if>
- <if test="fSrcid != null">f_srcid,</if>
- <if test="fLineno != null">f_lineno,</if>
- <if test="fBillno != null">f_billno,</if>
- <if test="fShipper != null">f_shipper,</if>
- <if test="fGoodsid != null">f_goodsid,</if>
- <if test="fMblno != null">f_mblno,</if>
- <if test="fSrcBsdate != null">f_src_bsdate,</if>
- <if test="fOriginalbillno != null">f_originalbillno,</if>
- <if test="fTransferWarehouselocid != null">f_transfer_warehouselocid,</if>
- <if test="fWarehouselocid != null">f_warehouselocid,</if>
- <if test="fOriginalbilldate != null">f_originalbilldate,</if>
- <if test="fBsdate != null">f_bsdate,</if>
- <if test="fBillingway != null">f_billingway,</if>
- <if test="fChargedate != null">f_chargedate,</if>
- <if test="fBoxno != null">f_boxno,</if>
- <if test="fGoodsval != null">f_goodsval,</if>
- <if test="fCntqty != null">f_cntqty,</if>
- <if test="fPackagespecs != null">f_packagespecs,</if>
- <if test="fCntrtype != null">f_cntrtype,</if>
- <if test="fPlanvolumn != null">f_planvolumn,</if>
- <if test="fPlanqty != null">f_planqty,</if>
- <if test="fPlangrossweight != null">f_plangrossweight,</if>
- <if test="fPlannetweight != null">f_plannetweight,</if>
- <if test="fVolumn != null">f_volumn,</if>
- <if test="fQty != null">f_qty,</if>
- <if test="fGrossweight != null">f_grossweight,</if>
- <if test="fNetweight != null">f_netweight,</if>
- <if test="fCntrno != null">f_cntrno,</if>
- <if test="fTruckno != null">f_truckno,</if>
- <if test="fMarks != null">f_marks,</if>
- <if test="fActualWeight != null">f_actual_weight,</if>
- <if test="fBillstatus != null">f_billstatus,</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="fInventoryDays != null">f_inventory_days,</if>
- <if test="fStorageFeeDeadline != null">f_storage_fee_deadline,</if>
- <if test="fAmt != null">f_amt,</if>
- <if test="fBillingDays != null">f_billing_days,</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="fSerialNumber != null">f_serial_number,</if>
- <if test="fIsPass != null">f_is_pass,</if>
- <if test="fBilltype != null">f_billtype,</if>
- <if test="fBillingQty != null">f_billing_qty,</if>
- <if test="fBillingDeadline != null">f_billing_deadline,</if>
- <if test="fBusinessType != null">f_business_type,</if>
- <if test="fIsInventory != null">f_is_inventory,</if>
- <if test="fWarehouseInformation != null">f_warehouse_information,</if>
- <if test="fOrgwarehouseInformation != null">f_orgwarehouse_information,</if>
- <if test="fLabour != null">f_labour,</if>
- <if test="fFleet != null">f_fleet,</if>
- <if test="fStevedore != null">f_stevedore,</if>
- <if test="fLntype != null">f_lntype,</if>
- <if test="fForkliftman != null">f_forkliftman,</if>
- <if test="fLocalcntrno != null">f_localcntrno,</if>
- <if test="fSealno != null">f_sealno,</if>
- <if test="fNowCarton != null">f_now_carton,</if>
- <if test="fItemstatus != null">f_itemstatus,</if>
- <if test="fCartypeId != null">f_cartype_id,</if>
- <if test="fDc != null">f_dc,</if>
- <if test="isCalculateStorageFees != null">is_calculate_storage_fees,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="fId != null">#{fId},</if>
- <if test="fPid != null">#{fPid},</if>
- <if test="fSrcid != null">#{fSrcid},</if>
- <if test="fLineno != null">#{fLineno},</if>
- <if test="fBillno != null">#{fBillno},</if>
- <if test="fShipper != null">#{fShipper},</if>
- <if test="fGoodsid != null">#{fGoodsid},</if>
- <if test="fMblno != null">#{fMblno},</if>
- <if test="fSrcBsdate != null">#{fSrcBsdate},</if>
- <if test="fOriginalbillno != null">#{fOriginalbillno},</if>
- <if test="fTransferWarehouselocid != null">#{fTransferWarehouselocid},</if>
- <if test="fWarehouselocid != null">#{fWarehouselocid},</if>
- <if test="fOriginalbilldate != null">#{fOriginalbilldate},</if>
- <if test="fBsdate != null">#{fBsdate},</if>
- <if test="fBillingway != null">#{fBillingway},</if>
- <if test="fChargedate != null">#{fChargedate},</if>
- <if test="fBoxno != null">#{fBoxno},</if>
- <if test="fGoodsval != null">#{fGoodsval},</if>
- <if test="fCntqty != null">#{fCntqty},</if>
- <if test="fPackagespecs != null">#{fPackagespecs},</if>
- <if test="fCntrtype != null">#{fCntrtype},</if>
- <if test="fPlanvolumn != null">#{fPlanvolumn},</if>
- <if test="fPlanqty != null">#{fPlanqty},</if>
- <if test="fPlangrossweight != null">#{fPlangrossweight},</if>
- <if test="fPlannetweight != null">#{fPlannetweight},</if>
- <if test="fVolumn != null">#{fVolumn},</if>
- <if test="fQty != null">#{fQty},</if>
- <if test="fGrossweight != null">#{fGrossweight},</if>
- <if test="fNetweight != null">#{fNetweight},</if>
- <if test="fCntrno != null">#{fCntrno},</if>
- <if test="fTruckno != null">#{fTruckno},</if>
- <if test="fMarks != null">#{fMarks},</if>
- <if test="fActualWeight != null">#{fActualWeight},</if>
- <if test="fBillstatus != null">#{fBillstatus},</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="fInventoryDays != null">#{fInventoryDays},</if>
- <if test="fStorageFeeDeadline != null">#{fStorageFeeDeadline},</if>
- <if test="fAmt != null">#{fAmt},</if>
- <if test="fBillingDays != null">#{fBillingDays},</if>
- <if test="fDriverName != null">#{fDriverName},</if>
- <if test="fDriverTel != null">#{fDriverTel},</if>
- <if test="fDriverIdCar != null">#{fDriverIdCar},</if>
- <if test="fSerialNumber != null">#{fSerialNumber},</if>
- <if test="fIsPass != null">#{fIsPass},</if>
- <if test="fBilltype != null">#{fBilltype},</if>
- <if test="fBillingQty != null">#{fBillingQty},</if>
- <if test="fBillingDeadline != null">#{fBillingDeadline},</if>
- <if test="fBusinessType != null">#{fBusinessType},</if>
- <if test="fIsInventory != null">#{fIsInventory},</if>
- <if test="fWarehouseInformation != null">#{fWarehouseInformation},</if>
- <if test="fOrgwarehouseInformation != null">#{fOrgwarehouseInformation},</if>
- <if test="fLabour != null">#{fLabour},</if>
- <if test="fFleet != null">#{fFleet},</if>
- <if test="fStevedore != null">#{fStevedore},</if>
- <if test="fLntype != null">#{fLntype},</if>
- <if test="fForkliftman != null">#{fForkliftman},</if>
- <if test="fLocalcntrno != null">#{fLocalcntrno},</if>
- <if test="fSealno != null">#{fSealno},</if>
- <if test="fNowCarton != null">#{fNowCarton},</if>
- <if test="fItemstatus != null">#{fItemstatus},</if>
- <if test="fCartypeId != null">#{fCartypeId},</if>
- <if test="fDc != null">#{fDc},</if>
- <if test="isCalculateStorageFees != null">#{isCalculateStorageFees},</if>
- </trim>
- </insert>
- <update id="updateTWarehousebillsitems" parameterType="TWarehousebillsitems">
- update t_warehousebillsitems
- <trim prefix="SET" suffixOverrides=",">
- <if test="fPid != null">f_pid = #{fPid},</if>
- <if test="fSrcid != null">f_srcid = #{fSrcid},</if>
- <if test="fLineno != null">f_lineno = #{fLineno},</if>
- <if test="fBillno != null">f_billno = #{fBillno},</if>
- <if test="fShipper != null">f_shipper = #{fShipper},</if>
- <if test="fGoodsid != null">f_goodsid = #{fGoodsid},</if>
- <if test="fMblno != null">f_mblno = #{fMblno},</if>
- <if test="fSrcBsdate != null">f_src_bsdate = #{fSrcBsdate},</if>
- <if test="fOriginalbillno != null">f_originalbillno = #{fOriginalbillno},</if>
- <if test="fTransferWarehouselocid != null">f_transfer_warehouselocid = #{fTransferWarehouselocid},</if>
- <if test="fWarehouselocid != null">f_warehouselocid = #{fWarehouselocid},</if>
- <if test="fOriginalbilldate != null">f_originalbilldate = #{fOriginalbilldate},</if>
- <if test="fBsdate != null">f_bsdate = #{fBsdate},</if>
- <if test="fBillingway != null">f_billingway = #{fBillingway},</if>
- <if test="fChargedate != null">f_chargedate = #{fChargedate},</if>
- <if test="fBoxno != null">f_boxno = #{fBoxno},</if>
- <if test="fGoodsval != null">f_goodsval = #{fGoodsval},</if>
- <if test="fCntqty != null">f_cntqty = #{fCntqty},</if>
- <if test="fPackagespecs != null">f_packagespecs = #{fPackagespecs},</if>
- <if test="fCntrtype != null">f_cntrtype = #{fCntrtype},</if>
- <if test="fPlanvolumn != null">f_planvolumn = #{fPlanvolumn},</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="fVolumn != null">f_volumn = #{fVolumn},</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="fCntrno != null">f_cntrno = #{fCntrno},</if>
- <if test="fTruckno != null">f_truckno = #{fTruckno},</if>
- <if test="fMarks != null">f_marks = #{fMarks},</if>
- <if test="fActualWeight != null">f_actual_weight = #{fActualWeight},</if>
- <if test="fBillstatus != null and fBillstatus != ''">f_billstatus = #{fBillstatus},</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="fInventoryDays != null">f_inventory_days = #{fInventoryDays},</if>
- <if test="fStorageFeeDeadline != null">f_storage_fee_deadline = #{fStorageFeeDeadline},</if>
- <if test="fAmt != null">f_amt = #{fAmt},</if>
- <if test="fBillingDays != null">f_billing_days = #{fBillingDays},</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="fSerialNumber != null">f_serial_number = #{fSerialNumber},</if>
- <if test="fIsPass != null">f_is_pass = #{fIsPass},</if>
- <if test="fBilltype != null">f_billtype = #{fBilltype},</if>
- <if test="fBillingQty != null">f_billing_qty = #{fBillingQty},</if>
- <if test="fBillingDeadline != null">f_billing_deadline = #{fBillingDeadline},</if>
- <if test="fBusinessType != null">f_business_type = #{fBusinessType},</if>
- <if test="fIsInventory != null">f_is_inventory = #{fIsInventory},</if>
- <if test="fWarehouseInformation != null">f_warehouse_information = #{fWarehouseInformation},</if>
- <if test="fOrgwarehouseInformation != null">f_orgwarehouse_information = #{fOrgwarehouseInformation},</if>
- <if test="fLabour != null">f_labour = #{fLabour},</if>
- <if test="fFleet != null">f_fleet = #{fFleet},</if>
- <if test="fStevedore != null">f_stevedore = #{fStevedore},</if>
- <if test="fLntype != null">f_lntype = #{fLntype},</if>
- <if test="fForkliftman != null">f_forkliftman = #{fForkliftman},</if>
- <if test="fLocalcntrno != null">f_localcntrno = #{fLocalcntrno},</if>
- <if test="fSealno != null">f_sealno = #{fSealno},</if>
- <if test="fNowCarton != null">f_now_carton = #{fNowCarton},</if>
- <if test="fItemstatus != null">f_itemstatus = #{fItemstatus},</if>
- <if test="fCartypeId != null">f_cartype_id = #{fCartypeId},</if>
- <if test="fDc != null">f_dc = #{fDc},</if>
- <if test="isCalculateStorageFees != null">is_calculate_storage_fees = #{isCalculateStorageFees},</if>
- </trim>
- where f_id = #{fId}
- </update>
- <update id="agreementApprovalRejected" parameterType="TWarehousebillsitems">
- UPDATE
- t_warehousebillsitems
- SET f_storage_fee_deadline = null, f_chargedate = #{fChargedate},
- is_calculate_storage_fees = #{isCalculateStorageFees}
- WHERE
- f_id = #{fId}
- </update>
- <delete id="deleteTWarehousebillsitemsById" parameterType="Long">
- UPDATE t_warehousebillsitems SET del_flag = '1' where f_id = #{fId}
- </delete>
- <delete id="deleteTWarehousebillsitemsByIds" parameterType="String">
- UPDATE t_warehousebillsitems SET del_flag = '1' where f_id in
- <foreach item="fId" collection="array" open="(" separator="," close=")">
- #{fId}
- </foreach>
- </delete>
- <delete id="deleteByFPid" parameterType="Long">
- UPDATE t_warehousebillsitems SET del_flag = '1' where f_pid = #{fId}
- </delete>
- <select id="selectStorageFeeItemList" parameterType="com.ruoyi.warehouseBusiness.domain.TWarehouseBills"
- resultType="Map">
- SELECT
- ware.f_warehouseid AS warehouse,
- item.f_id AS fId,
- item.f_billno AS fBillno,
- item.f_shipper AS fShipper,
- item.f_goodsid AS fGoodsid,
- item.f_bsdate AS fBsdate,
- item.f_billingway AS fBillingway,
- item.f_chargedate AS fChargedate,
- item.f_originalbilldate AS fOriginalbilldate,
- item.f_src_bsdate AS fSrcBsdate,
- item.f_mblno AS fMblno,
- item.f_volumn AS fVolumn,
- item.f_marks AS fMarks,
- item.f_billing_days AS fBillingDays,
- item.f_is_inventory AS fIsInventory,
- item.f_qty AS fQty,
- item.f_orgwarehouse_information AS fOrgwarehouseInformation,
- item.f_grossweight AS fGrossweight,
- item.f_netweight AS fNetweight,
- item.f_billtype AS fBilltype,
- goods.f_typeid AS fTypeid,
- goods.f_name AS fGoodsids
- FROM
- t_warehousebills ware
- LEFT JOIN t_warehousebillsitems item ON item.f_pid = ware.f_id
- LEFT JOIN t_goods goods ON goods.f_id = item.f_goodsid
- LEFT JOIN t_warehouse wa ON wa.f_id = ware.f_warehouseid
- LEFT JOIN t_whgenleg leg ON leg.f_id = item.f_srcid
- <where>
- ware.f_corpid = #{warehouse.fCorpid}
- <if test="warehouse.fId != null">and item.f_id = #{warehouse.fId}</if>
- and ware.f_billtype in ('HQZY', 'SJCK', 'CKDB')
- and wa.f_charg = 1
- and item.f_storage_fee_deadline IS NULL
- and item.f_bsdate <= #{warehouse.fBillingDeadline}
- and IF(ware.f_billtype = 'SJCK', item.f_billstatus = 40, item.f_billstatus = 6)
- and IF(item.f_billingway = '7', leg.f_qtyblc = 0, leg.f_qtyblc >= 0)
- <if test="warehouse.fGoodsid != null and warehouse.fGoodsid != ''">and item.f_goodsid = #{warehouse.fGoodsid}</if>
- <if test="warehouse.fWarehouseid != null and warehouse.fWarehouseid != ''">and ware.f_warehouseid = #{warehouse.fWarehouseid}</if>
- <if test="warehouse.fMblno != null and warehouse.fMblno != ''">and item.f_mblno like concat('%',#{warehouse.fMblno},'%')</if>
- <if test="warehouse.fShipper != null and warehouse.fShipper != ''">and item.f_shipper like concat('%',#{warehouse.fShipper},'%')</if>
- </where>
- </select>
- <select id="selectStorageFeeItemList1" resultMap="StorageFeesInfoResult">
- SELECT
- ware.f_warehouseid,
- item.f_id,
- item.f_billno,
- item.f_shipper,
- item.f_goodsid,
- item.f_bsdate,
- item.f_billingway,
- item.f_chargedate,
- item.f_src_bsdate,
- item.f_originalbilldate,
- item.f_mblno,
- item.f_volumn,
- item.f_marks,
- item.f_billing_days,
- item.f_is_inventory,
- item.f_qty,
- item.f_orgwarehouse_information,
- item.f_grossweight,
- item.f_netweight,
- item.f_billtype,
- goods.f_typeid,
- goods.f_name
- FROM
- t_warehousebills ware
- LEFT JOIN t_warehousebillsitems item ON item.f_pid = ware.f_id
- LEFT JOIN t_goods goods ON goods.f_id = item.f_goodsid
- LEFT JOIN t_warehouse wa ON wa.f_id = ware.f_warehouseid
- LEFT JOIN t_whgenleg leg ON leg.f_id = item.f_srcid
- <where>
- ware.f_corpid = #{warehouse.fCorpid}
- <if test="warehouse.fId != null">and item.f_id = #{warehouse.fId}</if>
- and ware.f_billtype in ('HQZY', 'SJCK')
- and wa.f_charg = 1
- and item.f_storage_fee_deadline IS NULL
- and item.f_bsdate <= #{warehouse.fBillingDeadline}
- and IF(ware.f_billtype = 'SJCK', item.f_billstatus = 40, item.f_billstatus = 6)
- <if test="warehouse.fGoodsid != null and warehouse.fGoodsid != ''">and item.f_goodsid = #{warehouse.fGoodsid}</if>
- <if test="warehouse.fWarehouseid != null and warehouse.fWarehouseid != ''">and ware.f_warehouseid = #{warehouse.fWarehouseid}</if>
- <if test="warehouse.fTrademodeid != null and warehouse.fTrademodeid != ''">and ware.f_trademodeid = #{warehouse.fTrademodeid}</if>
- <if test="warehouse.fMblno != null and warehouse.fMblno != ''">and item.f_mblno like concat('%',#{warehouse.fMblno},'%')</if>
- <if test="warehouse.fShipper != null and warehouse.fShipper != ''">and item.f_shipper like concat('%',#{warehouse.fShipper},'%')</if>
- </where>
- </select>
- <!--and IF(item.f_billingway = '7', leg.f_qtyblc = 0, leg.f_qtyblc >= 0)-->
- <select id="warehousebillsitemsWarehouselocidSize" resultType="java.lang.Integer">
- SELECT
- COUNT( 1 )
- FROM
- t_warehousebillsitems
- WHERE
- f_warehouselocid = #{fWarehouselocid}
- </select>
- <select id="inStock" resultType="java.lang.Integer">
- SELECT
- COUNT(f_id)
- FROM
- t_warehousebillsitems
- WHERE
- f_billtype = 'SJRK'
- AND
- f_billstatus in (20,30)
- </select>
- <select id="outStock" resultType="java.lang.Integer">
- SELECT
- COUNT(f_id)
- FROM
- t_warehousebillsitems
- WHERE
- f_billtype = 'SJCK'
- AND
- f_billstatus in (20,30)
- </select>
- <select id="monthInStock" resultType="java.lang.Integer">
- SELECT
- COUNT(f_id)
- FROM
- t_warehousebillsitems
- WHERE
- f_billtype = 'SJRK'
- AND
- f_billstatus =40
- AND
- f_bsdate >= #{timeInterval[0]}
- AND
- f_bsdate <= #{timeInterval[1]}
- </select>
- <select id="monthOutStock" resultType="java.lang.Integer">
- SELECT
- COUNT(f_id)
- FROM
- t_warehousebillsitems
- WHERE
- f_billtype = 'SJCK'
- AND
- f_billstatus =40
- AND
- f_bsdate >= #{timeInterval[0]}
- AND
- f_bsdate <= #{timeInterval[1]}
- </select>
- <select id="selectWarehouseBusinesInList" resultType="java.util.Map">
- SELECT
- items.f_id AS fId,
- items.f_pid AS fPid,
- c.f_name AS fName,
- items.f_mblno AS fMblno,
- items.f_bsdate AS fBsdate,
- items.f_is_pass AS fIsPass,
- CASE
- WHEN items.f_billstatus = 20 THEN
- '待入库'
- WHEN items.f_billstatus = 30 THEN
- '入库中'
- END AS fBillstatus,
- g.f_name AS fGoodsid,
- items.f_driver_tel AS fDriverTel,
- dict.dict_label AS fBusinessType,
- items.f_marks AS fMarks,
- items.f_warehouse_information AS fWarehouseInformation,
- items.f_qty AS fQty,
- items.f_grossweight AS fGrossweight,
- items.f_netweight AS fNetweight
- FROM
- t_warehousebillsitems items
- LEFT JOIN t_warehousebills t ON items.f_pid = t.f_id
- LEFT JOIN t_corps c ON t.f_corpid = c.f_id
- LEFT JOIN t_goods g ON items.f_goodsid = g.f_id
- LEFT JOIN sys_dict_data dict ON dict.dict_type = 'storage_type'
- AND dict.dict_value = items.f_business_type
- WHERE
- items.f_billtype = 'SJRK'
- AND items.f_billstatus IN ( 20, 30 )
- <if test="timeStartBsdate != null">AND items.f_bsdate >= #{timeStartBsdate}</if>
- <if test="timeEndBsdate != null">AND items.f_bsdate <= #{timeEndBsdate}</if>
- <if test="fBillstatus != null">AND items.f_billstatus = #{fBillstatus}</if>
- <if test="fMblno != null and fMblno != '' ">AND items.f_mblno like concat('%',#{fMblno},'%') </if>
- </select>
- <select id="selectWarehouseBusinesOutList" resultType="java.util.Map">
- SELECT
- items.f_id AS fId,
- items.f_pid AS fPid,
- c.f_name AS fName,
- items.f_mblno AS fMblno,
- items.f_bsdate AS fBsdate,
- items.f_is_pass AS fIsPass,
- CASE
- WHEN items.f_billstatus = 20 THEN
- '待出库'
- WHEN items.f_billstatus = 30 THEN
- '出库中'
- END AS fBillstatus,
- g.f_name AS fGoodsid,
- items.f_driver_tel AS fDriverTel,
- dict.dict_label AS fBusinessType ,
- items.f_marks AS fMarks,
- items.f_warehouse_information AS fWarehouseInformation,
- items.f_qty AS fQty,
- items.f_grossweight AS fGrossweight,
- items.f_netweight AS fNetweight
- FROM
- t_warehousebillsitems items
- LEFT JOIN t_warehousebills t ON items.f_pid = t.f_id
- LEFT JOIN t_corps c ON t.f_corpid = c.f_id
- LEFT JOIN t_goods g ON items.f_goodsid = g.f_id
- LEFT JOIN sys_dict_data dict ON dict.dict_type = 'storage_type'
- AND dict.dict_value = items.f_business_type
- WHERE
- items.f_billtype = 'SJCK'
- AND items.f_billstatus IN ( 20, 30 )
- <if test="timeStartBsdate != null">AND items.f_bsdate >= #{timeStartBsdate}</if>
- <if test="timeEndBsdate != null">AND items.f_bsdate <= #{timeEndBsdate}</if>
- <if test="fBillstatus != null">AND items.f_billstatus = #{fBillstatus}</if>
- <if test="fMblno != null and fMblno != '' ">AND items.f_mblno like concat('%',#{fMblno},'%') </if>
- order by items.f_bsdate desc
- </select>
- <select id="selectWarehouseItemsByPId" parameterType="long" resultType="Map">
- SELECT
- t.f_id fId,
- t.f_pid fPid,
- t.f_shipper fShipper,
- t.f_bsdate fBsdate,
- corp.f_name corpName,
- t.f_mblno fMblno,
- stor.dict_label businessType,
- t.f_marks fMarks,
- t.f_labour fLabour,
- g.f_name goodsName,
- fleet.f_name fleetName,
- t.f_warehouse_information fWarehouseInformation,
- t.f_warehouselocid fWarehouselocid,
- t.f_forkliftman fForkliftman,
- t.f_truckno fTruckno,
- cntr.f_name cntrtypes,
- t.f_cntrtype fCntrtype,
- t.f_cntqty fCntqty,
- t.f_cntrno fCntrno,
- t.f_qty fQty,
- t.f_truckno fTruckno,
- t.f_driver_name fDriverName,
- t.f_originalbilldate fOriginalbilldate,
- t.f_grossweight fGrossweight,
- t.f_netweight fNetweight,
- t.f_driver_tel fDriverTel,
- t.f_stevedore fStevedore,
- CASE
- WHEN t.f_billstatus = '10' THEN '计划'
- WHEN t.f_billstatus = '20' THEN
- IF(w.f_billtype = 'SJRK', '待入库', IF(w.f_billtype = 'SJCK','待出库', IF(w.f_billtype = 'CKDB', '待调拨',IF(w.f_billtype = 'HWTG', '待通关', IF(w.f_billtype = 'HQZY', '待转移', '无')))))
- WHEN t.f_billstatus = '30' THEN
- IF(w.f_billtype = 'SJRK', '入库中', IF(w.f_billtype = 'SJCK','出库中', IF(w.f_billtype = 'CKDB', '调拨中',IF(w.f_billtype = 'HWTG', '通关中', IF(w.f_billtype = 'HQZY', '转移中', '无')))))
- WHEN t.f_billstatus = '40' THEN
- IF(w.f_billtype = 'SJRK', '已入库', IF(w.f_billtype = 'SJCK','已出库', IF(w.f_billtype = 'CKDB', '已调拨',IF(w.f_billtype = 'HWTG', '已通关', IF(w.f_billtype = 'HQZY', '已转移', '无')))))
- END billstatus,
- t.remark
- FROM
- t_warehousebills w
- LEFT JOIN t_warehousebillsitems t ON w.f_id = t.f_pid
- LEFT JOIN sys_dict_data stor ON stor.dict_value = t.f_business_type
- AND stor.dict_type = 'storage_type'
- LEFT JOIN t_goods g ON g.f_id = t.f_goodsid
- LEFT JOIN t_corps fleet ON fleet.f_id = t.f_fleet
- LEFT JOIN t_corps corp ON corp.f_id = w.f_corpid
- LEFT JOIN t_cntr cntr ON cntr.f_id = t.f_cntrtype
- where
- t.f_id = #{fId}
- </select>
- <select id="selectItemFStatusByFPid" resultType="java.lang.Integer">
- SELECT
- IFNULL( COUNT( w.f_id ), 0 )
- FROM
- t_warehousebills w
- LEFT JOIN t_warehousebillsitems i ON i.f_pid = w.f_id
- WHERE
- w.f_id = #{fId}
- AND i.f_billstatus = 40
- </select>
- <select id="selectItemQtyByFPid" resultType="com.ruoyi.warehouseBusiness.domain.TWarehousebillsitems">
- SELECT
- IFNULL( SUM( f_qty ), 0 ) fQty,
- IFNULL( SUM( f_grossweight ), 0 ) fGrossweight,
- IFNULL( SUM( f_netweight ), 0 ) fNetweight
- FROM
- t_warehousebillsitems
- WHERE
- f_pid = #{fPid}
- and del_flag = '0'
- AND f_billstatus = 40
- </select>
- <select id="selecMinBsDateByFPid" resultType="java.util.Date">
- SELECT
- MIN( f_bsdate )
- FROM
- t_warehousebillsitems
- WHERE
- f_pid = #{fId} and del_flag = '0'
- </select>
- <select id="selectItemsStatusByPid" resultMap="TWarehousebillsitemsResult" parameterType="long">
- SELECT
- f_id,
- f_billno,
- f_billstatus,
- f_itemstatus
- FROM
- t_warehousebillsitems
- WHERE
- f_pid = #{fId}
- and del_flag = '0'
- </select>
- <update id="warehouseItemFollowUpdate" parameterType="Long">
- update
- t_warehousebillsitems
- SET f_billstatus = IF
- ( f_billtype = 'SJCK' || f_billtype = 'SJRK', 40, #{fettle} )
- where
- f_pid = #{fPid}
- </update>
- <select id="getFchargedate" parameterType="Long" resultType="date">
- SELECT
- f_chargedate
- FROM
- t_warehousebillsitems
- WHERE f_chargedate IS NOT NULL
- and f_pid = #{fPid} and del_flag = '0'
- ORDER BY f_chargedate
- LIMIT 1
- </select>
- <update id="warehouseItemfChargedate" parameterType="Long">
- update
- t_warehousebillsitems
- SET f_chargedate = #{fChargedate}
- where
- f_pid = #{fPid}
- </update>
- <update id="warehouseItemfItemstatus" parameterType="Long">
- update
- t_warehousebillsitems
- SET f_itemstatus = #{fItemstatus}
- where
- f_pid = #{fPid}
- </update>
- <update id="updatefStorageFeeDeadline" parameterType="TWarehousebillsitems">
- UPDATE
- t_warehousebillsitems
- SET f_storage_fee_deadline = null
- WHERE
- f_pid = #{fPid}
- and f_id not in
- <foreach item="fId" collection="fId" open="(" separator="," close=")">
- #{fId}
- </foreach>
- </update>
- <update id="updatefStorageFeeDeadlinefPid" parameterType="TWarehousebillsitems">
- UPDATE
- t_warehousebillsitems
- SET f_storage_fee_deadline = null
- WHERE
- f_id = #{fPid}
- </update>
- <select id="selectStorageFeeItemfTruckNo" parameterType="string" resultType="Map">
- SELECT
- DISTINCT
- f_truckno AS fTruckno
- FROM
- t_warehousebillsitems
- WHERE f_truckno IS NOT NULL
- AND f_truckno != ''
- ORDER BY CONVERT(f_truckno USING gbk) asc
- </select>
- <select id="queryChangedByFchargedate" resultType="java.lang.Integer">
- SELECT
- count( f_id )
- FROM
- t_warehousebillsitems
- WHERE
- del_flag = '0'
- <foreach collection="ids" item="id" open="f_id in(" separator="," close=")">
- #{id}
- </foreach>
- and f_chargedate != #{time}
- </select>
- <select id="queryChangedByFstorageFeeDeadline" resultType="java.lang.Integer">
- SELECT
- count( f_id )
- FROM
- t_warehousebillsitems
- WHERE
- <foreach collection="ids" item="id" open="f_id in(" separator="," close=")">
- #{id}
- </foreach>
- and f_storage_fee_deadline != #{time}
- </select>
- <select id="selectIsCalculateStorageFeesByIdsOrType" resultType="java.lang.Integer">
- SELECT
- count( f_id )
- FROM
- t_warehousebillsitems
- WHERE
- <foreach collection="ids" item="id" open="f_id in(" separator="," close=")">
- #{id}
- </foreach>
- and is_calculate_storage_fees = #{type}
- </select>
- <select id="selectIsCalculateStorageFeesByIds" resultType="java.lang.Integer">
- SELECT
- count( f_id )
- FROM
- t_warehousebillsitems
- WHERE
- <foreach collection="ids" item="id" open="f_id in(" separator="," close=")">
- #{id}
- </foreach>
- and f_storage_fee_deadline IS NOT NULL
- </select>
- <select id="selectByBsDateList" resultMap="TWarehousebillsitemsResult">
- select
- *
- from
- t_warehousebillsitems
- where
- f_bsdate between #{starDate}, #{endDate}
- </select>
- <select id="selectListByCorpId" resultMap="TWarehousebillsitemsResult">
- select t.f_tocorpid, item.f_id, item.f_shipper, item.f_goodsid, item.f_mblno, item.f_originalbillno, item.f_transfer_warehouselocid,
- item.f_warehouselocid, item.f_originalbilldate, item.f_bsdate, item.f_billingway, item.f_chargedate, item.f_boxno, item.f_goodsval,
- item.f_cntqty, item.f_volumn, item.f_qty, item.f_grossweight, item.f_netweight, item.f_cntrno, item.f_marks, item.f_billtype
- from t_warehousebills t LEFT JOIN t_warehousebillsitems item ON item.f_pid = t.f_id
- where
- item.f_id IS NOT NULL
- and t.del_flag = '0' and item.del_flag = '0'
- and (t.f_corpid = #{bills.fCorpid} or t.f_tocorpid = #{bills.fCorpid})
- and item.f_bsdate BETWEEN #{bills.itemBsDateList[0]} and #{bills.itemBsDateList[1]}
- and IF(item.f_billtype = "HQZY", item.f_billstatus = 6, item.f_billstatus = 40)
- <if test="bills.fGoodsid != null and bills.fGoodsid != ''">and item.f_goodsid = #{bills.fGoodsid}</if>
- <if test="bills.fMblno != null and bills.fMblno != ''">and item.f_mblno like concat('%',#{bills.fMblno},'%')</if>
- </select>
- <select id="selectWarehouseItemsByfPid" parameterType="TWarehousebillsitems" resultMap="TWarehousebillsitemsResult">
- SELECT
- t.f_id fId,
- t.f_pid fPid,
- t.f_shipper fShipper,
- t.f_bsdate fBsdate,
- corp.f_name corpName,
- t.f_mblno fMblno,
- stor.dict_label businessType,
- t.f_marks fMarks,
- t.f_labour fLabour,
- g.f_name goodsName,
- fleet.f_name fleetName,
- t.f_warehouse_information fWarehouseInformation,
- t.f_warehouselocid fWarehouselocid,
- t.f_forkliftman fForkliftman,
- t.f_truckno fTruckno,
- cntr.f_name cntrtypes,
- t.f_cntrtype fCntrtype,
- t.f_cntqty fCntqty,
- t.f_cntrno fCntrno,
- t.f_qty fQty,
- t.f_truckno fTruckno,
- t.f_driver_name fDriverName,
- t.f_originalbilldate fOriginalbilldate,
- t.f_grossweight fGrossweight,
- t.f_netweight fNetweight,
- t.f_driver_tel fDriverTel,
- t.f_stevedore fStevedore,
- CASE
- WHEN t.f_billstatus = '10' THEN '计划'
- WHEN t.f_billstatus = '20' THEN
- IF(w.f_billtype = 'SJRK', '待入库', IF(w.f_billtype = 'SJCK','待出库', IF(w.f_billtype = 'CKDB', '待调拨',IF(w.f_billtype = 'HWTG', '待通关', IF(w.f_billtype = 'HQZY', '待转移', '无')))))
- WHEN t.f_billstatus = '30' THEN
- IF(w.f_billtype = 'SJRK', '入库中', IF(w.f_billtype = 'SJCK','出库中', IF(w.f_billtype = 'CKDB', '调拨中',IF(w.f_billtype = 'HWTG', '通关中', IF(w.f_billtype = 'HQZY', '转移中', '无')))))
- WHEN t.f_billstatus = '40' THEN
- IF(w.f_billtype = 'SJRK', '已入库', IF(w.f_billtype = 'SJCK','已出库', IF(w.f_billtype = 'CKDB', '已调拨',IF(w.f_billtype = 'HWTG', '已通关', IF(w.f_billtype = 'HQZY', '已转移', '无')))))
- END billstatus,
- t.remark
- FROM
- t_warehousebills w
- LEFT JOIN t_warehousebillsitems t ON w.f_id = t.f_pid
- LEFT JOIN sys_dict_data stor ON stor.dict_value = t.f_business_type
- AND stor.dict_type = 'storage_type'
- LEFT JOIN t_goods g ON g.f_id = t.f_goodsid
- LEFT JOIN t_corps fleet ON fleet.f_id = t.f_fleet
- LEFT JOIN t_corps corp ON corp.f_id = w.f_corpid
- LEFT JOIN t_cntr cntr ON cntr.f_id = t.f_cntrtype
- where
- t.f_pid = #{fPid}
- </select>
- <select id="selectInboundQtyByTime" resultMap="WarehouseTimeIntervalResult">
- SELECT w.f_warehouseid, sum(item.f_qty) f_qty
- FROM t_warehousebills w LEFT JOIN t_warehousebillsitems item ON item.f_pid = w.f_id
- WHERE
- item.f_billtype = #{dto.warehouseType}
- and item.f_bsdate between #{dto.timeList[0]} and #{dto.timeList[1]}
- GROUP BY w.f_warehouseid;
- </select>
- <update id="updateItemStorageFeeDeadlineByPId">
- UPDATE t_warehousebillsitems
- SET f_storage_fee_deadline = #{time}
- WHERE f_pid = #{pId}
- </update>
- <select id="inAndOutStockStatistics" resultType="map">
- select
- <if test="mode == null or mode == ''">round(ifnull(sum(ts.f_grossweight) / 1000, 0)) as total</if>
- <if test="mode != null and mode != ''">
- case #{mode}
- when '3' then round(ifnull(sum(ts.f_volumn), 0))
- when '2' then round(ifnull(sum(ts.f_grossweight) / 1000, 0))
- when '5' then round(ifnull(sum(ts.f_netweight) / 1000, 0))
- else ifnull(sum(ts.f_qty), 0)
- end as total
- </if>
- from t_warehousebillsitems ts
- left join t_warehousebills tb on ts.f_mblno = tb.f_mblno and ts.f_billno = tb.f_billno
- where
- ts.f_billstatus = '40'
- <if test="billType != null and billType != ''">and ts.f_billtype = #{billType}</if>
- <if test="beginDate != null and beginDate != ''">and ts.f_bsdate >= #{beginDate}</if>
- <if test="endDate != null and endDate != ''">and ts.f_bsdate <= #{endDate}</if>
- <if test="external != null and external != ''">
- and tb.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
- </if>
- <if test="warehouseId != null"> and tb.f_warehouseid = #{warehouseId}</if>
- <if test="customerId != null">and tb.f_corpid = #{customerId}</if>
- </select>
- <select id="inAndOutStockTeuStatistics" resultType="map">
- select
- ifnull(sum(twc.f_cntrcount * tr.f_teu), 0) as total
- from t_warehousebills_cntr twc
- left join t_warehousebills tb on twc.f_pid = tb.f_id
- left join t_cntr tr on twc.f_cntrid = tr.f_id
- where tb.f_items_status = '4'
- <if test="billType != null and billType != ''">and tb.f_billtype = #{billType}</if>
- <if test="beginDate != null and beginDate != ''">and tb.f_bsdate >= #{beginDate}</if>
- <if test="endDate != null and endDate != ''">and tb.f_bsdate <= #{endDate}</if>
- <if test="external != null and external != ''">
- and tb.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
- </if>
- <if test="warehouseId != null"> and tb.f_warehouseid = #{warehouseId}</if>
- <if test="customerId != null">and tb.f_corpid = #{customerId}</if>
- </select>
- <select id="biInAndOutStockList" resultType="map">
- select
- ifnull(tc.f_cname, tc.f_name) as customerName,
- ifnull(ifnull(ts.f_shipper, tc.f_cname), tc.f_name) as shipper,
- ts.f_warehouse_information as warehouseName,
- tg.f_name as goodsName,
- concat(ts.f_qty, '/',
- case tb.f_billingway
- when 3 then round(ts.f_netweight / 1000)
- else round(ts.f_grossweight / 1000)
- end, '/', round(ifnull(ts.f_volumn, 0))) as quantity,
- date_format(ts.f_bsdate, '%Y-%m-%d') as businessTime
- from t_warehousebillsitems ts
- left join t_warehousebills tb on ts.f_pid = tb.f_id
- left join t_corps tc on tb.f_corpid = tc.f_id
- left join t_goods tg on ts.f_goodsid = tg.f_id
- where
- ts.f_billstatus = '40'
- <if test="billType != null and billType != ''">and ts.f_billtype = #{billType}</if>
- <if test="external != null and external != ''">
- and tb.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
- </if>
- <if test="warehouseId != null"> and tb.f_warehouseid = #{warehouseId}</if>
- <if test="customerId != null">and tb.f_corpid = #{customerId}</if>
- order by ts.f_bsdate desc
- </select>
- </mapper>
|