1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275 |
- <?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.finance.mapper.TFeeMapper">
- <resultMap type="TFee" id="TFeeResult">
- <result property="fId" column="f_id"/>
- <result property="fBillno" column="f_billno"/>
- <result property="fCtrlcorpid" column="f_ctrlcorpid"/>
- <result property="fActId" column="f_act_id"/>
- <result property="fCorpid" column="f_corpid"/>
- <result property="tMblno" column="t_mblno"/>
- <result property="fTransActId" column="f_trans_act_id"/>
- <result property="fAmtdr" column="f_amtdr"/>
- <result property="fAmtcr" column="f_amtcr"/>
- <result property="fBilltype" column="f_billtype"/>
- <result property="fBillstatus" column="f_billstatus"/>
- <result property="fRemarks" column="f_remarks"/>
- <result property="fFromDate" column="f_from_date"/>
- <result property="fToDate" column="f_to_date"/>
- <result property="fAccbilldate" column="f_accbilldate"/>
- <result property="fRefNo" column="f_ref_no"/>
- <result property="delFlag" column="del_flag"/>
- <result property="createBy" column="create_by"/>
- <result property="fDeptid" column="f_deptid"/>
- <result property="createTime" column="create_time"/>
- <result property="updateBy" column="update_by"/>
- <result property="updateTime" column="update_time"/>
- <result property="chargingMethod" column="charging_method"/>
- <result property="invoiceNo" column="invoice_no"/>
- <result property="bank" column="bank"/>
- <result property="waterBillNo" column="water_bill_no"/>
- <result property="fSystemType" column="f_system_type"/>
- <result property="fTrackingNumber" column="f_tracking_number"/>
- <result property="fInvoiceRise" column="f_invoice_rise"/>
- <result property="fSign" column="f_sign"/>
- <result property="fSendTime" column="f_send_Time"/>
- <result property="fApplyMoney" column="f_apply_money"/>
- <result property="fAccountId" column="f_account_id"/>
- <result property="fMake" column="f_make"/>
- <result property="fVslid" column="f_vslid" />
- <result property="fVoyid" column="f_voyid" />
- <result property="fLoadportid" column="f_loadportid" />
- <result property="fDestportid" column="f_destportid" />
- <result property="fDc" column="f_dc" />
- <result property="fBankNumber" column="f_bank_number" />
- <result property="fReconciliation" column="f_reconciliation" />
- </resultMap>
- <sql id="selectTFeeVo">
- select f_id,
- f_billno,
- f_ctrlcorpid,
- f_act_id,
- f_corpid,
- t_mblno,
- f_trans_act_id,
- f_amtdr,
- f_amtcr,
- f_billtype,
- f_billstatus,
- f_remarks,
- f_from_date,
- f_to_date,
- f_accbilldate,
- f_ref_no,
- del_flag,
- create_by,
- f_deptid,
- create_time,
- update_by,
- update_time,
- charging_method,
- invoice_no,
- bank,
- water_bill_no,
- f_system_type,
- f_tracking_number,
- f_invoice_rise,
- f_sign,
- f_send_Time,
- f_apply_money,
- f_account_id,
- f_make,
- f_vslid,
- f_voyid,
- f_loadportid,
- f_destportid,
- f_dc,
- f_bank_number,
- f_reconciliation
- from t_fee
- </sql>
- <select id="selectTFeeList" parameterType="TFee" resultMap="TFeeResult">
- select
- ware.f_id,
- ware.f_billno,
- ware.f_ctrlcorpid,
- ware.f_act_id,
- ware.f_corpid,
- ware.t_mblno,
- ware.f_trans_act_id,
- ware.f_amtdr,
- ware.f_amtcr,
- ware.f_billtype,
- CASE
- WHEN ware.f_billstatus = '1' THEN '新建'
- WHEN ware.f_billstatus = '2' THEN '暂存'
- WHEN ware.f_billstatus = '3' THEN '审批驳回'
- WHEN ware.f_billstatus = '4' THEN '提交审核'
- WHEN ware.f_billstatus = '5' THEN '审核中'
- WHEN ware.f_billstatus = '6' THEN '审核完成'
- END
- AS f_billstatus,
- ware.f_remarks,
- ware.f_from_date,
- ware.f_to_date,
- ware.f_accbilldate,
- ware.f_ref_no,
- ware.del_flag,
- ware.create_by,
- ware.f_deptid,
- ware.create_time,
- ware.update_by,
- ware.update_time,
- pro.dict_label AS charging_method,
- ware.invoice_no,
- ware.bank,
- ware.water_bill_no,
- ware.f_system_type
- from
- t_fee ware
- left join sys_user u on ware.create_by = u.user_name
- left join sys_dept d on ware.f_deptid = d.dept_id
- LEFT JOIN sys_dict_data pro ON pro.dict_value = ware.charging_method and pro.dict_type = 'data_settlement_type'
- <where>
- <if test="fBillno != null and fBillno != ''">and ware.f_billno = #{fBillno}</if>
- <if test="fCtrlcorpid != null ">and ware.f_ctrlcorpid = #{fCtrlcorpid}</if>
- <if test="fActId != null ">and ware.f_act_id = #{fActId}</if>
- <if test="fCorpid != null ">and ware.f_corpid = #{fCorpid}</if>
- <if test="fTransActId != null ">and ware.f_trans_act_id = #{fTransActId}</if>
- <if test="tMblno != null and tMblno != ''">and t_mblno = #{tMblno}</if>
- <if test="fAmtdr != null ">and ware.f_amtdr = #{fAmtdr}</if>
- <if test="fAmtcr != null ">and ware.f_amtcr = #{fAmtcr}</if>
- <if test="fBilltype != null and fBilltype != ''">and ware.f_billtype = #{fBilltype}</if>
- <if test="fBillstatus != null and fBillstatus != ''">and ware.f_billstatus = #{fBillstatus}</if>
- <if test="fRemarks != null and fRemarks != ''">and ware.f_remarks like concat('%', #{fRemarks}, '%') </if>
- <if test="fFromDate != null ">and ware.f_from_date = #{fFromDate}</if>
- <if test="fAccbilldate != null ">and ware.f_accbilldate = #{fAccbilldate}</if>
- <if test="fToDate != null ">and ware.f_to_date = #{fToDate}</if>
- <if test="fRefNo != null and fRefNo != ''">and ware.f_ref_no = #{fRefNo}</if>
- <if test="fDeptid != null ">and ware.f_deptid = #{fDeptid}</if>
- <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and ware.f_accbilldate >= #{timeInterval[0]}
- </if>
- <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and ware.f_accbilldate <= #{timeInterval[1]}
- </if>
- <if test='amount != null and amount[0] != null and amount[0]!= ""'>
- and ware.f_amtdr >= #{amount[0]}
- </if>
- <if test='amount != null and amount[1] != null and amount[1]!= ""'>
- and ware.f_amtdr <= #{amount[1]}
- </if>
- <if test="chargingMethod != null ">and ware.charging_method = #{chargingMethod}</if>
- <if test="invoiceNo != null ">and ware.invoice_no = #{invoiceNo}</if>
- <if test="bank != null ">and ware.bank = #{bank}</if>
- <if test="waterBillNo != null ">and ware.water_bill_no = #{waterBillNo}</if>
- <if test="fSystemType != null and fSystemType != ''">and ware.f_system_type = #{fSystemType}</if>
- </where>
- ORDER BY ware.create_time desc
- ${params.dataScope}
- </select>
- <select id="selectTFeeList1" parameterType="TFee" resultType="Map">
- SELECT
- f.f_id AS fId,
- f.f_billno AS fBillno,
- f.f_ctrlcorpid AS fCtrlcorpid,
- pro.dict_label AS chargingMethod,
- f.invoice_no AS invoiceNo,
- f.bank,
- f.water_bill_no AS waterBillNo,
- f.f_corpid AS fCorpid,
- c.f_name AS fCorpidName,
- f.f_accbilldate AS fAccbilldate,
- f.t_mblno AS tMblno,
- f.f_amtdr AS fAmtdr,
- f.f_amtcr AS fAmtcr,
- f.f_billtype AS fBilltype,
- f.f_system_type AS fSystemType,
- CASE
- WHEN f.f_billstatus = '1' THEN '新建'
- WHEN f.f_billstatus = '2' THEN '暂存'
- WHEN f.f_billstatus = '3' THEN '审批驳回'
- WHEN f.f_billstatus = '4' THEN '提交审核'
- WHEN f.f_billstatus = '5' THEN '审核中'
- WHEN f.f_billstatus = '6' THEN '审核完成'
- END
- AS fBillstatus,
- f.f_remarks AS fRemarks,
- f.create_by AS createBy,
- tp.f_name AS createName,
- f.create_time createTime,
- f.update_by updateBy,
- f.update_time
- FROM
- t_fee AS f
- LEFT JOIN t_corps AS c ON f.f_corpid = c.f_id
- left join sys_user u on f.create_by = u.user_name
- left join sys_dept d on f.f_deptid = d.dept_id
- LEFT JOIN t_customer_contact tc ON tc.f_tel = u.phonenumber
- LEFT JOIN t_corps tp ON tp.f_id = tc.f_pid
- LEFT JOIN sys_dict_data pro ON pro.dict_value = f.charging_method and pro.dict_type = 'data_settlement_type'
- <where>
- <if test="fId != null ">and f.f_id = #{fId}</if>
- <if test="fBillno != null and fBillno != ''">and f.f_billno = #{fBillno}</if>
- <if test="fCtrlcorpid != null ">and f.f_ctrlcorpid = #{fCtrlcorpid}</if>
- <if test="fCorpid != null ">and f.f_corpid = #{fCorpid}</if>
- <if test="tMblno != null and tMblno != ''">and f.t_mblno = #{tMblno}</if>
- <if test="fAmtdr != null ">and f.f_amtdr = #{fAmtdr}</if>
- <if test="fAmtcr != null ">and f.f_amtcr = #{fAmtcr}</if>
- <if test="fBilltype != null and fBilltype != ''">and f.f_billtype = #{fBilltype}</if>
- <if test="fBillstatus != null and fBillstatus != ''">and f.f_billstatus = #{fBillstatus}</if>
- <if test="fRemarks != null and fRemarks != ''">and ware.f_remarks like concat('%', #{fRemarks}, '%') </if>
- <if test="fAccbilldate != null ">and f.f_accbilldate = #{fAccbilldate}</if>
- <if test="fDeptid != null ">and f.f_deptid = #{fDeptid}</if>
- <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and f.f_accbilldate >= #{timeInterval[0]}
- </if>
- <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and f.f_accbilldate <= #{timeInterval[1]}
- </if>
- <if test='money != null and money[0] != null and money[0]!= ""'>
- and f.f_amtdr >= #{money[0]}
- </if>
- <if test='money != null and money[1] != null and money[1]!= ""'>
- and f.f_amtdr <= #{money[1]}
- </if>
- <if test='amount != null and amount[0] != null and amount[0]!= ""'>
- and f.f_amtdr >= #{amount[0]}
- </if>
- <if test='amount != null and amount[1] != null and amount[1]!= ""'>
- and f.f_amtdr <= #{amount[1]}
- </if>
- <if test='applyTime != null and applyTime[0] != null and applyTime[0]!= ""'>
- and f.create_time >= #{applyTime[0]}
- </if>
- <if test='applyTime != null and applyTime[1] != null and applyTime[1]!= ""'>
- and f.create_time <= #{applyTime[1]}
- </if>
- <if test="chargingMethod != null ">and f.charging_method = #{chargingMethod}</if>
- <if test="invoiceNo != null ">and f.invoice_no = #{invoiceNo}</if>
- <if test="bank != null ">and f.bank = #{bank}</if>
- <if test="waterBillNo != null ">and f.water_bill_no = #{waterBillNo}</if>
- <if test="fSystemType != null and fSystemType != ''">and f.f_system_type = #{fSystemType}</if>
- <if test="createBy != null and createBy != ''">and f.create_by = #{createBy}</if>
- </where>
- ORDER BY f.f_id desc
- ${params.dataScope}
- </select>
- <!--凯和查询财务信息-->
- <select id="selectFinancialTFeeList" parameterType="TFee" resultType="com.ruoyi.finance.shipping.FinancialTFee">
- SELECT
- f.f_id AS fId,
- f.f_billno AS fBillno,
- f.f_ctrlcorpid AS fCtrlcorpid,
- pro.dict_label AS chargingMethod,
- f.invoice_no AS invoiceNo,
- f.bank AS fBank,
- f.water_bill_no AS waterBillNo,
- f.f_corpid AS fCorpid,
- c.f_name AS fCorpidName,
- f.f_accbilldate AS fAccbilldate,
- f.t_mblno AS tMblno,
- f.f_amtdr AS fAmtdr,
- f.f_amtcr AS fAmtcr,
- f.f_billtype AS fBilltype,
- f.f_system_type AS fSystemType,
- f.f_billstatus AS fBillstatus,
- CASE
- WHEN f.f_billstatus = '1' THEN '新建'
- WHEN f.f_billstatus = '2' THEN '暂存'
- WHEN f.f_billstatus = '3' THEN '审批驳回'
- WHEN f.f_billstatus = '4' THEN '提交审核'
- WHEN f.f_billstatus = '5' THEN '审核中'
- WHEN f.f_billstatus = '6' THEN '审核完成'
- END
- AS fBillstatusName,
- f.f_remarks AS fRemarks,
- f.create_by AS createBy,
- tp.f_name AS createName,
- f.create_time AS createTime,
- f.update_by AS updateBy,
- f.update_time AS updateTime,
- tv.f_name AS vessel,
- ty.f_no AS voyage,
- tre.f_name AS loadportName,
- ts.f_name AS destportName,
- f.f_bank_number AS fBankNumber,
- f.bank AS bank,
- CASE
- WHEN f.f_dc = 'D' THEN
- '收'
- WHEN f.f_dc = 'C' THEN
- '付'
- END AS fSrcdcName
- FROM
- t_fee AS f
- LEFT JOIN t_corps AS c ON f.f_corpid = c.f_id
- left join sys_user u on f.create_by = u.user_name
- left join sys_dept d on f.f_deptid = d.dept_id
- LEFT JOIN t_customer_contact tc ON tc.f_tel = u.phonenumber
- LEFT JOIN t_corps tp ON tp.f_id = tc.f_pid
- LEFT JOIN sys_dict_data pro ON pro.dict_value = f.charging_method and pro.dict_type = 'data_settlement_type'
- LEFT JOIN t_vessel tv ON f.f_vslid = tv.f_id
- LEFT JOIN t_voyage ty ON f.f_voyid = ty.f_id
- LEFT JOIN t_address tre ON tre.f_id = f.f_loadportid
- LEFT JOIN t_address ts ON ts.f_id = f.f_destportid
- <where>
- <if test="fId != null ">and f.f_id = #{fId}</if>
- <if test="fBillno != null and fBillno != ''">and f.f_billno like concat('%', #{fBillno}, '%')</if>
- <if test="fCtrlcorpid != null and fCtrlcorpid != ''">and f.f_ctrlcorpid = #{fCtrlcorpid}</if>
- <if test="fCorpid != null ">and f.f_corpid = #{fCorpid}</if>
- <if test="tMblno != null and tMblno != ''">and f.t_mblno like concat('%', #{tMblno}, '%')</if>
- <if test="fAmtdr != null ">and f.f_amtdr = #{fAmtdr}</if>
- <if test="fAmtcr != null ">and f.f_amtcr = #{fAmtcr}</if>
- <if test="fBilltype != null and fBilltype != ''">and f.f_billtype = #{fBilltype}</if>
- <if test="fBillstatus != null and fBillstatus != ''">and f.f_billstatus = #{fBillstatus}</if>
- <if test="fRemarks != null and fRemarks != ''">and ware.f_remarks like concat('%', #{fRemarks}, '%') </if>
- <if test="fAccbilldate != null ">and f.f_accbilldate = #{fAccbilldate}</if>
- <if test="fDeptid != null ">and f.f_deptid = #{fDeptid}</if>
- <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and f.f_accbilldate >= #{timeInterval[0]}
- </if>
- <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and f.f_accbilldate <= #{timeInterval[1]}
- </if>
- <if test='money != null and money[0] != null and money[0]!= ""'>
- and f.f_amtdr >= #{money[0]}
- </if>
- <if test='money != null and money[1] != null and money[1]!= ""'>
- and f.f_amtdr <= #{money[1]}
- </if>
- <if test='amount != null and amount[0] != null and amount[0]!= ""'>
- and f.f_amtdr >= #{amount[0]}
- </if>
- <if test='amount != null and amount[1] != null and amount[1]!= ""'>
- and f.f_amtdr <= #{amount[1]}
- </if>
- <if test='applyTime != null and applyTime[0] != null and applyTime[0]!= ""'>
- and f.create_time >= #{applyTime[0]}
- </if>
- <if test='applyTime != null and applyTime[1] != null and applyTime[1]!= ""'>
- and f.create_time <= #{applyTime[1]}
- </if>
- <if test="chargingMethod != null ">and f.charging_method = #{chargingMethod}</if>
- <if test="invoiceNo != null ">and f.invoice_no like concat('%', #{invoiceNo}, '%') </if>
- <if test="bank != null ">and f.bank like concat('%', #{bank}, '%')</if>
- <if test="waterBillNo != null ">and f.water_bill_no like concat('%', #{waterBillNo}, '%') </if>
- <if test="fSystemType != null and fSystemType != ''">and f.f_system_type = #{fSystemType}</if>
- <if test="createBy != null and createBy != ''">and f.create_by = #{createBy}</if>
- <if test="fVslid != null "> and f.f_vslid = #{fVslid}</if>
- <if test="fVoyid != null "> and f.f_voyid = #{fVoyid}</if>
- <if test="fLoadportid != null "> and f.f_loadportid = #{fLoadportid}</if>
- <if test="fDestportid != null "> and f.f_destportid = #{fDestportid}</if>
- <if test="fDc != null and fDc != ''"> and f.f_dc = #{fDc}</if>
- <if test="fBankNumber != null and fBankNumber != ''"> and f.f_bank_number like concat('%', #{fBankNumber}, '%')</if>
- <if test="fReconciliation != null "> and f.f_reconciliation = #{fReconciliation}</if>
- </where>
- ORDER BY f.f_id desc
- </select>
- <select id="selectTFeeById" parameterType="Long" resultMap="TFeeResult">
- <include refid="selectTFeeVo"/>
- where f_id = #{fId}
- </select>
- <select id="selectTFeeByIdNew" parameterType="Long" resultMap="TFeeResult">
- SELECT f.f_id,
- f.f_billno,
- f.f_ctrlcorpid,
- f.f_corpid,
- c.f_name AS fCorpidName,
- f.f_accbilldate,
- f.t_mblno,
- f.f_amtdr,
- f.f_amtcr,
- f.f_billtype,
- f.f_system_type,
- f.f_billstatus,
- f.f_remarks,
- f.create_by,
- tp.f_name AS createName,
- f.create_time,
- f.update_by,
- f.update_time,
- tn.f_taxrate AS fTaxrate,
- f.charging_method,
- f.invoice_no,
- f.bank,
- f.water_bill_no
- FROM t_fee AS f
- LEFT JOIN t_corps AS c ON f.f_corpid = c.f_id
- left join sys_user u on f.create_by = u.user_name
- left join sys_dept d on f.f_deptid = d.dept_id
- LEFT JOIN t_customer_contact tc ON tc.f_tel = u.phonenumber
- LEFT JOIN t_corps tp ON tp.f_id = tc.f_pid
- LEFT JOIN(SELECT ti.f_pid, ti.f_taxrate FROM t_fee_invoice ti LIMIT 1) tn ON tn.f_pid = f.f_id
- where f.f_id = #{fId}
- </select>
- <!--凯和确认账单查询-->
- <select id="webVersionTFee" parameterType="TFee" resultType="map">
- SELECT
- f.f_id AS fId,
- f.f_billno AS fBillno,
- f.f_ctrlcorpid AS fCtrlcorpid,
- c.f_name AS fCorpidName,
- f.f_accbilldate AS fAccbilldate,
- f.t_mblno AS tMblno,
- f.f_amtdr AS fAmtdr,
- f.f_amtcr AS fAmtcr,
- f.f_billtype AS filltype,
- f.f_remarks AS fRemarks,
- f.create_by AS createBy,
- tp.f_name AS createName,
- f.create_time AS createTime,
- f.update_by AS updateBy,
- f.update_time AS updateTime,
- tn.f_taxrate AS fTaxrate,
- f.charging_method AS chargingMethod,
- f.invoice_no AS invoiceNo,
- f.bank AS bank,
- f.water_bill_no AS waterBillNo,
- CASE
- WHEN f.f_billstatus = '1' THEN '新建'
- WHEN f.f_billstatus = '2' THEN '暂存'
- WHEN f.f_billstatus = '3' THEN '审批驳回'
- WHEN f.f_billstatus = '4' THEN '提交审核'
- WHEN f.f_billstatus = '5' THEN '审核中'
- WHEN f.f_billstatus = '6' THEN '审核完成'
- END
- AS fBillstatus
- FROM
- t_fee AS f
- LEFT JOIN t_corps AS c ON f.f_corpid = c.f_id
- left join sys_user u on f.create_by = u.user_name
- left join sys_dept d on f.f_deptid = d.dept_id
- LEFT JOIN t_customer_contact tc ON tc.f_tel = u.phonenumber
- LEFT JOIN t_corps tp ON tp.f_id = tc.f_pid
- LEFT JOIN(SELECT ti.f_pid,ti.f_taxrate FROM t_fee_invoice ti LIMIT 1) tn ON tn.f_pid = f.f_id
- <where>
- f.f_make = 0
- <if test="fId != null ">and f.f_id = #{fId}</if>
- <if test="fCorpid != null ">and f.f_corpid = #{fCorpid}</if>
- <if test="createId != null ">and tp.f_id = #{createId}</if>
- <if test="createBy != null and createBy != ''">and f.create_by = #{createBy}</if>
- <if test="fCtrlcorpid != null and fCtrlcorpid != ''">and f.f_ctrlcorpid like concat('%',
- #{fCtrlcorpid},'%')
- </if>
- <if test="fBillstatus != null and fBillstatus != ''">and f.f_billstatus = #{fBillstatus}</if>
- <if test="fBilltype != null and fBilltype != ''">and f.f_billtype = #{fBilltype}</if>
- <if test="fBillno != null and fBillno != ''">and f.f_billno = #{fBillno}</if>
- <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and f.f_accbilldate >= #{timeInterval[0]}
- </if>
- <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and f.f_accbilldate <= #{timeInterval[1]}
- </if>
- </where>
- ORDER BY f.f_id desc
- </select>
- <insert id="insertTFee" parameterType="TFee" useGeneratedKeys="true" keyProperty="fId">
- insert into t_fee
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="fId != null">f_id,</if>
- <if test="fBillno != null">f_billno,</if>
- <if test="fCtrlcorpid != null">f_ctrlcorpid,</if>
- <if test="fActId != null">f_act_id,</if>
- <if test="fCorpid != null">f_corpid,</if>
- <if test="tMblno != null">t_mblno,</if>
- <if test="fTransActId != null">f_trans_act_id,</if>
- <if test="fAmtdr != null">f_amtdr,</if>
- <if test="fAmtcr != null">f_amtcr,</if>
- <if test="fBilltype != null and fBilltype != ''">f_billtype,</if>
- <if test="fBillstatus != null and fBillstatus != ''">f_billstatus,</if>
- <if test="fRemarks != null">f_remarks,</if>
- <if test="fFromDate != null">f_from_date,</if>
- <if test="fToDate != null">f_to_date,</if>
- <if test="fAccbilldate != null">f_accbilldate,</if>
- <if test="fRefNo != null">f_ref_no,</if>
- <if test="delFlag != null">del_flag,</if>
- <if test="createBy != null">create_by,</if>
- <if test="fDeptid != null">f_deptid,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="chargingMethod != null">charging_method,</if>
- <if test="invoiceNo != null">invoice_no,</if>
- <if test="bank != null">bank,</if>
- <if test="waterBillNo != null">water_bill_no,</if>
- <if test="fSystemType != null">f_system_type,</if>
- <if test="fTrackingNumber != null">f_tracking_number,</if>
- <if test="fInvoiceRise != null">f_invoice_rise,</if>
- <if test="fSign != null">f_sign,</if>
- <if test="fSendTime != null">f_send_Time,</if>
- <if test="fApplyMoney != null">f_apply_money,</if>
- <if test="fAccountId != null">f_account_id,</if>
- <if test="fMake != null">f_make,</if>
- <if test="fVslid != null">f_vslid,</if>
- <if test="fVoyid != null">f_voyid,</if>
- <if test="fLoadportid != null">f_loadportid,</if>
- <if test="fDestportid != null">f_destportid,</if>
- <if test="fDc != null">f_dc,</if>
- <if test="fBankNumber != null">f_bank_number,</if>
- <if test="fReconciliation != null">f_reconciliation,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="fId != null">#{fId},</if>
- <if test="fBillno != null">#{fBillno},</if>
- <if test="fCtrlcorpid != null">#{fCtrlcorpid},</if>
- <if test="fActId != null">#{fActId},</if>
- <if test="fCorpid != null">#{fCorpid},</if>
- <if test="tMblno != null">#{tMblno},</if>
- <if test="fTransActId != null">#{fTransActId},</if>
- <if test="fAmtdr != null">#{fAmtdr},</if>
- <if test="fAmtcr != null">#{fAmtcr},</if>
- <if test="fBilltype != null and fBilltype != ''">#{fBilltype},</if>
- <if test="fBillstatus != null and fBillstatus != ''">#{fBillstatus},</if>
- <if test="fRemarks != null">#{fRemarks},</if>
- <if test="fFromDate != null">#{fFromDate},</if>
- <if test="fToDate != null">#{fToDate},</if>
- <if test="fAccbilldate != null">#{fAccbilldate},</if>
- <if test="fRefNo != null">#{fRefNo},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="fDeptid != null">#{fDeptid},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="chargingMethod != null">#{chargingMethod},</if>
- <if test="invoiceNo != null">#{invoiceNo},</if>
- <if test="bank != null">#{bank},</if>
- <if test="waterBillNo != null">#{waterBillNo},</if>
- <if test="fSystemType != null">#{fSystemType},</if>
- <if test="fTrackingNumber != null">#{fTrackingNumber},</if>
- <if test="fInvoiceRise != null">#{fInvoiceRise},</if>
- <if test="fSign != null">#{fSign},</if>
- <if test="fSendTime != null">#{fSendTime},</if>
- <if test="fApplyMoney != null">#{fApplyMoney},</if>
- <if test="fAccountId != null">#{fAccountId},</if>
- <if test="fMake != null">#{fMake},</if>
- <if test="fVslid != null">#{fVslid},</if>
- <if test="fVoyid != null">#{fVoyid},</if>
- <if test="fLoadportid != null">#{fLoadportid},</if>
- <if test="fDestportid != null">#{fDestportid},</if>
- <if test="fDc != null">#{fDc},</if>
- <if test="fBankNumber != null">#{fBankNumber},</if>
- <if test="fReconciliation != null">#{fReconciliation},</if>
- </trim>
- </insert>
- <update id="updateTFee" parameterType="TFee">
- update t_fee
- <trim prefix="SET" suffixOverrides=",">
- <if test="fBillno != null">f_billno = #{fBillno},</if>
- <if test="fCtrlcorpid != null">f_ctrlcorpid = #{fCtrlcorpid},</if>
- <if test="fActId != null">f_act_id = #{fActId},</if>
- <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
- <if test="tMblno != null">t_mblno = #{tMblno},</if>
- <if test="fTransActId != null">f_trans_act_id = #{fTransActId},</if>
- <if test="fAmtdr != null">f_amtdr = #{fAmtdr},</if>
- <if test="fAmtcr != null">f_amtcr = #{fAmtcr},</if>
- <if test="fBilltype != null and fBilltype != ''">f_billtype = #{fBilltype},</if>
- <if test="fBillstatus != null and fBillstatus != ''">f_billstatus = #{fBillstatus},</if>
- <if test="fRemarks != null">f_remarks = #{fRemarks},</if>
- <if test="fFromDate != null">f_from_date = #{fFromDate},</if>
- <if test="fToDate != null">f_to_date = #{fToDate},</if>
- <if test="fAccbilldate != null">f_accbilldate = #{fAccbilldate},</if>
- <if test="fRefNo != null">f_ref_no = #{fRefNo},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="fDeptid != null">f_deptid = #{fDeptid},</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="chargingMethod != null">charging_method = #{chargingMethod},</if>
- <if test="invoiceNo != null">invoice_no = #{invoiceNo},</if>
- <if test="bank != null">bank = #{bank},</if>
- <if test="waterBillNo != null">water_bill_no = #{waterBillNo},</if>
- <if test="fSystemType != null">f_system_type = #{fSystemType},</if>
- <if test="fTrackingNumber != null">f_tracking_number = #{fTrackingNumber},</if>
- <if test="fInvoiceRise != null">f_invoice_rise = #{fInvoiceRise},</if>
- <if test="fSign != null">f_sign = #{fSign},</if>
- <if test="fSendTime != null">f_send_Time = #{fSendTime},</if>
- <if test="fApplyMoney != null">f_apply_money = #{fApplyMoney},</if>
- <if test="fAccountId != null">f_account_id = #{fAccountId},</if>
- <if test="fMake != null">f_make = #{fMake},</if>
- <if test="fVslid != null">f_vslid = #{fVslid},</if>
- <if test="fVoyid != null">f_voyid = #{fVoyid},</if>
- <if test="fLoadportid != null">f_loadportid = #{fLoadportid},</if>
- <if test="fDestportid != null">f_destportid = #{fDestportid},</if>
- <if test="fDc != null">f_dc = #{fDc},</if>
- <if test="fBankNumber != null">f_bank_number = #{fBankNumber},</if>
- <if test="fReconciliation != null">f_reconciliation = #{fReconciliation},</if>
- </trim>
- where f_id = #{fId}
- </update>
- <delete id="deleteTFeeById" parameterType="Long">
- delete
- from t_fee
- where f_id = #{fId}
- </delete>
- <delete id="deleteTFeeByIds" parameterType="String">
- delete
- f.*,
- fd.* ,
- fi.*
- from
- t_fee f
- LEFT JOIN t_fee_do fd ON fd.f_pid = f.f_id
- LEFT JOIN t_fee_invoice fi ON fi.f_pid = f.f_id
- where f.f_id in
- <foreach item="fId" collection="array" open="(" separator="," close=")">
- #{fId}
- </foreach>
- </delete>
- <select id="warehouseBillsFeesList" resultType="java.util.Map">
- SELECT
- w.f_id AS fSrcid,
- t.f_id AS fSrcpid,
- t.f_corpid AS fCorpid,
- c.f_name AS fName,
- c.f_id AS fId,
- c.f_name AS fFeesName,
- t.f_bscorpno AS fBscorpno,
- w.f_mblno AS fMblno,
- w.f_product_name AS fProductName,
- w.f_bsdate AS fBsdate,
- t.f_billtype AS fBilltype,
- t.f_review_date AS fReviewDate,
- w.f_feeid AS fFeeid,
- w.src_bill_no AS srcBillNo,
- w.f_marks AS fMarks,
- w.f_chargedate AS fChargedate,
- w.f_billing_days AS fBillingDays,
- w.f_billing_deadline AS fBillingDeadline,
- w.f_inventory_days AS fInventoryDays,
- w.f_originalbilldate AS fOriginalbilldate,
- f.f_name AS fFeeName,
- w.f_dc AS fSrcdc,
- CASE
- WHEN w.f_dc = 'D' THEN
- '收'
- WHEN w.f_dc = 'C' THEN
- '付'
- END AS fSrcdcName,
- ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmtdr,
- ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmt,
- w.f_business_type AS fBusinessType
- FROM
- t_warehousebillsfees w
- LEFT JOIN t_warehousebills t ON t.f_id = w.f_pid
- LEFT JOIN t_corps c ON c.f_id = w.f_corpid
- LEFT JOIN t_fees f ON w.f_feeid = f.f_id
- <where>
- <if test="map.tWareHouseFees.fCorpid != null and map.tWareHouseFees.fCorpid != ''">and w.f_corpid =
- #{map.tWareHouseFees.fCorpid}
- </if>
- <if test="map.tWareHouseFees.fToCorpid != null and map.tWareHouseFees.fToCorpid != ''">and w.f_corpid =
- #{map.tWareHouseFees.fToCorpid}
- </if>
- <if test="map.tWareHouseFees.fTypeid != null ">and t.f_typeid = #{map.tWareHouseFees.fTypeid}</if>
- <if test="map.tWareHouseFees.fTypeid == null ">and t.f_typeid IS NULL</if>
- <if test="map.tWareHouseFees.fMblno != null and map.tWareHouseFees.fMblno != ''">and w.f_mblno like
- concat('%', #{map.tWareHouseFees.fMblno}, '%')
- </if>
- <if test="map.tWareHouseFees.fStatementNo != null and map.tWareHouseFees.fStatementNo != ''">and
- w.f_statement_no like concat('%', #{map.tWareHouseFees.fStatementNo}, '%')
- </if>
- <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "1" '>
- and w.f_accamount_date IS NOT NULL
- </if>
- <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "0" '>
- and w.f_accamount_date IS NULL
- </if>
- <if test='map.tWareHouseFees.fDc != null and map.tWareHouseFees.fDc != "" and map.tWareHouseFees.fDc == "D" '>
- and w.f_dc = #{map.tWareHouseFees.fDc}
- </if>
- <if test='map.tWareHouseFees.fDc != null and map.tWareHouseFees.fDc != "" and map.tWareHouseFees.fDc == "C" '>
- and w.f_dc = #{map.tWareHouseFees.fDc}
- </if>
- <if test="map.tWareHouseFees.fFeeid != null and map.tWareHouseFees.fFeeid != '' ">
- and w.f_feeid in
- <foreach collection="map.tWareHouseFees.fFeeid" item="id" index="index" open="(" close=")"
- separator=",">
- #{id}
- </foreach>
- </if>
- <if test='map.tWareHouseFees.timeExamine != null and map.tWareHouseFees.timeExamine[0] != null and map.tWareHouseFees.timeExamine[0]!= ""'>
- and w.f_review_date >= #{map.tWareHouseFees.timeExamine[0]}
- </if>
- <if test='map.tWareHouseFees.timeExamine != null and map.tWareHouseFees.timeExamine[1] != null and map.tWareHouseFees.timeExamine[1]!= ""'>
- and w.f_review_date <= #{map.tWareHouseFees.timeExamine[1]}
- </if>
- <if test='map.tWareHouseFees.timeInterval != null and map.tWareHouseFees.timeInterval[0] != null and map.tWareHouseFees.timeInterval[0]!= ""'>
- and w.f_bsdate >= #{map.tWareHouseFees.timeInterval[0]}
- </if>
- <if test='map.tWareHouseFees.timeInterval != null and map.tWareHouseFees.timeInterval[1] != null and map.tWareHouseFees.timeInterval[1]!= ""'>
- and w.f_bsdate <= #{map.tWareHouseFees.timeInterval[1]}
- </if>
- <if test='map.tWareHouseFees.timeReconci != null and map.tWareHouseFees.timeReconci[0] != null and map.tWareHouseFees.timeReconci[0]!= ""'>
- and w.f_accamount_date >= #{map.tWareHouseFees.timeReconci[0]}
- </if>
- <if test='map.tWareHouseFees.timeReconci != null and map.tWareHouseFees.timeReconci[1] != null and map.tWareHouseFees.timeReconci[1]!= ""'>
- and w.f_accamount_date <= #{map.tWareHouseFees.timeReconci[1]}
- </if>
- <if test="map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype == 'SJRK'">
- and w.f_billtype = #{map.tWareHouseFees.fBilltype}
- </if>
- <if test="map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype == 'SJCK'">
- and w.f_billtype = #{map.tWareHouseFees.fBilltype}
- </if>
- <if test="map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype == 'HQZY'">
- and w.f_billtype = #{map.tWareHouseFees.fBilltype}
- </if>
- <if test="map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype == 'KHDD'">
- and w.f_billtype = #{map.tWareHouseFees.fBilltype}
- </if>
- <if test="map.tWareHouseFees.fBusinessType != null and map.tWareHouseFees.fBusinessType != '' ">
- and w.f_business_type in
- <foreach collection="map.tWareHouseFees.fBusinessType" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </if>
- <if test="map.tWareHouseFees.fSrcidList != null and map.tWareHouseFees.fSrcidList != '' ">
- and w.f_id in
- <foreach collection="map.tWareHouseFees.fSrcidList" item="id" index="index" open="(" close=")"
- separator=",">
- #{id}
- </foreach>
- </if>
- <if test="map.tWareHouseFees.fSrcpidList != null and map.tWareHouseFees.fSrcpidList != '' ">
- and t.f_id in
- <foreach collection="map.tWareHouseFees.fSrcpidList" item="id" index="index" open="(" close=")"
- separator=",">
- #{id}
- </foreach>
- </if>
- <if test="map.tWareHouseFees.fBillstatus != null">and w.f_billstatus = #{map.tWareHouseFees.fBillstatus}
- </if>
- and w.f_review_date IS NOT NULL
- and abs(w.f_amount - w.f_stlamount) > 0
- GROUP BY w.f_id
- </where>
- </select>
- <select id="warehouseApplyFPFeesList" resultType="java.util.Map">
- SELECT
- w.f_id AS fSrcid,
- t.f_id AS fSrcpid,
- t.f_corpid AS fCorpid,
- c.f_name AS fName,
- w.fId AS fId,
- w.fName AS fFeesName,
- t.f_bscorpno AS fBscorpno,
- w.f_mblno AS fMblno,
- w.f_product_name AS fProductName,
- w.f_bsdate AS fBsdate,
- t.f_billtype AS fBilltype,
- t.f_review_date AS fReviewDate,
- w.f_feeid AS fFeeid,
- w.src_bill_no AS srcBillNo,
- w.f_marks AS fMarks,
- w.f_chargedate AS fChargedate,
- w.f_billing_days AS fBillingDays,
- w.f_billing_deadline AS fBillingDeadline,
- w.f_inventory_days AS fInventoryDays,
- w.f_originalbilldate AS fOriginalbilldate,
- f.f_name AS fFeeName,
- w.f_dc AS fSrcdc,
- CASE
- WHEN w.f_dc = 'D' THEN '收'
- WHEN w.f_dc = 'C' THEN '付'
- END AS fSrcdcName,
- ifnull( w.f_amount, 0 ) - ifnull( w.f_askamount, 0 ) AS fAmtdr,
- ifnull( w.f_amount, 0 ) - ifnull( w.f_askamount, 0 ) AS fAmt,
- dict.dict_label AS fFeeunitid,
- w.f_qty AS fQty,
- w.f_unitprice AS fUnitprice,
- w.f_currency AS fCurreny,
- w.f_taxrate AS fTaxrate,
- w.remark AS remark,
- tv.f_name AS boatName,
- ty.f_no AS voyageName,
- w.create_time createTime,
- w.businessName,
- t.f_loadportid AS fLoadportid,
- t.f_destportid AS fDestportid
- FROM
- t_warehousebills t
- LEFT JOIN t_corps c ON c.f_id = t.f_corpid
- LEFT JOIN (
- SELECT
- f.f_id AS f_id,
- f.f_pid AS f_pid,
- f.f_lineno AS f_lineno,
- f.f_corpid,
- f.f_feeid,
- f.f_feeUnitid,
- f.f_qty,
- f.f_unitprice,
- f.f_amount,
- f.f_currency,
- f.f_exrate,
- f.f_taxrate,
- f.f_dc,
- f.f_billstatus,
- f.f_statement_no,
- f.f_accamount,
- f.f_accamount_date,
- f.f_stlamount_no,
- f.f_stlamount,
- f.f_stlamount_date,
- f.f_invnos,
- f.f_invamount,
- f.f_askamount,
- f.f_chargedate,
- f.f_status,
- f.remark,
- f.f_mblno,
- f.f_product_name,
- f.src_bill_no,
- f.f_billing_days,
- f.f_inventory_days,
- f.f_marks,
- f.f_billing_deadline,
- f.f_originalbilldate,
- f.f_billtype,
- f.f_business_type,
- pro.dict_label businessName,
- f.f_bsdate,
- c.f_id AS fId,
- c.f_name AS fName,f.create_time
- FROM
- t_warehousebillsfees AS f
- LEFT JOIN t_corps AS c ON f.f_corpid = c.f_id
- LEFT JOIN sys_dict_data pro ON pro.dict_value = f.f_business_type
- ) w ON w.f_pid = t.f_id
- LEFT JOIN t_fees f ON w.f_feeid = f.f_id
- LEFT JOIN sys_dict_data dict ON dict.dict_value = w.f_feeUnitid
- LEFT JOIN t_vessel tv ON tv.f_id = t.f_vslid
- LEFT JOIN t_voyage ty ON ty.f_id = t.f_voyid
- <where>
- dict.status = '0'
- AND dict.dict_type = 'data_unitfees'
- <if test="map.tWareHouseFees.fCorpid != null and map.tWareHouseFees.fCorpid != ''">and t.f_corpid =
- #{map.tWareHouseFees.fCorpid}
- </if>
- <if test="map.tWareHouseFees.fToCorpid != null and map.tWareHouseFees.fToCorpid != ''">and w.f_corpid =
- #{map.tWareHouseFees.fToCorpid}
- </if>
- <if test="map.tWareHouseFees.fTypeid != null ">and t.f_typeid = #{map.tWareHouseFees.fTypeid}</if>
- <if test="map.tWareHouseFees.fLoadportid != null ">and t.f_loadportid = #{map.tWareHouseFees.fLoadportid}
- </if>
- <if test="map.tWareHouseFees.fDestportid != null ">and t.f_destportid = #{map.tWareHouseFees.fDestportid}
- </if>
- <if test="map.tWareHouseFees.fTypeid == null ">and t.f_typeid IS NULL</if>
- <if test="map.tWareHouseFees.fMblno != null and map.tWareHouseFees.fMblno != ''">and w.f_mblno like
- concat('%', #{map.tWareHouseFees.fMblno}, '%')
- </if>
- <if test="map.tWareHouseFees.fStatementNo != null and map.tWareHouseFees.fStatementNo != ''">and
- w.f_statement_no like concat('%', #{map.tWareHouseFees.fStatementNo}, '%')
- </if>
- <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "1" '>
- and w.f_accamount_date IS NOT NULL
- </if>
- <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "0" '>
- and w.f_accamount_date IS NULL
- </if>
- <if test='map.tWareHouseFees.fDc != null and map.tWareHouseFees.fDc != "" and map.tWareHouseFees.fDc == "D" '>
- and w.f_dc = #{map.tWareHouseFees.fDc}
- </if>
- <if test='map.tWareHouseFees.fDc != null and map.tWareHouseFees.fDc != "" and map.tWareHouseFees.fDc == "C" '>
- and w.f_dc = #{map.tWareHouseFees.fDc}
- </if>
- <if test="map.tWareHouseFees.fFeeid != null and map.tWareHouseFees.fFeeid != '' ">
- and w.f_feeid in
- <foreach collection="map.tWareHouseFees.fFeeid" item="id" index="index" open="(" close=")"
- separator=",">
- #{id}
- </foreach>
- </if>
- <if test='map.tWareHouseFees.timeExamine != null and map.tWareHouseFees.timeExamine[0] != null and map.tWareHouseFees.timeExamine[0]!= ""'>
- and t.f_review_date >= #{map.tWareHouseFees.timeExamine[0]}
- </if>
- <if test='map.tWareHouseFees.timeExamine != null and map.tWareHouseFees.timeExamine[1] != null and map.tWareHouseFees.timeExamine[1]!= ""'>
- and t.f_review_date <= #{map.tWareHouseFees.timeExamine[1]}
- </if>
- <if test='map.tWareHouseFees.createTimeList != null and map.tWareHouseFees.createTimeList[0] != null and map.tWareHouseFees.createTimeList[0]!= ""'>
- and w.create_time >= #{map.tWareHouseFees.createTimeList[0]}
- </if>
- <if test='map.tWareHouseFees.createTimeList != null and map.tWareHouseFees.createTimeList[1] != null and map.tWareHouseFees.createTimeList[1]!= ""'>
- and w.create_time <= #{map.tWareHouseFees.createTimeList[1]}
- </if>
- <if test='map.tWareHouseFees.timeInterval != null and map.tWareHouseFees.timeInterval[0] != null and map.tWareHouseFees.timeInterval[0]!= ""'>
- and t.f_bsdate >= #{map.tWareHouseFees.timeInterval[0]}
- </if>
- <if test='map.tWareHouseFees.timeInterval != null and map.tWareHouseFees.timeInterval[1] != null and map.tWareHouseFees.timeInterval[1]!= ""'>
- and t.f_bsdate <= #{map.tWareHouseFees.timeInterval[1]}
- </if>
- <if test='map.tWareHouseFees.timeReconci != null and map.tWareHouseFees.timeReconci[0] != null and map.tWareHouseFees.timeReconci[0]!= ""'>
- and w.f_accamount_date >= #{map.tWareHouseFees.timeReconci[0]}
- </if>
- <if test='map.tWareHouseFees.timeReconci != null and map.tWareHouseFees.timeReconci[1] != null and map.tWareHouseFees.timeReconci[1]!= ""'>
- and w.f_accamount_date <= #{map.tWareHouseFees.timeReconci[1]}
- </if>
- <if test="map.tWareHouseFees.fBusinessType != null and map.tWareHouseFees.fBusinessType != '' ">
- and w.f_business_type in
- <foreach collection="map.tWareHouseFees.fBusinessType" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </if>
- <if test="map.tWareHouseFees.fSrcidList != null and map.tWareHouseFees.fSrcidList != '' ">
- and w.f_id in
- <foreach collection="map.tWareHouseFees.fSrcidList" item="id" index="index" open="(" close=")"
- separator=",">
- #{id}
- </foreach>
- </if>
- <if test="map.tWareHouseFees.fSrcpidList != null and map.tWareHouseFees.fSrcpidList != '' ">
- and t.f_id in
- <foreach collection="map.tWareHouseFees.fSrcpidList" item="id" index="index" open="(" close=")"
- separator=",">
- #{id}
- </foreach>
- </if>
- <if test="map.tWareHouseFees.fVslid != null">and tv.f_vslid = #{map.tWareHouseFees.fVslid}</if>
- <if test="map.tWareHouseFees.fVoyid != null">and ty.f_voyid = #{map.tWareHouseFees.fVoyid}</if>
- <if test="map.tWareHouseFees.boatName != null and map.tWareHouseFees.boatName != ''">and tv.f_name =
- #{map.tWareHouseFees.boatName}
- </if>
- <if test="map.tWareHouseFees.voyageName != null and map.tWareHouseFees.voyageName != ''">and ty.f_no like
- concat('%', #{map.tWareHouseFees.voyageName}, '%')
- </if>
- <if test="map.tWareHouseFees.fName != null and map.tWareHouseFees.fName != ''">and c.f_name like
- concat('%', #{map.tWareHouseFees.fName}, '%')
- </if>
- <if test="map.tWareHouseFees.fBillstatus != null">and w.f_billstatus = #{map.tWareHouseFees.fBillstatus}
- </if>
- and t.f_review_date IS NOT NULL
- and ifnull(w.f_amount, 0) - ifnull(w.f_askamount, 0) > 0
- GROUP BY w.f_id
- </where>
- </select>
- <select id="warehouseInvoiceFPFeesList" resultType="java.util.Map">
- SELECT
- w.f_id AS fSrcid,
- t.f_id AS fSrcpid,
- t.f_corpid AS fCorpid,
- c.f_name AS fName,
- w.fId AS fId,
- w.fName AS fFeesName,
- t.f_bscorpno AS fBscorpno,
- w.f_mblno AS fMblno,
- w.f_product_name AS fProductName,
- w.f_bsdate AS fBsdate,
- t.f_billtype AS fBilltype,
- t.f_review_date AS fReviewDate,
- w.f_feeid AS fFeeid,
- w.src_bill_no AS srcBillNo,
- w.f_marks AS fMarks,
- w.f_chargedate AS fChargedate,
- w.f_billing_days AS fBillingDays,
- w.f_billing_deadline AS fBillingDeadline,
- w.f_inventory_days AS fInventoryDays,
- w.f_originalbilldate AS fOriginalbilldate,
- f.f_name AS fFeeName,
- w.f_dc AS fSrcdc,
- CASE
- WHEN w.f_dc = 'D' THEN '收'
- WHEN w.f_dc = 'C' THEN '付'
- END AS fSrcdcName,
- ifnull( w.f_amount, 0 ) - ifnull( w.f_invamount, 0 ) AS fAmtdr,
- ifnull( w.f_amount, 0 ) - ifnull( w.f_invamount, 0 ) AS fAmt,
- dict.dict_label AS fFeeunitid,
- w.f_qty AS fQty,
- w.f_unitprice AS fUnitprice,
- w.f_currency AS fCurreny,
- w.f_taxrate AS fTaxrate,
- w.remark AS remark,
- tv.f_name AS boatName,
- ty.f_no AS voyageName,
- w.create_time createTime,
- w.businessName
- FROM
- t_warehousebills t
- LEFT JOIN t_corps c ON c.f_id = t.f_corpid
- LEFT JOIN (
- SELECT
- f.f_id AS f_id,
- f.f_pid AS f_pid,
- f.f_lineno AS f_lineno,
- f.f_corpid,
- f.f_feeid,
- f.f_feeUnitid,
- f.f_qty,
- f.f_unitprice,
- f.f_amount,
- f.f_currency,
- f.f_exrate,
- f.f_taxrate,
- f.f_dc,
- f.f_billstatus,
- f.f_statement_no,
- f.f_accamount,
- f.f_accamount_date,
- f.f_stlamount_no,
- f.f_stlamount,
- f.f_stlamount_date,
- f.f_invnos,
- f.f_invamount,
- f.f_askamount,
- f.f_chargedate,
- f.f_status,
- f.remark,
- f.f_mblno,
- f.f_product_name,
- f.src_bill_no,
- f.f_billing_days,
- f.f_inventory_days,
- f.f_marks,
- f.f_billing_deadline,
- f.f_originalbilldate,
- f.f_billtype,
- f.f_business_type,
- pro.dict_label businessName,
- f.f_bsdate,
- c.f_id AS fId,
- c.f_name AS fName,f.create_time
- FROM
- t_warehousebillsfees AS f
- LEFT JOIN t_corps AS c ON f.f_corpid = c.f_id
- LEFT JOIN sys_dict_data pro ON pro.dict_value = f.f_business_type
- ) w ON w.f_pid = t.f_id
- LEFT JOIN t_fees f ON w.f_feeid = f.f_id
- LEFT JOIN sys_dict_data dict ON dict.dict_value = w.f_feeUnitid
- LEFT JOIN t_vessel tv ON tv.f_id = t.f_vslid
- LEFT JOIN t_voyage ty ON ty.f_id = t.f_voyid
- <where>
- dict.status = '0'
- AND dict.dict_type = 'data_unitfees'
- <if test="map.tWareHouseFees.fCorpid != null and map.tWareHouseFees.fCorpid != ''">and t.f_corpid =
- #{map.tWareHouseFees.fCorpid}
- </if>
- <if test="map.tWareHouseFees.fToCorpid != null and map.tWareHouseFees.fToCorpid != ''">and w.f_corpid =
- #{map.tWareHouseFees.fToCorpid}
- </if>
- <if test="map.tWareHouseFees.fTypeid != null ">and t.f_typeid = #{map.tWareHouseFees.fTypeid}</if>
- <if test="map.tWareHouseFees.fTypeid == null ">and t.f_typeid IS NULL</if>
- <if test="map.tWareHouseFees.fMblno != null and map.tWareHouseFees.fMblno != ''">and w.f_mblno like
- concat('%', #{map.tWareHouseFees.fMblno}, '%')
- </if>
- <if test="map.tWareHouseFees.fStatementNo != null and map.tWareHouseFees.fStatementNo != ''">and
- w.f_statement_no like concat('%', #{map.tWareHouseFees.fStatementNo}, '%')
- </if>
- <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "1" '>
- and w.f_accamount_date IS NOT NULL
- </if>
- <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "0" '>
- and w.f_accamount_date IS NULL
- </if>
- <if test='map.tWareHouseFees.fDc != null and map.tWareHouseFees.fDc != "" and map.tWareHouseFees.fDc == "D" '>
- and w.f_dc = #{map.tWareHouseFees.fDc}
- </if>
- <if test='map.tWareHouseFees.fDc != null and map.tWareHouseFees.fDc != "" and map.tWareHouseFees.fDc == "C" '>
- and w.f_dc = #{map.tWareHouseFees.fDc}
- </if>
- <if test="map.tWareHouseFees.fFeeid != null and map.tWareHouseFees.fFeeid != '' ">
- and w.f_feeid in
- <foreach collection="map.tWareHouseFees.fFeeid" item="id" index="index" open="(" close=")"
- separator=",">
- #{id}
- </foreach>
- </if>
- <if test='map.tWareHouseFees.timeExamine != null and map.tWareHouseFees.timeExamine[0] != null and map.tWareHouseFees.timeExamine[0]!= ""'>
- and t.f_review_date >= #{map.tWareHouseFees.timeExamine[0]}
- </if>
- <if test='map.tWareHouseFees.timeExamine != null and map.tWareHouseFees.timeExamine[1] != null and map.tWareHouseFees.timeExamine[1]!= ""'>
- and t.f_review_date <= #{map.tWareHouseFees.timeExamine[1]}
- </if>
- <if test='map.tWareHouseFees.createTimeList != null and map.tWareHouseFees.createTimeList[0] != null and map.tWareHouseFees.createTimeList[0]!= ""'>
- and w.create_time >= #{map.tWareHouseFees.createTimeList[0]}
- </if>
- <if test='map.tWareHouseFees.createTimeList != null and map.tWareHouseFees.createTimeList[1] != null and map.tWareHouseFees.createTimeList[1]!= ""'>
- and w.create_time <= #{map.tWareHouseFees.createTimeList[1]}
- </if>
- <if test='map.tWareHouseFees.timeInterval != null and map.tWareHouseFees.timeInterval[0] != null and map.tWareHouseFees.timeInterval[0]!= ""'>
- and t.f_bsdate >= #{map.tWareHouseFees.timeInterval[0]}
- </if>
- <if test='map.tWareHouseFees.timeInterval != null and map.tWareHouseFees.timeInterval[1] != null and map.tWareHouseFees.timeInterval[1]!= ""'>
- and t.f_bsdate <= #{map.tWareHouseFees.timeInterval[1]}
- </if>
- <if test='map.tWareHouseFees.timeReconci != null and map.tWareHouseFees.timeReconci[0] != null and map.tWareHouseFees.timeReconci[0]!= ""'>
- and w.f_accamount_date >= #{map.tWareHouseFees.timeReconci[0]}
- </if>
- <if test='map.tWareHouseFees.timeReconci != null and map.tWareHouseFees.timeReconci[1] != null and map.tWareHouseFees.timeReconci[1]!= ""'>
- and w.f_accamount_date <= #{map.tWareHouseFees.timeReconci[1]}
- </if>
- <if test="map.tWareHouseFees.fBusinessType != null and map.tWareHouseFees.fBusinessType != '' ">
- and w.f_business_type in
- <foreach collection="map.tWareHouseFees.fBusinessType" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </if>
- <if test="map.tWareHouseFees.fSrcidList != null and map.tWareHouseFees.fSrcidList != '' ">
- and w.f_id in
- <foreach collection="map.tWareHouseFees.fSrcidList" item="id" index="index" open="(" close=")"
- separator=",">
- #{id}
- </foreach>
- </if>
- <if test="map.tWareHouseFees.fSrcpidList != null and map.tWareHouseFees.fSrcpidList != '' ">
- and t.f_id in
- <foreach collection="map.tWareHouseFees.fSrcpidList" item="id" index="index" open="(" close=")"
- separator=",">
- #{id}
- </foreach>
- </if>
- <if test="map.tWareHouseFees.fVslid != null">and tv.f_vslid = #{map.tWareHouseFees.fVslid}</if>
- <if test="map.tWareHouseFees.fVoyid != null">and ty.f_voyid = #{map.tWareHouseFees.fVoyid}</if>
- <if test="map.tWareHouseFees.boatName != null and map.tWareHouseFees.boatName != ''">and tv.f_name =
- #{map.tWareHouseFees.boatName}
- </if>
- <if test="map.tWareHouseFees.voyageName != null and map.tWareHouseFees.voyageName != ''">and ty.f_no =
- #{map.tWareHouseFees.voyageName}
- </if>
- <if test="map.tWareHouseFees.fName != null and map.tWareHouseFees.fName != ''">and c.f_name = like
- concat('%', #{map.tWareHouseFees.fName}, '%')
- </if>
- <if test="map.tWareHouseFees.fBillstatus != null">and w.f_billstatus = #{map.tWareHouseFees.fBillstatus}
- </if>
- and t.f_review_date IS NOT NULL
- and ifnull(w.f_amount, 0) - ifnull(w.f_invamount, 0) > 0
- GROUP BY w.f_id
- </where>
- </select>
- <select id="warehouseBillsFeesListAccamount" resultType="java.util.Map">
- SELECT
- w.f_id AS fSrcid,
- t.f_id AS fSrcpid,
- t.f_corpid AS fCorpid,
- c.f_name AS fName,
- c.f_name AS fFeesName,
- t.f_bscorpno AS fBscorpno,
- w.f_mblno AS fMblno,
- w.f_product_name AS fProductName,
- w.f_bsdate AS fBsdate,
- t.f_billtype AS fBilltype,
- t.f_review_date AS fReviewDate,
- w.f_marks AS fMarks,
- w.f_feeid AS fFeeid,
- w.f_billtype AS fBilltype,
- w.f_chargedate AS fChargedate,
- w.f_originalbilldate AS fOriginalbilldate,
- w.f_billing_deadline AS fBillingDeadline,
- w.f_billing_days AS fBillingDays,
- w.f_inventory_days AS fInventoryDays,
- f.f_name AS fFeeName,
- w.f_dc AS fSrcdc,
- CASE
- WHEN w.f_dc = 'D' THEN
- '收'
- WHEN w.f_dc = 'C' THEN
- '付'
- END AS fSrcdcName,
- ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmtdr,
- ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmt,
- dict.dict_label AS fFeeunitid,
- w.f_qty AS fQty,
- w.f_unitprice AS fUnitprice,
- w.f_business_type AS fBusinessType
- FROM
- t_warehousebillsfees w
- LEFT JOIN t_warehousebills t ON t.f_id = w.f_pid
- LEFT JOIN t_corps c ON c.f_id = w.f_corpid
- LEFT JOIN t_fees f ON w.f_feeid = f.f_id
- LEFT JOIN sys_dict_data dict ON dict.dict_value = w.f_feeUnitid
- <where>
- dict.status = '0'
- AND dict.dict_type = 'data_unitfees'
- <if test="map.tWareHouseFees.fCorpid != null and map.tWareHouseFees.fCorpid != ''">and w.f_corpid =
- #{map.tWareHouseFees.fCorpid}
- </if>
- <if test="map.tWareHouseFees.fTypeid != null ">and t.f_typeid = #{map.tWareHouseFees.fTypeid}</if>
- <if test="map.tWareHouseFees.fTypeid == null ">and t.f_typeid IS NULL</if>
- <if test="map.tWareHouseFees.fToCorpid != null and map.tWareHouseFees.fToCorpid != ''">and w.f_corpid =
- #{map.tWareHouseFees.fToCorpid}
- </if>
- <if test="map.tWareHouseFees.fMblno != null and map.tWareHouseFees.fMblno != ''">and w.f_mblno like
- concat('%', #{map.tWareHouseFees.fMblno}, '%')
- </if>
- <if test="map.tWareHouseFees.fStatementNo != null and map.tWareHouseFees.fStatementNo != ''">and
- w.f_statement_no like concat('%', #{map.tWareHouseFees.fStatementNo}, '%')
- </if>
- <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "1" '>
- and w.f_accamount_date IS NOT NULL
- </if>
- <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "0" '>
- and w.f_accamount_date IS NULL
- </if>
- <if test='map.tWareHouseFees.fDc != null and map.tWareHouseFees.fDc != "" and map.tWareHouseFees.fDc == "D" '>
- and w.f_dc = #{map.tWareHouseFees.fDc}
- </if>
- <if test='map.tWareHouseFees.fDc != null and map.tWareHouseFees.fDc != "" and map.tWareHouseFees.fDc == "C" '>
- and w.f_dc = #{map.tWareHouseFees.fDc}
- </if>
- <if test="map.tWareHouseFees.fFeeid != null and map.tWareHouseFees.fFeeid != '' ">
- and w.f_feeid in
- <foreach collection="map.tWareHouseFees.fFeeid" item="id" index="index" open="(" close=")"
- separator=",">
- #{id}
- </foreach>
- </if>
- <if test='map.tWareHouseFees.timeExamine != null and map.tWareHouseFees.timeExamine[0] != null and map.tWareHouseFees.timeExamine[0]!= ""'>
- and w.f_review_date >= #{map.tWareHouseFees.timeExamine[0]}
- </if>
- <if test='map.tWareHouseFees.timeExamine != null and map.tWareHouseFees.timeExamine[1] != null and map.tWareHouseFees.timeExamine[1]!= ""'>
- and w.f_review_date <= #{map.tWareHouseFees.timeExamine[1]}
- </if>
- <if test='map.tWareHouseFees.timeInterval != null and map.tWareHouseFees.timeInterval[0] != null and map.tWareHouseFees.timeInterval[0]!= ""'>
- and w.f_bsdate >= #{map.tWareHouseFees.timeInterval[0]}
- </if>
- <if test='map.tWareHouseFees.timeInterval != null and map.tWareHouseFees.timeInterval[1] != null and map.tWareHouseFees.timeInterval[1]!= ""'>
- and w.f_bsdate <= #{map.tWareHouseFees.timeInterval[1]}
- </if>
- <if test='map.tWareHouseFees.timeReconci != null and map.tWareHouseFees.timeReconci[0] != null and map.tWareHouseFees.timeReconci[0]!= ""'>
- and w.f_accamount_date >= #{map.tWareHouseFees.timeReconci[0]}
- </if>
- <if test='map.tWareHouseFees.timeReconci != null and map.tWareHouseFees.timeReconci[1] != null and map.tWareHouseFees.timeReconci[1]!= ""'>
- and w.f_accamount_date <= #{map.tWareHouseFees.timeReconci[1]}
- </if>
- <if test="map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype == 'SJRK'">
- and w.f_billtype = #{map.tWareHouseFees.fBilltype}
- </if>
- <if test="map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype == 'SJCK'">
- and w.f_billtype = #{map.tWareHouseFees.fBilltype}
- </if>
- <if test="map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype == 'HQZY'">
- and w.f_billtype = #{map.tWareHouseFees.fBilltype}
- </if>
- <if test="map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype == 'KHDD'">
- and w.f_billtype = #{map.tWareHouseFees.fBilltype}
- </if>
- <if test="map.tWareHouseFees.fBusinessType != null and map.tWareHouseFees.fBusinessType != '' ">
- and w.f_business_type in
- <foreach collection="map.tWareHouseFees.fBusinessType" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </if>
- <if test="map.tWareHouseFees.fSrcidList != null and map.tWareHouseFees.fSrcidList != '' ">
- and w.f_id in
- <foreach collection="map.tWareHouseFees.fSrcidList" item="id" index="index" open="(" close=")"
- separator=",">
- #{id}
- </foreach>
- </if>
- <if test="map.tWareHouseFees.fSrcpidList != null and map.tWareHouseFees.fSrcpidList != '' ">
- and t.f_id in
- <foreach collection="map.tWareHouseFees.fSrcpidList" item="id" index="index" open="(" close=")"
- separator=",">
- #{id}
- </foreach>
- </if>
- <if test="map.tWareHouseFees.fBillstatus != null">and w.f_billstatus = #{map.tWareHouseFees.fBillstatus}
- </if>
- <if test='map.tWareHouseFees.createBy != null and map.tWareHouseFees.createBy != ""'>
- and w.create_by = #{map.tWareHouseFees.createBy}
- </if>
- and w.f_review_date IS NOT NULL
- and abs(w.f_amount - w.f_accamount) > 0
- GROUP BY w.f_id
- </where>
- </select>
- <!--
- <select id="warehouseBillsFeesListAccamount" resultType="java.util.Map">
- SELECT
- w.f_id AS fSrcid,
- t.f_id AS fSrcpid,
- t.f_corpid AS fCorpid,
- c.f_name AS fName,
- w.fName AS fFeesName,
- t.f_bscorpno AS fBscorpno,
- w.f_mblno AS fMblno,
- w.f_product_name AS fProductName,
- w.f_bsdate AS fBsdate,
- t.f_billtype AS fBilltype,
- t.f_review_date AS fReviewDate,
- w.f_marks AS fMarks,
- w.f_feeid AS fFeeid,
- w.f_billtype AS fBilltype,
- w.f_chargedate AS fChargedate,
- w.f_originalbilldate AS fOriginalbilldate,
- w.f_billing_deadline AS fBillingDeadline,
- w.f_billing_days AS fBillingDays,
- w.f_inventory_days AS fInventoryDays,
- f.f_name AS fFeeName,
- w.f_dc AS fSrcdc,
- CASE
- WHEN w.f_dc = 'D' THEN '收'
- WHEN w.f_dc = 'C' THEN '付'
- END AS fSrcdcName,
- ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmtdr,
- ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmt,
- dict.dict_label AS fFeeunitid,
- w.f_qty AS fQty ,
- w.f_unitprice AS fUnitprice ,
- dictIn.dict_label AS fBusinessType
- FROM
- t_warehousebills t
- LEFT JOIN t_corps c ON c.f_id = t.f_corpid
- LEFT JOIN (
- SELECT
- f.f_id AS f_id,
- f.f_pid AS f_pid,
- f.f_lineno AS f_lineno,
- f.f_corpid,
- f.f_feeid,
- f.f_feeUnitid,
- f.f_qty,
- f.f_unitprice,
- f.f_amount,
- f.f_currency,
- f.f_exrate,
- f.f_taxrate,
- f.f_dc,
- f.f_billstatus,
- f.f_statement_no,
- f.f_accamount,
- f.f_accamount_date,
- f.f_stlamount_no,
- f.f_stlamount,
- f.f_stlamount_date,
- f.f_invnos,
- f.f_invamount,
- f.f_askamount,
- f.f_status,
- f.remark,
- f.f_inventory_days,
- f.f_billing_days,
- f.f_billing_deadline,
- f.f_originalbilldate,
- f.f_mblno,
- f.f_product_name,
- f.f_chargedate,
- f.src_bill_no,
- f.f_billtype,
- f.f_marks,
- f.f_business_type,
- f.f_bsdate,
- c.f_id AS fId,
- c.f_name AS fName
- FROM
- t_warehousebillsfees AS f
- LEFT JOIN t_corps AS c ON f.f_corpid = c.f_id
- ) w ON w.f_pid = t.f_id
- LEFT JOIN t_fees f ON w.f_feeid = f.f_id
- LEFT JOIN sys_dict_data dict ON dict.dict_value = w.f_feeUnitid
- LEFT JOIN sys_dict_data dictIn ON dictIn.dict_value = w.f_business_type
- <where>
- dict.status = '0'
- AND dict.dict_type = 'data_unitfees'
- <if test="map.tWareHouseFees.fCorpid != null and map.tWareHouseFees.fCorpid != ''">and t.f_corpid =
- #{map.tWareHouseFees.fCorpid}
- </if>
- <if test="map.tWareHouseFees.fTypeid != null ">and t.f_typeid = #{map.tWareHouseFees.fTypeid}</if>
- <if test="map.tWareHouseFees.fTypeid == null ">and t.f_typeid IS NULL</if>
- <if test="map.tWareHouseFees.fToCorpid != null and map.tWareHouseFees.fToCorpid != ''">and w.f_corpid =
- #{map.tWareHouseFees.fToCorpid}
- </if>
- <if test="map.tWareHouseFees.fMblno != null and map.tWareHouseFees.fMblno != ''">and w.f_mblno like
- concat('%', #{map.tWareHouseFees.fMblno}, '%')
- </if>
- <if test="map.tWareHouseFees.fStatementNo != null and map.tWareHouseFees.fStatementNo != ''">and
- w.f_statement_no like concat('%', #{map.tWareHouseFees.fStatementNo}, '%')
- </if>
- <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "1" '>
- and w.f_accamount_date IS NOT NULL
- </if>
- <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "0" '>
- and w.f_accamount_date IS NULL
- </if>
- <if test='map.tWareHouseFees.fDc != null and map.tWareHouseFees.fDc != "" and map.tWareHouseFees.fDc == "D" '>
- and w.f_dc = #{map.tWareHouseFees.fDc}
- </if>
- <if test='map.tWareHouseFees.fDc != null and map.tWareHouseFees.fDc != "" and map.tWareHouseFees.fDc == "C" '>
- and w.f_dc = #{map.tWareHouseFees.fDc}
- </if>
- <if test="map.tWareHouseFees.fFeeid != null and map.tWareHouseFees.fFeeid != '' ">
- and w.f_feeid in
- <foreach collection="map.tWareHouseFees.fFeeid" item="id" index="index" open="(" close=")"
- separator=",">
- #{id}
- </foreach>
- </if>
- <if test='map.tWareHouseFees.timeExamine != null and map.tWareHouseFees.timeExamine[0] != null and map.tWareHouseFees.timeExamine[0]!= ""'>
- and t.f_review_date >= #{map.tWareHouseFees.timeExamine[0]}
- </if>
- <if test='map.tWareHouseFees.timeExamine != null and map.tWareHouseFees.timeExamine[1] != null and map.tWareHouseFees.timeExamine[1]!= ""'>
- and t.f_review_date <= #{map.tWareHouseFees.timeExamine[1]}
- </if>
- <if test='map.tWareHouseFees.timeInterval != null and map.tWareHouseFees.timeInterval[0] != null and map.tWareHouseFees.timeInterval[0]!= ""'>
- and t.f_bsdate >= #{map.tWareHouseFees.timeInterval[0]}
- </if>
- <if test='map.tWareHouseFees.timeInterval != null and map.tWareHouseFees.timeInterval[1] != null and map.tWareHouseFees.timeInterval[1]!= ""'>
- and t.f_bsdate <= #{map.tWareHouseFees.timeInterval[1]}
- </if>
- <if test='map.tWareHouseFees.timeReconci != null and map.tWareHouseFees.timeReconci[0] != null and map.tWareHouseFees.timeReconci[0]!= ""'>
- and w.f_accamount_date >= #{map.tWareHouseFees.timeReconci[0]}
- </if>
- <if test='map.tWareHouseFees.timeReconci != null and map.tWareHouseFees.timeReconci[1] != null and map.tWareHouseFees.timeReconci[1]!= ""'>
- and w.f_accamount_date <= #{map.tWareHouseFees.timeReconci[1]}
- </if>
- <if test="map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype == 'SJRK'">
- and w.f_billtype = #{map.tWareHouseFees.fBilltype}
- AND dictIn.dict_type = 'st_in_type'
- AND dictIn.status = '0'
- </if>
- <if test="map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype == 'SJCK'">
- and w.f_billtype = #{map.tWareHouseFees.fBilltype}
- AND dictIn.dict_type = 'st_out_type'
- AND dictIn.status = '0'
- </if>
- <if test="map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype == 'HQZY'">
- and w.f_billtype = #{map.tWareHouseFees.fBilltype}
- AND dictIn.dict_type = 'st_trans_type'
- AND dictIn.status = '0'
- </if>
- <if test="map.tWareHouseFees.fBilltype == null ">
- AND dictIn.dict_type in ('st_in_type','st_out_type','st_trans_type')
- AND dictIn.status = '0'
- </if>
- <if test="map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype == 'KHDD'">
- and w.f_billtype = #{map.tWareHouseFees.fBilltype}
- </if>
- <if test="map.tWareHouseFees.fBusinessType != null and map.tWareHouseFees.fBusinessType != '' ">
- and w.f_business_type in
- <foreach collection="map.tWareHouseFees.fBusinessType" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </if>
- <if test="map.tWareHouseFees.fSrcidList != null and map.tWareHouseFees.fSrcidList != '' ">
- and w.f_id in
- <foreach collection="map.tWareHouseFees.fSrcidList" item="id" index="index" open="(" close=")"
- separator=",">
- #{id}
- </foreach>
- </if>
- <if test="map.tWareHouseFees.fSrcpidList != null and map.tWareHouseFees.fSrcpidList != '' ">
- and t.f_id in
- <foreach collection="map.tWareHouseFees.fSrcpidList" item="id" index="index" open="(" close=")"
- separator=",">
- #{id}
- </foreach>
- </if>
- <if test="map.tWareHouseFees.fBillstatus != null">and w.f_billstatus = #{map.tWareHouseFees.fBillstatus}
- </if>
- <if test='map.tWareHouseFees.createBy != null and map.tWareHouseFees.createBy != ""'>
- and t.create_by = #{map.tWareHouseFees.createBy}
- </if>
- and t.f_review_date IS NOT NULL
- and ifnull(w.f_amount, 0) - ifnull(w.f_accamount, 0) > 0
- GROUP BY w.f_id
- </where>
- </select>
- -->
- <select id="warehouseBillsKHFeesListAccamount" resultType="java.util.Map">
- SELECT
- w.f_id AS fSrcid,
- t.f_id AS fSrcpid,
- t.f_corpid AS fCorpid,
- t.f_billno fBillno,
- c.f_name AS fName,
- w.fName AS fFeesName,
- t.f_bscorpno AS fBscorpno,
- w.f_mblno AS fMblno,
- w.f_product_name AS fProductName,
- w.f_bsdate AS fBsdate,
- t.f_billtype AS tfBilltype,
- t.f_review_date AS fReviewDate,
- w.f_marks AS fMarks,
- w.f_feeid AS fFeeid,
- w.f_billtype AS wfBilltype,
- w.f_chargedate AS fChargedate,
- w.f_originalbilldate AS fOriginalbilldate,
- w.f_billing_deadline AS fBillingDeadline,
- w.f_billing_days AS fBillingDays,
- w.f_inventory_days AS fInventoryDays,
- f.f_name AS fFeeName,
- w.f_dc AS fSrcdc,
- CASE
- WHEN w.f_dc = 'D' THEN '收'
- WHEN w.f_dc = 'C' THEN '付'
- END AS fSrcdcName,
- ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmtdr,
- ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmt,
- dict.dict_label AS fFeeunitid,
- w.f_qty AS fQty,
- w.f_unitprice AS fUnitprice,
- w.f_currency AS fCurreny,
- w.f_taxrate AS fTaxrate,
- w.remark AS remark,
- tv.f_name AS boatName,
- ty.f_no AS voyageName,
- w.create_time createTime,
- w.businessName
- FROM
- t_warehousebills t
- LEFT JOIN t_corps c ON c.f_id = t.f_corpid
- LEFT JOIN (
- SELECT
- f.f_id AS f_id,
- f.f_pid AS f_pid,
- f.f_lineno AS f_lineno,
- f.f_corpid,
- f.f_feeid,
- f.f_feeUnitid,
- f.f_qty,
- f.f_unitprice,
- f.f_amount,
- f.f_currency,
- f.f_exrate,
- f.f_taxrate,
- f.f_dc,
- f.f_billstatus,
- f.f_statement_no,
- f.f_accamount,
- f.f_accamount_date,
- f.f_stlamount_no,
- f.f_stlamount,
- f.f_stlamount_date,
- f.f_invnos,
- f.f_invamount,
- f.f_askamount,
- f.f_status,
- f.remark,
- f.f_inventory_days,
- f.f_billing_days,
- f.f_billing_deadline,
- f.f_originalbilldate,
- f.f_mblno,
- f.f_product_name,
- f.f_chargedate,
- f.src_bill_no,
- f.f_billtype,
- f.f_marks,
- f.f_business_type,
- pro.dict_label businessName,
- f.f_bsdate,
- c.f_id AS fId,
- c.f_name AS fName,
- f.create_time
- FROM
- t_warehousebillsfees AS f
- LEFT JOIN t_corps AS c ON f.f_corpid = c.f_id
- LEFT JOIN sys_dict_data pro ON pro.dict_value = f.f_business_type and pro.dict_type = 'data_billType'
- ) w ON w.f_pid = t.f_id
- LEFT JOIN t_fees f ON w.f_feeid = f.f_id
- LEFT JOIN sys_dict_data dict ON dict.dict_value = w.f_feeUnitid
- LEFT JOIN t_vessel tv ON tv.f_id = t.f_vslid
- LEFT JOIN t_voyage ty ON ty.f_id = t.f_voyid
- <where>
- dict.status = '0'
- AND dict.dict_type = 'data_unitfees'
- <if test="map.tWareHouseFees.fCorpid != null and map.tWareHouseFees.fCorpid != ''">and t.f_corpid =
- #{map.tWareHouseFees.fToCorpid}
- </if>
- <if test="map.tWareHouseFees.fTypeid != null ">and t.f_typeid = #{map.tWareHouseFees.fTypeid}</if>
- <if test="map.tWareHouseFees.fTypeid == null ">and t.f_typeid IS NULL</if>
- <if test="map.tWareHouseFees.fToCorpid != null and map.tWareHouseFees.fToCorpid != ''">and w.f_corpid =
- #{map.tWareHouseFees.fCorpid}
- </if>
- <if test="map.tWareHouseFees.fMblno != null and map.tWareHouseFees.fMblno != ''">and w.f_mblno like
- concat('%', #{map.tWareHouseFees.fMblno}, '%')
- </if>
- <if test="map.tWareHouseFees.fStatementNo != null and map.tWareHouseFees.fStatementNo != ''">and
- w.f_statement_no like concat('%', #{map.tWareHouseFees.fStatementNo}, '%')
- </if>
- <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "1" '>
- and w.f_accamount_date IS NOT NULL
- </if>
- <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "0" '>
- and w.f_accamount_date IS NULL
- </if>
- <if test='map.tWareHouseFees.fDc != null and map.tWareHouseFees.fDc != "" and map.tWareHouseFees.fDc == "D" '>
- and w.f_dc = #{map.tWareHouseFees.fDc}
- </if>
- <if test='map.tWareHouseFees.fDc != null and map.tWareHouseFees.fDc != "" and map.tWareHouseFees.fDc == "C" '>
- and w.f_dc = #{map.tWareHouseFees.fDc}
- </if>
- <if test="map.tWareHouseFees.fFeeid != null and map.tWareHouseFees.fFeeid != '' ">
- and w.f_feeid in
- <foreach collection="map.tWareHouseFees.fFeeid" item="id" index="index" open="(" close=")"
- separator=",">
- #{id}
- </foreach>
- </if>
- <if test='map.tWareHouseFees.timeExamine != null and map.tWareHouseFees.timeExamine[0] != null and map.tWareHouseFees.timeExamine[0]!= ""'>
- and t.f_review_date >= #{map.tWareHouseFees.timeExamine[0]}
- </if>
- <if test='map.tWareHouseFees.timeExamine != null and map.tWareHouseFees.timeExamine[1] != null and map.tWareHouseFees.timeExamine[1]!= ""'>
- and t.f_review_date <= #{map.tWareHouseFees.timeExamine[1]}
- </if>
- <if test='map.tWareHouseFees.createTimeList != null and map.tWareHouseFees.createTimeList[0] != null and map.tWareHouseFees.createTimeList[0]!= ""'>
- and w.create_time >= #{map.tWareHouseFees.createTimeList[0]}
- </if>
- <if test='map.tWareHouseFees.createTimeList != null and map.tWareHouseFees.createTimeList[1] != null and map.tWareHouseFees.createTimeList[1]!= ""'>
- and w.create_time <= #{map.tWareHouseFees.createTimeList[1]}
- </if>
- <if test='map.tWareHouseFees.timeInterval != null and map.tWareHouseFees.timeInterval[0] != null and map.tWareHouseFees.timeInterval[0]!= ""'>
- and t.f_bsdate >= #{map.tWareHouseFees.timeInterval[0]}
- </if>
- <if test='map.tWareHouseFees.timeInterval != null and map.tWareHouseFees.timeInterval[1] != null and map.tWareHouseFees.timeInterval[1]!= ""'>
- and t.f_bsdate <= #{map.tWareHouseFees.timeInterval[1]}
- </if>
- <if test='map.tWareHouseFees.timeReconci != null and map.tWareHouseFees.timeReconci[0] != null and map.tWareHouseFees.timeReconci[0]!= ""'>
- and w.f_accamount_date >= #{map.tWareHouseFees.timeReconci[0]}
- </if>
- <if test='map.tWareHouseFees.timeReconci != null and map.tWareHouseFees.timeReconci[1] != null and map.tWareHouseFees.timeReconci[1]!= ""'>
- and w.f_accamount_date <= #{map.tWareHouseFees.timeReconci[1]}
- </if>
- <if test="map.tWareHouseFees.fBusinessType != null and map.tWareHouseFees.fBusinessType != '' ">
- and w.f_business_type in
- <foreach collection="map.tWareHouseFees.fBusinessType" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </if>
- <if test="map.tWareHouseFees.fVslid != null">and tv.f_vslid = #{map.tWareHouseFees.fVslid}</if>
- <if test="map.tWareHouseFees.fVoyid != null">and ty.f_voyid = #{map.tWareHouseFees.fVoyid}</if>
- <if test="map.tWareHouseFees.boatName != null and map.tWareHouseFees.boatName != ''">and tv.f_name =
- #{map.tWareHouseFees.boatName}
- </if>
- <if test="map.tWareHouseFees.voyageName != null and map.tWareHouseFees.voyageName != ''">and ty.f_no =
- #{map.tWareHouseFees.voyageName}
- </if>
- <if test="map.tWareHouseFees.fBillstatus != null">and w.f_billstatus = #{map.tWareHouseFees.fBillstatus}
- </if>
- and t.f_review_date IS NOT NULL
- and ifnull(w.f_amount, 0) - ifnull(w.f_accamount, 0) > 0
- GROUP BY w.f_id
- </where>
- </select>
- <select id="warehouseBillsFeesList1" resultType="java.util.Map">
- SELECT
- w.f_id AS fSrcid,
- t.f_id AS fSrcpid,
- t.f_corpid AS fCorpid,
- c.f_name AS fName,
- w.f_corpid AS fCorpids,
- c1.f_name AS fFeesName,
- w.f_mblno AS fMblno,
- w.f_product_name AS fProductName,
- w.f_marks AS fMarks,
- t.f_billtype AS fBilltype,
- t.f_review_date AS fReviewDate,
- w.f_dc AS fSrcdc,
- SUM(w.f_amount) AS fAmount,
- SUM(w.f_stlamount) AS fStlamount,
- ifnull(SUM( w.f_amount ) , 0 ) - ifnull( SUM( w.f_stlamount ) , 0 ) AS nnfinished
- FROM
- t_warehousebills t
- left join sys_user u on t.create_by = u.user_name
- left join sys_dept d on t.f_bsdeptid = d.dept_id
- LEFT JOIN t_corps c ON c.f_id = t.f_corpid
- LEFT JOIN t_warehousebillsfees w ON w.f_pid = t.f_id
- LEFT JOIN t_corps c1 ON w.f_corpid = c1.f_id
- LEFT JOIN t_fees f ON w.f_feeid = f.f_id
- <where>
- <if test="fCorpid != null and fCorpid != ''">and t.f_corpid = #{fCorpid}</if>
- <if test="fToCorpid != null and fToCorpid != ''">and w.f_corpid = #{fToCorpid}</if>
- <if test="fMblno != null and fMblno != ''">and w.f_mblno like concat('%', #{fMblno}, '%')</if>
- <if test="fMarks != null and fMarks != ''">and w.f_marks like concat('%', #{fMarks}, '%')</if>
- <if test="fProductName != null and fProductName != ''">and w.f_product_name like concat('%',
- #{fProductName}, '%')
- </if>
- <if test='fBillstatus != null and fBillstatus != "" and fBillstatus == "0" '>
- and w.f_billstatus != 6
- </if>
- <if test='fBillstatus != null and fBillstatus != "" and fBillstatus == "1" '>
- and w.f_billstatus = 6
- </if>
- <if test='fDc != null and fDc != "" and fDc == "D" '>
- and w.f_dc = #{fDc}
- </if>
- <if test='fDc != null and fDc != "" and fDc == "C" '>
- and w.f_dc = #{fDc}
- </if>
- <if test='timeExamine != null and timeExamine[0] != null and timeExamine[0]!= ""'>
- and t.f_review_date >= #{timeExamine[0]}
- </if>
- <if test='timeExamine != null and timeExamine[1] != null and timeExamine[1]!= ""'>
- and t.f_review_date <= #{timeExamine[1]}
- </if>
- <if test='fReconciliation!= null and fReconciliation != "" and fReconciliation == "0" '>
- and ifnull(w.f_amount, 0) - ifnull(w.f_stlamount, 0) != 0
- </if>
- and t.f_review_date IS NOT NULL
- ${params.dataScope}
- GROUP BY
- w.f_pid,
- w.f_dc,
- w.f_corpid
- </where>
- </select>
- <select id="selectTWarehousebillsItemsList"
- resultType="com.ruoyi.warehouseBusiness.excel.TWareHouseExcelItem">
- SELECT (@ii := @ii + 1) AS fId,
- wi.f_mblno AS fMblno,
- wi.f_bsdate AS fBsdate,
- f.f_name AS fFeeid,
- CASE
- WHEN w.f_srcdc = 'D' THEN
- '收'
- WHEN w.f_srcdc = 'C' THEN
- '付'
- END AS fSrcdc,
- w.f_amtdr AS fAmtdr,
- dict.dict_label AS fFeeunitid,
- wi.f_qty AS fBillingQty,
- wi.f_unitprice AS fUnitprice,
- w.f_amt AS fAmt,
- wi.f_business_type AS fBusinessType,
- CASE
- wi.f_billtype
- WHEN 'SJRK' THEN
- '入库'
- WHEN 'SJCK' THEN
- '出库'
- WHEN 'HQZY' THEN
- '货转'
- WHEN 'CKDB' THEN
- '调拨'
- WHEN 'HWTG' THEN
- '货物通关'
- WHEN 'KCZZ' THEN
- '库存总账'
- END AS fBilltype,
- wi.f_product_name AS fGoodsid,
- wi.f_marks AS fMarks,
- wi.f_chargedate AS fChargedate,
- wi.f_billing_deadline AS fBillingDeadline,
- wi.f_inventory_days AS fInventoryDays,
- wi.f_billing_days AS fBillingDays,
- w.f_remarks AS fRemarks
- FROM t_fee_do w
- LEFT JOIN t_warehousebillsfees wi ON w.f_srcid = wi.f_id
- LEFT JOIN t_fees f ON wi.f_feeid = f.f_id
- LEFT JOIN sys_dict_data dict ON dict.dict_value = wi.f_feeUnitid
- , (
- SELECT @ii := 0
- ) AS ii
- WHERE dict.status = '0'
- AND dict.dict_type = 'data_unitfees'
- AND w.f_pid = #{fId}
- </select>
- <select id="warehouseBillsFeesProfitList" resultType="java.util.Map">
- SELECT
- t.f_id AS fSrcpid,
- c.f_name AS fName,
- c1.f_name AS fFeesName,
- w.f_mblno AS fMblno,
- w.f_product_name AS fProductName,
- w.f_marks AS fMarks,
- t.f_billtype AS fBilltype,
- w.f_review_date AS fReviewDate,
- sum( CASE f_dc WHEN 'D' THEN f_amount ELSE 0 END ) fAmount,
- sum( CASE f_dc WHEN 'C' THEN f_amount ELSE 0 END ) fStlamount,
- sum( CASE f_dc WHEN 'D' THEN f_amount ELSE 0 END ) - sum( CASE f_dc WHEN 'C' THEN f_amount ELSE 0 END )
- nnfinished
- FROM
- t_warehousebillsfees w
- LEFT JOIN t_warehousebills t ON t.f_id = w.f_pid
- left join sys_user u on t.create_by = u.user_name
- left join sys_dept d on t.f_bsdeptid = d.dept_id
- LEFT JOIN t_corps c ON c.f_id = t.f_corpid
- LEFT JOIN t_corps c1 ON c1.f_id = w.f_corpid
- <where>
- <if test="fCorpid != null and fCorpid != ''">and t.f_corpid = #{fCorpid}</if>
- <if test="fToCorpid != null and fToCorpid != ''">and w.f_corpid = #{fToCorpid}</if>
- <if test="fMblno != null and fMblno != ''">and w.f_mblno like concat('%', #{fMblno}, '%')</if>
- <if test="fMarks != null and fMarks != ''">and w.f_marks like concat('%', #{fMarks}, '%')</if>
- <if test="fProductName != null and fProductName != ''">and w.f_product_name like concat('%',
- #{fProductName}, '%')
- </if>
- <if test='fBillstatus != null and fBillstatus != "" and fBillstatus == "0" '>
- and w.f_billstatus != 6
- </if>
- <if test='fBillstatus != null and fBillstatus != "" and fBillstatus == "1" '>
- and w.f_billstatus = 6
- </if>
- <if test='timeExamine != null and timeExamine[0] != null and timeExamine[0]!= ""'>
- and w.f_review_date >= #{timeExamine[0]}
- </if>
- <if test='timeExamine != null and timeExamine[1] != null and timeExamine[1]!= ""'>
- and w.f_review_date <= #{timeExamine[1]}
- </if>
- <if test='fReconciliation!= null and fReconciliation != "" and fReconciliation == "0" '>
- and ifnull(w.f_amount, 0) - ifnull(w.f_stlamount, 0) != 0
- </if>
- <if test="fBusinessType != null and fBusinessType != '' ">
- and w.f_business_type in
- <foreach collection="fBusinessType" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </if>
- <if test="fFeeid != null and fFeeid != '' ">
- and w.f_feeid in
- <foreach collection="fFeeid" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </if>
- and w.f_review_date IS NOT NULL
- ${params.dataScope}
- GROUP BY
- w.f_mblno
- </where>
- </select>
- <select id="selectFeeList" resultType="java.util.Map">
- select
- ware.create_by AS createBy,
- ware.f_billno AS fBillno,
- ware.f_ctrlcorpid AS fCtrlcorpid,
- ware.create_time AS createTime,
- ware.f_accbilldate AS fAccbilldate,
- ware.t_mblno AS tMblno,
- dict.dict_label AS chargingMethod,
- ware.invoice_no AS invoiceNo,
- ware.bank AS bank,
- ware.water_bill_no AS waterBillNo,
- ware.f_amtdr AS fAmtdr,
- ware.f_amtcr AS fAmtcr,
- ware.f_remarks AS fRemarks,
- CASE
- WHEN ware.f_billstatus = '1' THEN '新建'
- WHEN ware.f_billstatus = '2' THEN '暂存'
- WHEN ware.f_billstatus = '3' THEN '审批驳回'
- WHEN ware.f_billstatus = '4' THEN '提交审核'
- WHEN ware.f_billstatus = '5' THEN '审核中'
- WHEN ware.f_billstatus = '6' THEN '审核完成'
- END
- AS fBillstatus
- from
- t_fee ware
- left join sys_user u on ware.create_by = u.user_name
- left join sys_dept d on ware.f_deptid = d.dept_id
- LEFT JOIN sys_dict_data dict ON dict.dict_value = ware.charging_method
- <where>
- dict.status = '0'
- AND dict.dict_type = 'data_settlement_type'
- <if test="fBillno != null and fBillno != ''">and ware.f_billno = #{fBillno}</if>
- <if test="fCtrlcorpid != null ">and ware.f_ctrlcorpid = #{fCtrlcorpid}</if>
- <if test="fActId != null ">and ware.f_act_id = #{fActId}</if>
- <if test="fCorpid != null ">and ware.f_corpid = #{fCorpid}</if>
- <if test="fTransActId != null ">and ware.f_trans_act_id = #{fTransActId}</if>
- <if test="tMblno != null and tMblno != ''">and ware.t_mblno = #{tMblno}</if>
- <if test="fAmtdr != null ">and ware.f_amtdr = #{fAmtdr}</if>
- <if test="fAmtcr != null ">and ware.f_amtcr = #{fAmtcr}</if>
- <if test="fBilltype != null and fBilltype != ''">and ware.f_billtype = #{fBilltype}</if>
- <if test="fBillstatus != null and fBillstatus != ''">and ware.f_billstatus = #{fBillstatus}</if>
- <if test="fRemarks != null and fRemarks != ''">and ware.f_remarks = #{fRemarks}</if>
- <if test="fFromDate != null ">and ware.f_from_date = #{fFromDate}</if>
- <if test="fAccbilldate != null ">and ware.f_accbilldate = #{fAccbilldate}</if>
- <if test="fToDate != null ">and ware.f_to_date = #{fToDate}</if>
- <if test="fRefNo != null and fRefNo != ''">and ware.f_ref_no = #{fRefNo}</if>
- <if test="fDeptid != null ">and ware.f_deptid = #{fDeptid}</if>
- <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and ware.f_accbilldate >= #{timeInterval[0]}
- </if>
- <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and ware.f_accbilldate <= #{timeInterval[1]}
- </if>
- <if test="chargingMethod != null ">and ware.charging_method = #{chargingMethod}</if>
- <if test="invoiceNo != null ">and ware.invoice_no = #{invoiceNo}</if>
- <if test="bank != null ">and ware.bank = #{bank}</if>
- <if test="waterBillNo != null ">and ware.water_bill_no = #{waterBillNo}</if>
- </where>
- ${params.dataScope}
- </select>
- <select id="selectDetailedList" resultType="com.ruoyi.finance.excel.Detailed">
- SELECT (@ii := @ii + 1) AS fId,
- wi.f_mblno AS fMblno,
- wi.f_bsdate AS fBsdate,
- t.f_bscorpno AS fBscorpno,
- f.f_name AS fFeeid,
- CASE
- WHEN w.f_srcdc = 'D' THEN
- '收'
- WHEN w.f_srcdc = 'C' THEN
- '付'
- END AS fSrcdc,
- w.f_amtdr AS fAmtdr,
- dict.dict_label AS fFeeunitid,
- wi.f_qty AS fBillingQty,
- wi.f_unitprice AS fUnitprice,
- w.f_amt AS fAmt,
- wi.f_business_type AS fBusinessType,
- CASE
- wi.f_billtype
- WHEN 'SJRK' THEN
- '入库'
- WHEN 'SJCK' THEN
- '出库'
- WHEN 'HQZY' THEN
- '货转'
- WHEN 'CKDB' THEN
- '调拨'
- WHEN 'HWTG' THEN
- '货物通关'
- WHEN 'KCZZ' THEN
- '库存总账'
- END AS fBilltype,
- wi.f_product_name AS fGoodsid,
- wi.f_marks AS fMarks,
- w.f_remarks AS fRemarks
- FROM t_fee_do w
- LEFT JOIN t_warehousebillsfees wi ON w.f_srcid = wi.f_id
- LEFT JOIN t_warehousebills t ON wi.f_pid = t.f_id
- LEFT JOIN t_fees f ON wi.f_feeid = f.f_id
- LEFT JOIN sys_dict_data dict ON dict.dict_value = wi.f_feeUnitid
- , (
- SELECT @ii := 0
- ) AS ii
- WHERE dict.status = '0'
- AND dict.dict_type = 'data_unitfees'
- AND w.f_pid = #{fId}
- </select>
- <select id="selectDetailedList1" resultType="java.util.Map">
- SELECT t.f_id AS fSrcpid,
- t.f_corpid AS fCorpid,
- c.f_name AS fName,
- c1.f_name AS fFeesName,
- w.f_mblno AS fMblno,
- w.f_product_name AS fProductName,
- w.f_marks AS fMarks,
- w.f_dc AS fSrcdc,
- w.f_amount AS fAmount,
- w.f_stlamount AS fStlamount,
- ifnull(w.f_amount, 0) - ifnull(w.f_stlamount, 0) AS nnfinished
- FROM t_warehousebills t
- LEFT JOIN sys_user u ON t.create_by = u.user_name
- LEFT JOIN sys_dept d ON t.f_bsdeptid = d.dept_id
- LEFT JOIN t_corps c ON c.f_id = t.f_corpid
- LEFT JOIN t_warehousebillsfees w ON w.f_pid = t.f_id
- LEFT JOIN t_corps c1 ON w.f_corpid = c1.f_id
- LEFT JOIN t_fees f ON w.f_feeid = f.f_id
- WHERE w.f_dc = #{fSrcdc}
- AND t.f_review_date IS NOT NULL
- AND w.f_corpid = #{fCorpIds}
- AND t.f_corpid = #{fCorpId}
- AND w.f_mblno = #{fMblno}
- </select>
- <!--网页版发票申请查询-->
- <select id="webVersionInvoice" parameterType="TFee" resultType="java.util.Map">
- SELECT
- tf.f_id AS fId,/**费用主表id*/
- tf.f_billno AS fBillno,/**费用申请编号*/
- tf.f_ctrlcorpid AS fCtrlcorpid,/**货权方*/
- tf.f_corpid AS fCorpid,/**结算单位*/
- tc.f_name AS fCorpidName,/**结算单位中文名称*/
- tf.t_mblno AS tMblno,/**提单号*/
- tf.f_amtdr AS fAmtdr,/**应收合计*/
- tf.f_amtcr AS fAmtcr,/**应付合计*/
- tf.f_billtype AS fBilltype,/**业务类型*/
- tf.f_billstatus AS fBillstatus,/**状态*/
- CASE
- WHEN tf.f_billstatus = '1' THEN
- '新建'
- WHEN tf.f_billstatus = '2' THEN
- '暂存'
- WHEN tf.f_billstatus = '3' THEN
- '驳回'
- WHEN tf.f_billstatus = '4' THEN
- '提交'
- WHEN tf.f_billstatus = '5' THEN
- '审批中'
- WHEN tf.f_billstatus = '6' THEN
- '审批通过'
- END AS fBillstatusName,
- tf.f_remarks AS fRemarks,/**备注*/
- tf.f_accbilldate AS fAccbilldate,/**结算日期*/
- tf.create_by AS createBy,/**创建人*/
- tf.create_time AS createTime,/**创建时间*/
- tf.update_by AS updateBy,/**更新人*/
- tf.update_time AS updateTime,/**更新时间*/
- tf.invoice_no AS invoiceNo,/**发票号*/
- tf.bank AS bank,/**银行*/
- tf.water_bill_no AS waterBillNo,/**水单号*/
- tf.f_system_type AS fSystemType,/**系统类型*/
- tf.f_tracking_number AS fTrackingNumber,/**快递单号*/
- tf.f_invoice_rise AS fInvoiceRise,/**发票抬头*/
- tf.f_sign AS fSign,/**是否签收*/
- tf.f_send_Time AS fSendTime,/**寄送时间*/
- tf.charging_method AS chargingMethod,/**收费方式*/
- pro.dict_label AS chargingMethodName /**收费方式中文名称*/
- FROM
- t_fee tf
- LEFT JOIN t_corps tc ON tf.f_corpid = tc.f_id
- LEFT JOIN sys_dict_data pro ON pro.dict_value = tf.charging_method
- AND pro.dict_type = 'data_settlement_type'
- WHERE tf.f_billtype = 'ApplyFP'
- <if test="createBy != null and createBy != ''">and tf.create_by = #{createBy}</if>
- <if test='timeInterval != null and timeInterval[0] != null and timeInterval[0]!= ""'>
- and tf.create_time >= #{timeInterval[0]}
- </if>
- <if test='timeInterval != null and timeInterval[1] != null and timeInterval[1]!= ""'>
- and tf.create_time <= #{timeInterval[1]}
- </if>
- <if test="invoiceNo != null and invoiceNo != ''">and tf.invoice_no like concat('%', #{invoiceNo}, '%')</if>
- <if test="fInvoiceRise != null and fInvoiceRise != ''">and tf.f_invoice_rise like concat('%', #{fInvoiceRise},
- '%')
- </if>
- <if test="fBillno != null and fBillno != ''">and tf.f_billno like concat('%', #{fBillno}, '%')</if>
- <if test="fBillstatus != null and fBillstatus != '' and fBillstatus != 'null' ">and tf.f_billstatus = #{fBillstatus}</if>
- ORDER BY tf.f_id desc
- </select>
- <!--凯和检索费用信息-->
- <select id="FinancialFeesList" resultType="java.util.Map">
- SELECT
- w.f_id AS fSrcid,
- t.f_id AS fSrcpid,
- w.f_corpid AS fCorpid,
- w.fName AS fName,
- w.f_mblno AS fMblno,
- w.f_bsdate AS fBsdate,
- t.f_billtype AS fBilltype,
- t.f_review_date AS fReviewDate,
- w.f_feeid AS fFeeid,
- w.src_bill_no AS srcBillNo,
- w.f_marks AS fMarks,
- f.f_name AS fFeeName,
- w.f_dc AS fSrcdc,
- w.f_qty AS fQty,
- w.f_unitprice AS fUnitPrice,
- w.f_amount AS fAmount,
- w.f_feeUnitid AS fFeeUnitId,
- pr.dict_label AS fFeeUnitName,
- t.f_vslid AS fVslid,
- t.f_voyid AS fVoyid,
- tv.f_name AS fvslName,
- ty.f_no AS fvoyName,
- tre.f_name AS fLoadPortName,
- ts.f_name As fDestPortName,
- w.f_billstatus AS fBillStatus,
- t.f_loadportid AS fLoadportid,
- t.f_destportid AS fDestportid,
- tn.f_name AS cntrName,
- ti.f_cntrcount AS fCntrCount,
- <if test='map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype != "" and map.tWareHouseFees.fBilltype == "KHDZ" '>
- ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmtdr,
- ifnull( w.f_amount, 0 ) - ifnull( w.f_accamount, 0 ) AS fAmt,
- </if>
- <if test='map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype != "" and map.tWareHouseFees.fBilltype == "KHSF" '>
- ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmtdr,
- ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmt,
- </if>
- <if test='map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype != "" and map.tWareHouseFees.fBilltype == "KHFF" '>
- ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmtdr,
- ifnull( w.f_amount, 0 ) - ifnull( w.f_stlamount, 0 ) AS fAmt,
- </if>
- CASE
- WHEN w.f_dc = 'D' THEN '收'
- WHEN w.f_dc = 'C' THEN '付'
- END AS fSrcdcName,
- CASE
- WHEN w.f_billstatus = '1' THEN '新建'
- WHEN w.f_billstatus = '2' THEN '暂存'
- WHEN w.f_billstatus = '3' THEN '驳回'
- WHEN w.f_billstatus = '4' THEN '提交'
- WHEN w.f_billstatus = '5' THEN '审批中'
- WHEN w.f_billstatus = '6' THEN '通过'
- END AS fBillStatusName
- FROM
- t_warehousebills t
- LEFT JOIN (
- SELECT
- f.f_id AS f_id,
- f.f_pid AS f_pid,
- f.f_lineno AS f_lineno,
- f.f_corpid,
- f.f_feeid,
- f.f_feeUnitid,
- f.f_qty,
- f.f_unitprice,
- f.f_amount,
- f.f_currency,
- f.f_exrate,
- f.f_taxrate,
- f.f_dc,
- f.f_billstatus,
- f.f_statement_no,
- f.f_accamount,
- f.f_accamount_date,
- f.f_stlamount_no,
- f.f_stlamount,
- f.f_stlamount_date,
- f.f_invnos,
- f.f_invamount,
- f.f_askamount,
- f.f_chargedate,
- f.f_status,
- f.remark,
- f.f_mblno,
- f.f_product_name,
- f.src_bill_no,
- f.f_billing_days,
- f.f_inventory_days,
- f.f_marks,
- f.f_billing_deadline,
- f.f_originalbilldate,
- f.f_billtype,
- f.f_business_type,
- f.f_bsdate,
- c.f_id AS fId,
- c.f_name AS fName
- FROM
- t_warehousebillsfees AS f
- LEFT JOIN t_corps AS c ON f.f_corpid = c.f_id
- ) w ON w.f_pid = t.f_id
- LEFT JOIN t_fees f ON w.f_feeid = f.f_id
- LEFT JOIN sys_dict_data pr ON pr.dict_value = w.f_feeUnitid
- AND pr.dict_type = 'data_unitfees'
- LEFT JOIN t_vessel tv ON t.f_vslid = tv.f_id
- LEFT JOIN t_voyage ty ON t.f_voyid = ty.f_id
- LEFT JOIN t_address tre ON tre.f_id = t.f_loadportid
- LEFT JOIN t_address ts ON ts.f_id = t.f_destportid
- LEFT JOIN t_warehousebills_cntr ti ON ti.f_pid = t.f_id
- LEFT JOIN t_cntr tn ON tn.f_id = ti.f_cntrid
- <where>
- t.f_typeid = 1
- and w.f_billstatus = 6
- <if test="map.tWareHouseFees.fCorpid != null and map.tWareHouseFees.fCorpid != ''">and w.f_corpid =
- #{map.tWareHouseFees.fCorpid}
- </if>
- <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "1" '>
- and w.f_accamount_date IS NOT NULL
- </if>
- <if test='map.tWareHouseFees.fReconciliation != null and map.tWareHouseFees.fReconciliation != "" and map.tWareHouseFees.fReconciliation == "0" '>
- and w.f_accamount_date IS NULL
- </if>
- <if test="map.tWareHouseFees.fMblno != null and map.tWareHouseFees.fMblno != ''">and w.f_mblno like
- concat('%', #{map.tWareHouseFees.fMblno}, '%')
- </if>
- <if test='map.tWareHouseFees.fDc != null and map.tWareHouseFees.fDc != ""'>
- and w.f_dc = #{map.tWareHouseFees.fDc}
- </if>
- <if test="map.tWareHouseFees.fBillstatus != null">and w.f_billstatus = #{map.tWareHouseFees.fBillstatus}
- </if>
- <if test="map.tWareHouseFees.fVslid != null">and t.f_vslid = #{map.tWareHouseFees.fVslid}</if>
- <if test="map.tWareHouseFees.fVoyid != null">and t.f_voyid = #{map.tWareHouseFees.fVoyid}</if>
- <if test="map.tWareHouseFees.fLoadportid != null ">and t.f_loadportid = #{map.tWareHouseFees.fLoadportid}
- </if>
- <if test="map.tWareHouseFees.fDestportid != null ">and t.f_destportid = #{map.tWareHouseFees.fDestportid}
- </if>
- <if test="map.tWareHouseFees.fFromDate != null ">and t.f_bsdate >= #{map.tWareHouseFees.fFromDate}</if>
- <if test="map.tWareHouseFees.fToDate != null ">and t.f_bsdate <= #{map.tWareHouseFees.fToDate}</if>
- <if test='map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype != "" and map.tWareHouseFees.fBilltype == "KHDZ" '>
- and ifnull(w.f_amount, 0) - ifnull(w.f_accamount, 0) > 0
- </if>
- <if test='map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype != "" and map.tWareHouseFees.fBilltype == "KHSF" '>
- and ifnull(w.f_amount, 0) - ifnull(w.f_stlamount, 0) > 0
- </if>
- <if test='map.tWareHouseFees.fBilltype != null and map.tWareHouseFees.fBilltype != "" and map.tWareHouseFees.fBilltype == "KHFF" '>
- and ifnull(w.f_amount, 0) - ifnull(w.f_stlamount, 0) > 0
- </if>
- GROUP BY w.f_id
- </where>
- </select>
- <!--凯和查询财务主表数据-->
- <select id="selectFinancialTFeeId" parameterType="TFee" resultType="com.ruoyi.finance.shipping.FinancialTFee">
- SELECT
- f.f_id AS fId,
- f.f_billno AS srcBillNo,
- f.f_ctrlcorpid AS fCtrlcorpid,
- pro.dict_label AS chargingMethod,
- f.invoice_no AS invoiceNo,
- f.bank AS fBank,
- f.water_bill_no AS waterBillNo,
- f.f_corpid AS fCorpid,
- c.f_name AS fCorpidName,
- f.f_accbilldate AS fAccbilldate,
- f.t_mblno AS tMblno,
- f.f_amtdr AS fAmtdr,
- f.f_amtcr AS fAmtcr,
- f.f_billtype AS fBilltype,
- f.f_system_type AS fSystemType,
- f.f_billstatus AS fBillstatus,
- CASE
- WHEN f.f_billstatus = '1' THEN '新建'
- WHEN f.f_billstatus = '2' THEN '暂存'
- WHEN f.f_billstatus = '3' THEN '审批驳回'
- WHEN f.f_billstatus = '4' THEN '提交审核'
- WHEN f.f_billstatus = '5' THEN '审核中'
- WHEN f.f_billstatus = '6' THEN '审核完成'
- END
- AS fBillstatusName,
- f.f_remarks AS fRemarks,
- f.create_by AS createBy,
- tp.f_name AS createName,
- f.create_time AS createTime,
- f.update_by AS updateBy,
- f.update_time AS updateTime,
- tv.f_name AS vessel,
- ty.f_no AS voyage,
- tre.f_name AS loadportName,
- ts.f_name AS destportName,
- f.f_bank_number AS fBankNumber,
- f.f_loadportid AS fLoadportid,
- f.f_destportid AS fDestportid,
- f.f_vslid AS fVslid,
- f.f_voyid AS fVoyid,
- f.f_from_date AS fFromDate,
- f.f_to_date AS fToDate,
- f.f_dc As fDc,
- f.f_reconciliation AS fReconciliation,
- f.bank AS bank,
- CASE
- WHEN f.f_dc = 'D' THEN
- '收'
- WHEN f.f_dc = 'C' THEN
- '付'
- END AS fSrcdcName
- FROM
- t_fee AS f
- LEFT JOIN t_corps AS c ON f.f_corpid = c.f_id
- left join sys_user u on f.create_by = u.user_name
- left join sys_dept d on f.f_deptid = d.dept_id
- LEFT JOIN t_customer_contact tc ON tc.f_tel = u.phonenumber
- LEFT JOIN t_corps tp ON tp.f_id = tc.f_pid
- LEFT JOIN sys_dict_data pro ON pro.dict_value = f.charging_method and pro.dict_type = 'data_settlement_type'
- LEFT JOIN t_vessel tv ON f.f_vslid = tv.f_id
- LEFT JOIN t_voyage ty ON f.f_voyid = ty.f_id
- LEFT JOIN t_address tre ON tre.f_id = f.f_loadportid
- LEFT JOIN t_address ts ON ts.f_id = f.f_destportid
- where
- f.f_id = #{fId}
- </select>
- </mapper>
|