| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.ruoyi.warehouseBusiness.mapper.TWarehousebillsfeesMapper">
- <resultMap type="TWarehousebillsfees" id="TWarehousebillsfeesResult">
- <result property="fId" column="f_id"/>
- <result property="fPid" column="f_pid"/>
- <result property="fLineno" column="f_lineno"/>
- <result property="fCorpid" column="f_corpid"/>
- <result property="fFeeid" column="f_feeid"/>
- <result property="fFeeunitid" column="f_feeUnitid"/>
- <result property="fQty" column="f_qty"/>
- <result property="fUnitprice" column="f_unitprice"/>
- <result property="fAmount" column="f_amount"/>
- <result property="fCurrency" column="f_currency"/>
- <result property="fExrate" column="f_exrate"/>
- <result property="fTaxrate" column="f_taxrate"/>
- <result property="fDc" column="f_dc"/>
- <result property="fBillstatus" column="f_billstatus"/>
- <result property="fReviewDate" column="f_review_date"/>
- <result property="fAccamount" column="f_accamount"/>
- <result property="fStatementNo" column="f_statement_no"/>
- <result property="fStlamount" column="f_stlamount"/>
- <result property="fInvnos" column="f_invnos"/>
- <result property="fAccamountDate" column="f_accamount_date"/>
- <result property="fInvamount" column="f_invamount"/>
- <result property="fStlamountNo" column="f_stlamount_no"/>
- <result property="fAskamount" column="f_askamount"/>
- <result property="fStatus" column="f_status"/>
- <result property="fStlamountDate" column="f_stlamount_date"/>
- <result property="delFlag" column="del_flag"/>
- <result property="createBy" column="create_by"/>
- <result property="createTime" column="create_time"/>
- <result property="updateBy" column="update_by"/>
- <result property="updateTime" column="update_time"/>
- <result property="remark" column="remark"/>
- <result property="srcId" column="src_id"/>
- <result property="srcBillNo" column="src_bill_no"/>
- <result property="fMblno" column="f_mblno"/>
- <result property="fProductName" column="f_product_name"/>
- <result property="fMarks" column="f_marks"/>
- <result property="fChargedate" column="f_chargedate"/>
- <result property="fBillingDeadline" column="f_billing_deadline"/>
- <result property="fInventoryDays" column="f_inventory_days"/>
- <result property="fAmt" column="f_amt"/>
- <result property="fBillingDays" column="f_billing_days"/>
- <result property="fBillingQty" column="f_billing_qty"/>
- <result property="fBilltype" column="f_billtype"/>
- <result property="fBillingway" column="f_billingway"/>
- <result property="fBsdate" column="f_bsdate"/>
- <result property="fOriginalbilldate" column="f_originalbilldate"/>
- <result property="fStltypeid" column="f_stltypeid"/>
- <result property="fBusinessType" column="f_business_type"/>
- <result property="fSrcTypeId" column="f_src_type_id"/>
- <result property="fWarehouseid" column="f_warehouseid"/>
- <result property="fPurchase" column="f_purchase"/>
- <result property="tProductdate" column="t_productdate"/>
- <result property="fLotno" column="f_lotno"/>
- <result property="fValid" column="f_valid"/>
- <result property="fUnits" column="f_units"/>
- <result property="fStoreEnv" column="f_store_env"/>
- <result property="fIsfilles" column="f_isfilles"/>
- <result property="fAllotWarehouseid" column="f_allot_warehouseid" />
- </resultMap>
- <sql id="selectTWarehousebillsfeesVo">
- select f_id,
- f_pid,
- f_lineno,
- f_corpid,
- f_feeid,
- f_feeUnitid,
- f_qty,
- f_unitprice,
- f_amount,
- f_currency,
- f_exrate,
- f_taxrate,
- f_dc,
- f_billstatus,
- f_review_date,
- f_statement_no,
- f_accamount,
- f_stlamount,
- f_accamount_date,
- f_invnos,
- f_invamount,
- f_stlamount_no,
- f_askamount,
- f_status,
- f_stlamount_date,
- del_flag,
- create_by,
- create_time,
- update_by,
- update_time,
- remark,
- src_id,
- src_bill_no,
- f_mblno,
- f_product_name,
- f_marks,
- f_chargedate,
- f_billing_deadline,
- f_inventory_days,
- f_amt,
- f_billing_days,
- f_billing_qty,
- f_billtype,
- f_billingway,
- f_bsdate,
- f_originalbilldate,
- f_stltypeid,
- f_business_type,
- f_src_type_id,
- f_warehouseid,
- f_purchase,
- t_productdate,
- f_lotno,
- f_valid,
- f_units,
- f_store_env,
- f_isfilles,
- f_allot_warehouseid
- from t_warehousebillsfees
- </sql>
- <select id="selectTWarehousebillsfeesList" parameterType="TWarehousebillsfees"
- resultMap="TWarehousebillsfeesResult">
- <include refid="selectTWarehousebillsfeesVo"/>
- <where>
- del_flag = '0'
- <if test="fPid != null ">and f_pid = #{fPid}</if>
- <if test="fLineno != null ">and f_lineno = #{fLineno}</if>
- <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
- <if test="fFeeid != null ">and f_feeid = #{fFeeid}</if>
- <if test="fFeeunitid != null ">and f_feeUnitid = #{fFeeunitid}</if>
- <if test="fQty != null ">and f_qty = #{fQty}</if>
- <if test="fUnitprice != null ">and f_unitprice = #{fUnitprice}</if>
- <if test="fAmount != null ">and f_amount = #{fAmount}</if>
- <if test="fCurrency != null and fCurrency != ''">and f_currency = #{fCurrency}</if>
- <if test="fExrate != null ">and f_exrate = #{fExrate}</if>
- <if test="fTaxrate != null ">and f_taxrate = #{fTaxrate}</if>
- <if test="fDc != null and fDc != ''">and f_dc = #{fDc}</if>
- <if test="fBillstatus != null and fBillstatus != ''">and f_billstatus = #{fBillstatus}</if>
- <if test="fReviewDate != null ">and f_review_date = #{fReviewDate}</if>
- <if test="fStatementNo != null and fStatementNo != ''">and f_statement_no = #{fStatementNo}</if>
- <if test="fAccamount != null ">and f_accamount = #{fAccamount}</if>
- <if test="fStlamount != null ">and f_stlamount = #{fStlamount}</if>
- <if test="fAccamountDate != null ">and f_accamount_date = #{fAccamountDate}</if>
- <if test="fInvnos != null and fInvnos != ''">and f_invnos = #{fInvnos}</if>
- <if test="fInvamount != null ">and f_invamount = #{fInvamount}</if>
- <if test="fStlamountNo != null and fStlamountNo != ''">and f_stlamount_no = #{fStlamountNo}</if>
- <if test="fAskamount != null ">and f_askamount = #{fAskamount}</if>
- <if test="fStatus != null and fStatus != ''">and f_status = #{fStatus}</if>
- <if test="fStlamountDate != null ">and f_stlamount_date = #{fStlamountDate}</if>
- <if test="srcId != null ">and src_id = #{srcId}</if>
- <if test="srcBillNo != null and srcBillNo != ''">and src_bill_no = #{srcBillNo}</if>
- <if test="fMblno != null and fMblno != ''">and f_mblno = #{fMblno}</if>
- <if test="fProductName != null and fProductName != ''">and f_product_name like concat('%', #{fProductName},
- '%')
- </if>
- <if test="fMarks != null and fMarks != ''">and f_marks = #{fMarks}</if>
- <if test="fChargedate != null ">and f_chargedate = #{fChargedate}</if>
- <if test="fBillingDeadline != null ">and f_billing_deadline = #{fBillingDeadline}</if>
- <if test="fInventoryDays != null ">and f_inventory_days = #{fInventoryDays}</if>
- <if test="fAmt != null ">and f_amt = #{fAmt}</if>
- <if test="fBillingDays != null ">and f_billing_days = #{fBillingDays}</if>
- <if test="fBillingQty != null ">and f_billing_qty = #{fBillingQty}</if>
- <if test="fBilltype != null and fBilltype != ''">and f_billtype = #{fBilltype}</if>
- <if test="fBillingway != null ">and f_billingway = #{fBillingway}</if>
- <if test="fBsdate != null ">and f_bsdate = #{fBsdate}</if>
- <if test="fOriginalbilldate != null ">and f_originalbilldate = #{fOriginalbilldate}</if>
- <if test="fStltypeid != null">and f_stltypeid = #{fStltypeid},</if>
- <if test="fSrcTypeId != null">and f_src_type_id = #{fSrcTypeId},</if>
- <if test="fWarehouseid != null ">and f_warehouseid = #{fWarehouseid}</if>
- <if test="fPurchase != null ">and f_purchase = #{fPurchase}</if>
- </where>
- </select>
- <select id="selectTWarehousebillsfeesById" parameterType="Long" resultMap="TWarehousebillsfeesResult">
- <include refid="selectTWarehousebillsfeesVo"/>
- where f_id = #{fId}
- </select>
- <select id="selectTWarehousebillsfeesByPId" parameterType="Long" resultMap="TWarehousebillsfeesResult">
- select f_id, f_pid, f_billing_deadline
- where f_pid = #{fId}
- and f_billtype = 'SJCK'
- </select>
- <select id="selectWarehousebillsfeesByPId" parameterType="Long" resultMap="TWarehousebillsfeesResult">
- <include refid="selectTWarehousebillsfeesVo"/>
- where f_pid = #{fId}
- </select>
- <select id="selectReconciliation" resultType="java.lang.Integer">
- SELECT COUNT(d.f_id)
- FROM t_fee_do d
- LEFT JOIN t_fee f ON d.f_pid = f.f_id
- WHERE d.f_srcpid = #{fId}
- AND f.f_billtype = 'DZ'
- </select>
- <select id="selectCharge" resultType="java.lang.Integer">
- SELECT COUNT(d.f_id)
- FROM t_fee_do d
- LEFT JOIN t_fee f ON d.f_pid = f.f_id
- WHERE d.f_srcpid = #{fId}
- AND f.f_billtype = 'SF'
- </select>
- <select id="selectPay" resultType="java.lang.Integer">
- SELECT COUNT(d.f_id)
- FROM t_fee_do d
- LEFT JOIN t_fee f ON d.f_pid = f.f_id
- WHERE d.f_srcpid = #{fId}
- AND f.f_billtype = 'FF'
- </select>
- <select id="selectFleetExcelMonthList" parameterType="TWarehousebillsfees"
- resultType="com.ruoyi.finance.excel.FleetExcel">
- SELECT
- CONCAT( MONTH ( s.f_bsdate ), '月份小计:' ) feelMonthName,
- CONCAT(
- YEAR ( s.f_bsdate ),
- '-',
- MONTH ( s.f_bsdate )) feelMonth,
- sum( CASE WHEN s.f_feeid = 27 THEN s.f_amount ELSE 0 END ) ccf,
- sum( CASE WHEN s.f_feeid != 27 THEN s.f_amount ELSE 0 END ) fAmount,
- sum( s.f_amount ) totalAmount,
- sum( s.f_invamount ) invamount,
- ROUND( sum( t.f_grossweightblc / 1000 ), 2 ) stock
- FROM
- t_warehousebillsfees s
- LEFT JOIN t_corps c ON s.f_corpid = c.f_id
- LEFT JOIN t_whgenleg t ON t.f_corpid = s.f_corpid
- WHERE
- s.f_dc = 'D'
- <if test='fMonth != null and fMonth[0] != null and fMonth[0]!= ""'>
- and s.f_bsdate >= #{fMonth[0]}
- </if>
- <if test='fMonth != null and fMonth[1] != null and fMonth[1]!= ""'>
- and s.f_bsdate <= #{fMonth[1]}
- </if>
- GROUP BY
- CONCAT(
- YEAR ( f_bsdate ),
- '-',
- MONTH ( f_bsdate ))
- </select>
- <select id="selectFleetExcelList" parameterType="TWarehousebillsfees"
- resultType="com.ruoyi.finance.excel.FleetExcel">
- SELECT
- #{createBy} userName,
- CONCAT(
- YEAR ( s.f_bsdate ),
- '-',
- MONTH ( s.f_bsdate )) feelMonth,
- c.f_name corpName,
- sum( CASE WHEN s.f_feeid = 27 THEN s.f_amount ELSE 0 END ) ccf,
- sum( CASE WHEN s.f_feeid != 27 THEN s.f_amount ELSE 0 END ) fAmount,
- sum( s.f_amount ) totalAmount,
- IF
- ( f_invamount = 0, 'F', 'T' ) isInvoice,
- sum( s.f_invamount ) invamount,
- ROUND( sum( t.f_grossweightblc / 1000 ), 2 ) stock
- FROM
- t_warehousebillsfees s
- LEFT JOIN t_corps c ON s.f_corpid = c.f_id
- LEFT JOIN t_whgenleg t ON t.f_corpid = s.f_corpid
- WHERE
- s.f_dc = 'D'
- <if test='fMonth != null and fMonth[0] != null and fMonth[0]!= ""'>
- and s.f_bsdate >= #{fMonth[0]}
- </if>
- <if test='fMonth != null and fMonth[1] != null and fMonth[1]!= ""'>
- and s.f_bsdate <= #{fMonth[1]}
- </if>
- GROUP BY CONCAT( YEAR ( f_bsdate ), '-', MONTH ( f_bsdate )), s.f_corpid, c.f_name
- </select>
- <insert id="insertTWarehousebillsfees" parameterType="TWarehousebillsfees" useGeneratedKeys="true"
- keyProperty="fId">
- insert into t_warehousebillsfees
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="fPid != null">f_pid,</if>
- <if test="fLineno != null">f_lineno,</if>
- <if test="fCorpid != null">f_corpid,</if>
- <if test="fFeeid != null">f_feeid,</if>
- <if test="fFeeunitid != null">f_feeUnitid,</if>
- <if test="fQty != null">f_qty,</if>
- <if test="fUnitprice != null">f_unitprice,</if>
- <if test="fAmount != null">f_amount,</if>
- <if test="fCurrency != null">f_currency,</if>
- <if test="fExrate != null">f_exrate,</if>
- <if test="fTaxrate != null">f_taxrate,</if>
- <if test="fDc != null">f_dc,</if>
- <if test="fBillstatus != null">f_billstatus,</if>
- <if test="fReviewDate != null">f_review_date,</if>
- <if test="fStatementNo != null">f_statement_no,</if>
- <if test="fAccamount != null">f_accamount,</if>
- <if test="fStlamount != null">f_stlamount,</if>
- <if test="fAccamountDate != null">f_accamount_date,</if>
- <if test="fInvnos != null">f_invnos,</if>
- <if test="fInvamount != null">f_invamount,</if>
- <if test="fStlamountNo != null">f_stlamount_no,</if>
- <if test="fAskamount != null">f_askamount,</if>
- <if test="fStatus != null">f_status,</if>
- <if test="fStlamountDate != null">f_stlamount_date,</if>
- <if test="delFlag != null">del_flag,</if>
- <if test="createBy != null">create_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="remark != null">remark,</if>
- <if test="srcId != null">src_id,</if>
- <if test="srcBillNo != null">src_bill_no,</if>
- <if test="fMblno != null">f_mblno,</if>
- <if test="fProductName != null">f_product_name,</if>
- <if test="fMarks != null">f_marks,</if>
- <if test="fChargedate != null">f_chargedate,</if>
- <if test="fBillingDeadline != null">f_billing_deadline,</if>
- <if test="fInventoryDays != null">f_inventory_days,</if>
- <if test="fAmt != null">f_amt,</if>
- <if test="fBillingDays != null">f_billing_days,</if>
- <if test="fBillingQty != null">f_billing_qty,</if>
- <if test="fBilltype != null">f_billtype,</if>
- <if test="fBillingway != null">f_billingway,</if>
- <if test="fBsdate != null">f_bsdate,</if>
- <if test="fOriginalbilldate != null">f_originalbilldate,</if>
- <if test="fStltypeid != null">f_stltypeid,</if>
- <if test="fBusinessType != null">f_business_type,</if>
- <if test="fSrcTypeId != null">f_src_type_id,</if>
- <if test="fWarehouseid != null">f_warehouseid,</if>
- <if test="fPurchase != null">f_purchase,</if>
- <if test="tProductdate != null">t_productdate,</if>
- <if test="fLotno != null">f_lotno,</if>
- <if test="fValid != null">f_valid,</if>
- <if test="fUnits != null">f_units,</if>
- <if test="fStoreEnv != null">f_store_env,</if>
- <if test="fIsfilles != null">f_isfilles,</if>
- <if test="fAllotWarehouseid != null">f_allot_warehouseid,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="fPid != null">#{fPid},</if>
- <if test="fLineno != null">#{fLineno},</if>
- <if test="fCorpid != null">#{fCorpid},</if>
- <if test="fFeeid != null">#{fFeeid},</if>
- <if test="fFeeunitid != null">#{fFeeunitid},</if>
- <if test="fQty != null">#{fQty},</if>
- <if test="fUnitprice != null">#{fUnitprice},</if>
- <if test="fAmount != null">#{fAmount},</if>
- <if test="fCurrency != null">#{fCurrency},</if>
- <if test="fExrate != null">#{fExrate},</if>
- <if test="fTaxrate != null">#{fTaxrate},</if>
- <if test="fDc != null">#{fDc},</if>
- <if test="fBillstatus != null">#{fBillstatus},</if>
- <if test="fReviewDate != null">#{fReviewDate},</if>
- <if test="fStatementNo != null">#{fStatementNo},</if>
- <if test="fAccamount != null">#{fAccamount},</if>
- <if test="fStlamount != null">#{fStlamount},</if>
- <if test="fAccamountDate != null">#{fAccamountDate},</if>
- <if test="fInvnos != null">#{fInvnos},</if>
- <if test="fInvamount != null">#{fInvamount},</if>
- <if test="fStlamountNo != null">#{fStlamountNo},</if>
- <if test="fAskamount != null">#{fAskamount},</if>
- <if test="fStatus != null">#{fStatus},</if>
- <if test="fStlamountDate != null">#{fStlamountDate},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="remark != null">#{remark},</if>
- <if test="srcId != null">#{srcId},</if>
- <if test="srcBillNo != null">#{srcBillNo},</if>
- <if test="fMblno != null">#{fMblno},</if>
- <if test="fProductName != null">#{fProductName},</if>
- <if test="fMarks != null">#{fMarks},</if>
- <if test="fChargedate != null">#{fChargedate},</if>
- <if test="fBillingDeadline != null">#{fBillingDeadline},</if>
- <if test="fInventoryDays != null">#{fInventoryDays},</if>
- <if test="fAmt != null">#{fAmt},</if>
- <if test="fBillingDays != null">#{fBillingDays},</if>
- <if test="fBillingQty != null">#{fBillingQty},</if>
- <if test="fBilltype != null">#{fBilltype},</if>
- <if test="fBillingway != null">#{fBillingway},</if>
- <if test="fBsdate != null">#{fBsdate},</if>
- <if test="fOriginalbilldate != null">#{fOriginalbilldate},</if>
- <if test="fStltypeid != null">#{fStltypeid},</if>
- <if test="fBusinessType != null">#{fBusinessType},</if>
- <if test="fSrcTypeId != null">#{fSrcTypeId},</if>
- <if test="fWarehouseid != null">#{fWarehouseid},</if>
- <if test="fPurchase != null">#{fPurchase},</if>
- <if test="tProductdate != null">#{tProductdate},</if>
- <if test="fLotno != null">#{fLotno},</if>
- <if test="fValid != null">#{fValid},</if>
- <if test="fUnits != null">#{fUnits},</if>
- <if test="fStoreEnv != null">#{fStoreEnv},</if>
- <if test="fIsfilles != null">#{fIsfilles},</if>
- <if test="fAllotWarehouseid != null">#{fAllotWarehouseid},</if>
- </trim>
- </insert>
- <update id="updateTWarehousebillsfees" parameterType="TWarehousebillsfees">
- update t_warehousebillsfees
- <trim prefix="SET" suffixOverrides=",">
- <if test="fPid != null">f_pid = #{fPid},</if>
- <if test="fLineno != null">f_lineno = #{fLineno},</if>
- <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
- <if test="fFeeid != null">f_feeid = #{fFeeid},</if>
- <if test="fFeeunitid != null">f_feeUnitid = #{fFeeunitid},</if>
- <if test="fQty != null">f_qty = #{fQty},</if>
- <if test="fUnitprice != null">f_unitprice = #{fUnitprice},</if>
- <if test="fAmount != null">f_amount = #{fAmount},</if>
- <if test="fCurrency != null">f_currency = #{fCurrency},</if>
- <if test="fExrate != null">f_exrate = #{fExrate},</if>
- <if test="fTaxrate != null">f_taxrate = #{fTaxrate},</if>
- <if test="fDc != null">f_dc = #{fDc},</if>
- <if test="fBillstatus != null">f_billstatus = #{fBillstatus},</if>
- <if test="fReviewDate != null">f_review_date = #{fReviewDate},</if>
- <if test="fStatementNo != null">f_statement_no = #{fStatementNo},</if>
- <if test="fAccamount != null">f_accamount = #{fAccamount},</if>
- <if test="fStlamount != null">f_stlamount = #{fStlamount},</if>
- <if test="fAccamountDate != null">f_accamount_date = #{fAccamountDate},</if>
- <if test="fInvnos != null">f_invnos = #{fInvnos},</if>
- <if test="fInvamount != null">f_invamount = #{fInvamount},</if>
- <if test="fStlamountNo != null">f_stlamount_no = #{fStlamountNo},</if>
- <if test="fAskamount != null">f_askamount = #{fAskamount},</if>
- <if test="fStatus != null">f_status = #{fStatus},</if>
- <if test="fStlamountDate != null">f_stlamount_date = #{fStlamountDate},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="srcId != null">src_id = #{srcId},</if>
- <if test="srcBillNo != null">src_bill_no = #{srcBillNo},</if>
- <if test="fMblno != null">f_mblno = #{fMblno},</if>
- <if test="fProductName != null">f_product_name = #{fProductName},</if>
- <if test="fMarks != null">f_marks = #{fMarks},</if>
- <if test="fChargedate != null">f_chargedate = #{fChargedate},</if>
- <if test="fBillingDeadline != null">f_billing_deadline = #{fBillingDeadline},</if>
- <if test="fInventoryDays != null">f_inventory_days = #{fInventoryDays},</if>
- <if test="fAmt != null">f_amt = #{fAmt},</if>
- <if test="fBillingDays != null">f_billing_days = #{fBillingDays},</if>
- <if test="fBillingQty != null">f_billing_qty = #{fBillingQty},</if>
- <if test="fBilltype != null">f_billtype = #{fBilltype},</if>
- <if test="fBillingway != null">f_billingway = #{fBillingway},</if>
- <if test="fBsdate != null">f_bsdate = #{fBsdate},</if>
- <if test="fOriginalbilldate != null">f_originalbilldate = #{fOriginalbilldate},</if>
- <if test="fStltypeid != null">f_stltypeid = #{fStltypeid},</if>
- <if test="fSrcTypeId != null">f_src_type_id = #{fSrcTypeId},</if>
- <if test="fWarehouseid != null">f_warehouseid = #{fWarehouseid},</if>
- <if test="fPurchase != null">f_purchase = #{fPurchase},</if>
- <if test="tProductdate != null">t_productdate = #{tProductdate},</if>
- <if test="fLotno != null">f_lotno = #{fLotno},</if>
- <if test="fValid != null">f_valid = #{fValid},</if>
- <if test="fUnits != null">f_units = #{fUnits},</if>
- <if test="fStoreEnv != null">f_store_env = #{fStoreEnv},</if>
- <if test="fIsfilles != null">f_isfilles = #{fIsfilles},</if>
- <if test="fAllotWarehouseid != null">f_allot_warehouseid = #{fAllotWarehouseid},</if>
- </trim>
- where f_id = #{fId}
- </update>
- <delete id="deleteTWarehousebillsfeesById" parameterType="Long">
- delete
- from t_warehousebillsfees
- where f_id = #{fId}
- </delete>
- <delete id="deleteByFPid" parameterType="Long">
- delete
- from t_warehousebillsfees
- where f_pid = #{fId}
- </delete>
- <delete id="deleteTWarehousebillsfeesByIds" parameterType="String">
- delete from t_warehousebillsfees where f_id in
- <foreach item="fId" collection="array" open="(" separator="," close=")">
- #{fId}
- </foreach>
- </delete>
- <update id="warehouseFeesFollowUpdate">
- update
- t_warehousebillsfees
- <trim prefix="SET" suffixOverrides=",">
- <if test="fettle != null">f_billstatus = #{fettle},</if>
- <if test="auditItem != null and fettle == 6">f_review_date = #{auditItem},</if>
- <if test="auditItem != null and fettle != 6">f_review_date = null,</if>
- </trim>
- where f_pid = #{fPid}
- </update>
- <update id="updateTWarehousebillsfee" parameterType="Map">
- update t_warehousebillsfees
- <trim prefix="SET" suffixOverrides=",">
- /*判断确认对账*/
- <if test="map.billType == 'DZ'">
- f_statement_no = #{map.tFee.fBillno},
- f_accamount = f_accamount + #{map.tFeeDo.fAmt},
- f_accamount_date = #{map.tFee.fAccbilldate}
- </if>
- /*判断撤销对账*/
- <if test="map.billType == 'DZRevoke'">
- f_statement_no = #{map.tFee.fBillno},
- f_accamount = f_accamount - #{map.tFeeDo.fAmt},
- f_accamount_date = #{map.tFee.fAccbilldate}
- </if>
- /*判断收付款*/
- <if test="map.billType == 'DC'">
- f_stlamount_no = #{map.tFee.fBillno},
- f_stlamount = f_stlamount + #{map.tFeeDo.fAmt},
- f_stlamount_date =#{map.tFee.fAccbilldate}
- </if>
- /*判断撤销收付款*/
- <if test="map.billType == 'DCRevoke'">
- f_stlamount_no = #{map.tFee.fBillno},
- f_stlamount = f_stlamount - #{map.tFeeDo.fAmt},
- f_stlamount_date =#{map.tFee.fAccbilldate}
- </if>
- /*判断撤销收付款*/
- <if test="map.billType == 'DZSF' or map.billType == 'DZFF'">
- f_stlamount_no = #{map.tFee.fBillno},
- f_stlamount = f_stlamount - #{map.tFeeDo.fAmt},
- f_stlamount_date =#{map.tFee.fAccbilldate}
- </if>
- /*判断开发票款*/
- <if test="map.billType == 'invoiceFP' or map.billType == 'XXFP' or map.billType == 'JXFP'">
- f_invamount = f_invamount + #{map.tFeeDo.fAmt},
- f_stlamount_date =#{map.tFee.fAccbilldate}
- </if>
- <if test="map.billType == 'DZinvoiceFP' or map.billType == 'DZXXFP' or map.billType == 'DZJXFP'">
- f_invamount = f_invamount - #{map.tFeeDo.fAmt},
- f_stlamount_date =#{map.tFee.fAccbilldate}
- </if>
- /*判断申请发票款*/
- <if test="map.billType == 'ApplyFP'">
- f_askamount = f_askamount + #{map.tFeeDo.fAmt},
- f_stlamount_date =#{map.tFee.fAccbilldate}
- </if>
- <if test="map.billType == 'DZApplyFP'">
- f_askamount = f_askamount - #{map.tFeeDo.fAmt},
- f_stlamount_date =#{map.tFee.fAccbilldate}
- </if>
- /*判断确认对账*/
- <if test="map.billType == 'KHDZ'">
- f_statement_no = #{map.tFee.fBillno},
- f_accamount = f_accamount + #{map.tFeeDo.fAmt},
- f_accamount_date = #{map.tFee.fAccbilldate}
- </if>
- /*判断撤销对账*/
- <if test="map.billType == 'KHDZRevoke'">
- f_statement_no = #{map.tFee.fBillno},
- f_accamount = f_accamount - #{map.tFeeDo.fAmt},
- f_accamount_date = #{map.tFee.fAccbilldate}
- </if>
- </trim>
- where f_id = #{map.tFeeDo.fSrcid}
- </update>
- <select id="selectFeesByPId" parameterType="Long" resultMap="TWarehousebillsfeesResult">
- SELECT
- tw.f_id,
- tw.f_pid,
- tw.f_lineno,
- tw.f_corpid,
- tc.f_name corpName,
- tw.f_feeid,
- tf.f_name feeName,
- tw.f_feeUnitid,
- tw.f_qty,
- tw.f_unitprice,
- tw.f_amount,
- tw.f_currency,
- tw.f_exrate,
- tw.f_taxrate,
- tw.f_dc,
- tw.f_billstatus,
- CASE
- WHEN tw.f_billstatus = '1' THEN
- '新建'
- WHEN tw.f_billstatus = '2' THEN
- '暂存'
- WHEN tw.f_billstatus = '3' THEN
- '驳回'
- WHEN tw.f_billstatus = '4' THEN
- '提交'
- WHEN tw.f_billstatus = '5' THEN
- '审批中'
- WHEN tw.f_billstatus = '6' THEN
- '审批通过'
- END AS fBillstatusName,
- tw.f_review_date,
- tw.f_statement_no,
- tw.f_accamount,
- tw.f_stlamount,
- tw.f_accamount_date,
- tw.f_invnos,
- tw.f_invamount,
- tw.f_stlamount_no,
- tw.f_askamount,
- tw.f_status,
- tw.f_stlamount_date,
- tw.del_flag,
- tw.create_by,
- tw.create_time,
- tw.update_by,
- tw.update_time,
- tw.remark,
- tw.src_id,
- tw.src_bill_no,
- tw.f_mblno,
- tw.f_product_name,
- tw.f_marks,
- tw.f_chargedate,
- tw.f_billing_deadline,
- tw.f_inventory_days,
- tw.f_amt,
- tw.f_billing_days,
- tw.f_billing_qty,
- tw.f_billtype,
- tw.f_billingway,
- tw.f_bsdate,
- tw.f_originalbilldate,
- tw.f_stltypeid,
- tw.f_business_type,
- tw.f_src_type_id
- FROM
- t_warehousebillsfees tw
- LEFT JOIN t_fees tf ON tw.f_feeid = tf.f_id
- LEFT JOIN t_corps tc ON tw.f_corpid = tc.f_id
- where tw.f_pid = #{fPid}
- and tw.f_billtype = 'KHDD'
- <if test="fDc != null and fDc != ''">and tw.f_dc = #{fDc}</if>
- </select>
- <delete id="deleteFessByFPid" parameterType="object">
- delete
- from t_warehousebillsfees
- where f_pid = #{fPid}
- <if test="fDc != null and fDc != ''">and f_dc = #{fDc}</if>
- </delete>
- <!--网页版查询对账-->
- <select id="webVersionReconciliation" parameterType="TAccount" resultType="map">
- SELECT
- tb.f_billno AS fBillno,
- /**运单号*/
- tv.f_name AS vesselName,
- /**船名*/
- ty.f_no AS voyageName,
- /**航次*/
- tc.f_name AS invoice,
- /**收费单位*/
- tc.f_name AS drawee,
- /**受票单位*/
- tp.f_name AS corpName,
- /**货权方*/
- pro.dict_label AS fPaymode,
- /**付款方式*/
- te.f_name AS payment,
- /**费用名称*/
- ifnull( tf.f_amount, 0 ) - ifnull( tf.f_accamount, 0 ) AS fAmtdr,
- /**原始金额*/
- ifnull( tf.f_amount, 0 ) - ifnull( tf.f_accamount, 0 ) AS fAmt,
- /**本次金额*/
- ta.f_name AS fLoadportidName,
- /**始发港*/
- tr.f_name AS fDestportidName,
- /**目的港*/
- pr.dict_label AS fServiceitems,
- /**运输条款*/
- tg.f_name AS goodName,
- /**货名*/
- tn.f_name AS transit,
- /**箱型*/
- items.f_cntrcount AS fCntrcount,
- /**箱量*/
- tb.f_shippername AS fShippername,
- /**发货人*/
- tb.f_consigneername AS fConsigneername,
- /**收货人*/
- tf.f_id AS fSrcid,
- tf.f_pid AS fSrcpid,
- tf.create_by AS createBy,
- tf.create_time AS createTime,
- tf.update_by AS updateBy,
- tf.update_time AS updateTime,
- tf.remark AS remark,
- tf.f_mblno AS fMblno,
- tf.f_corpid AS fCorpid,
- tf.f_feeid AS fFeeid
- FROM
- t_warehousebillsfees tf
- LEFT JOIN t_corps tc ON tc.f_id = tf.f_corpid
- LEFT JOIN t_fees te ON te.f_id = tf.f_feeid
- LEFT JOIN t_warehousebills tb ON tb.f_id = tf.f_pid
- LEFT JOIN t_vessel tv ON tv.f_id = tb.f_vslid
- LEFT JOIN t_voyage ty ON ty.f_id = tb.f_voyid
- LEFT JOIN t_address ta ON ta.f_id = tb.f_loadportid
- LEFT JOIN t_address tr ON tr.f_id = tb.f_destportid
- LEFT JOIN sys_dict_data pro ON pro.dict_value = tb.f_paymode
- AND pro.dict_type = 'data_settlement_type'
- LEFT JOIN sys_dict_data pr ON pr.dict_value = tb.f_serviceitems
- AND pr.dict_type = 'f_serviceitems'
- LEFT JOIN ( SELECT f_pid, MAX( f_goodsid ) f_goodsid FROM t_warehousebills_cntr GROUP BY f_pid ) w ON w.f_pid =
- tb.f_id
- LEFT JOIN t_goods tg ON tg.f_id = w.f_goodsid
- LEFT JOIN ( SELECT f_pid, SUM( f_cntrcount ) f_cntrcount FROM t_warehousebills_cntritems GROUP BY f_pid ) items
- ON items.f_pid = tb.f_id
- LEFT JOIN ( SELECT f_pid, MAX( f_cntrid ) f_cntrid FROM t_warehousebills_cntritems GROUP BY f_pid ) twc ON
- twc.f_pid = tb.f_id
- LEFT JOIN t_cntr tn ON tn.f_id = twc.f_cntrid
- LEFT JOIN t_corps tp ON tp.f_id = tb.f_corpid
- WHERE
- tf.f_billstatus = 6
- AND tf.f_dc = 'D'
- AND tb.f_typeid = 1
- and tb.f_review_date IS NOT NULL
- and ifnull(tf.f_amount, 0) - ifnull(tf.f_accamount, 0) > 0
- <if test="fLoadportid != null">and tb.f_loadportid = #{fLoadportid}</if>
- <if test="fDestportid != null">and tb.f_destportid = #{fDestportid}</if>
- <if test="fInvoceobj != null and fInvoceobj != ''">and tb.f_invoceobj like concat('%', #{fInvoceobj}, '%')</if>
- <if test="fShippername != null and fShippername != ''">and tb.f_shippername like concat('%', #{fShippername},
- '%')
- </if>
- <if test="fConsigneername != null and fConsigneername != ''">and tb.f_consigneername like concat('%',
- #{fConsigneername}, '%')
- </if>
- <if test="fMblno != null and fMblno != ''">and tb.f_mblno like concat('%', #{fMblno}, '%')</if>
- <if test="fBillno != null and fBillno != ''">and tb.f_billno like concat('%', #{fBillno}, '%')</if>
- <if test="fVslid != null">and tb.f_vslid = #{fVslid}</if>
- <if test="fVoyid != null">and tb.f_voyid = #{fVoyid}</if>
- <if test="fCorpid != null">and tf.f_corpid = #{fCorpid}</if>
- <if test="fPaymodeid != null">and tb.f_paymode = #{fPaymodeid}</if>
- <if test='sailTime != null and sailTime[0] != null and sailTime[0]!= ""'>
- and tf.create_time >= #{sailTime[0]}
- </if>
- <if test='sailTime != null and sailTime[1] != null and sailTime[1]!= ""'>
- and tf.create_time <= #{sailTime[1]}
- </if>
- <if test="fDocmentdate != null and fDocmentdate != ''">and tb.f_docmentdate = #{fDocmentdate}</if>
- <if test="createBy != null and createBy != ''">and tb.create_by = #{createBy}</if>
- <if test="goodName != null and goodName != ''">and tg.f_name like concat('%', #{goodName}, '%')</if>
- ORDER BY tf.f_id desc
- </select>
- <!--网页版查询对账明细-->
- <select id="webVersionDetail" parameterType="TAccount" resultType="map">
- SELECT
- tf.f_id AS fId,
- te.f_billno AS accountBillno,
- /**账单编号*/
- tw.f_billno AS fBillno,
- /**运单编号*/
- tv.f_name AS vesselName,
- /**船名*/
- ty.f_no AS voyageName,
- /**航次*/
- te.f_ctrlcorpid AS fCtrlcorpid,
- /**获权方*/
- tp.f_name AS corpName,
- /**结算单位*/
- ta.f_name AS fLoadportidName,
- /**始发港*/
- tr.f_name AS fDestportidName,
- /**目的港*/
- pr.dict_label AS fServiceitems,
- /**运输条款*/
- ts.f_name AS payment,
- /**费用名称*/
- tf.f_amtdr AS fAmtdr,
- /**原始金额*/
- tf.f_amt AS fAmt,
- /**本次金额*/
- tn.f_name AS transit,
- /**箱型*/
- items.f_cntrcount AS fCntrcount,
- /**箱量*/
- tf.create_by AS createBy,
- tf.create_time AS createTime,
- CASE
- WHEN te.f_billstatus = '1' THEN
- '保存'
- WHEN te.f_billstatus = '2' THEN
- '暂存'
- WHEN te.f_billstatus = '3' THEN
- '审批驳回'
- WHEN te.f_billstatus = '4' THEN
- '提交审核'
- WHEN te.f_billstatus = '5' THEN
- '审核中'
- WHEN te.f_billstatus = '6' THEN
- '审核完成'
- END AS fBillstatus
- FROM
- t_fee_do tf
- LEFT JOIN t_fee te ON te.f_id = tf.f_pid
- LEFT JOIN t_warehousebills tw ON tf.f_srcpid = tw.f_id
- LEFT JOIN t_warehousebillsfees th ON th.f_id = tf.f_srcid
- LEFT JOIN t_vessel tv ON tw.f_vslid = tv.f_id
- LEFT JOIN t_voyage ty ON ty.f_id = tw.f_voyid
- LEFT JOIN t_address ta ON ta.f_id = tw.f_loadportid
- LEFT JOIN t_address tr ON tr.f_id = tw.f_destportid
- LEFT JOIN sys_dict_data pr ON pr.dict_value = tw.f_serviceitems
- AND pr.dict_type = 'f_serviceitems'
- LEFT JOIN t_fees ts ON ts.f_id = tf.f_feeid
- LEFT JOIN ( SELECT f_pid, SUM( f_cntrcount ) f_cntrcount FROM t_warehousebills_cntritems GROUP BY f_pid ) items
- ON items.f_pid = tw.f_id
- LEFT JOIN ( SELECT f_pid, MAX( f_cntrid ) f_cntrid FROM t_warehousebills_cntritems GROUP BY f_pid ) twc ON
- twc.f_pid = tw.f_id
- LEFT JOIN t_cntr tn ON tn.f_id = twc.f_cntrid
- LEFT JOIN t_corps tp ON tp.f_id = te.f_corpid
- WHERE
- te.f_billtype = 'KHDZ'
- <if test="fLoadportid != null">and tw.f_loadportid = #{fLoadportid}</if>
- <if test="fDestportid != null">and tw.f_destportid = #{fDestportid}</if>
- <if test="fInvoceobj != null and fInvoceobj != ''">and tw.f_invoceobj like concat('%', #{fInvoceobj}, '%')</if>
- <if test="fShippername != null and fShippername != ''">and tw.f_shippername like concat('%', #{fShippername},
- '%')
- </if>
- <if test="fConsigneername != null and fConsigneername != ''">and tw.f_consigneername like concat('%',
- #{fConsigneername}, '%')
- </if>
- <if test="fMblno != null and fMblno != ''">and tw.f_mblno = #{fMblno}</if>
- <if test="fVslid != null">and tw.f_vslid = #{fVslid}</if>
- <if test="fId != null">and tf.f_id = #{fId}</if>
- <if test="fVoyid != null">and tw.f_voyid = #{fVoyid}</if>
- <if test="fCorpid != null">and te.f_corpid = #{fCorpid}</if>
- <if test="fPaymodeid != null">and tw.f_paymode = #{fPaymodeid}</if>
- <if test='sailTime != null and sailTime[0] != null and sailTime[0]!= ""'>
- and tf.create_time >= #{sailTime[0]}
- </if>
- <if test='sailTime != null and sailTime[1] != null and sailTime[1]!= ""'>
- and tf.create_time <= #{sailTime[1]}
- </if>
- <if test="fDocmentdate != null and fDocmentdate != ''">and tw.f_docmentdate = #{fDocmentdate}</if>
- <if test="createBy != null and createBy != ''">and te.create_by = #{createBy}</if>
- <if test="accountBillno != null and accountBillno != ''">and te.f_billno = #{accountBillno}</if>
- ORDER BY tf.f_id desc
- </select>
- <update id="anPinDeleteFeeUpdate">
- update
- t_warehousebillsfees
- <trim prefix="SET" suffixOverrides=",">
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- </trim>
- where f_id in
- <foreach item="fId" collection="fIds" open="(" separator="," close=")">
- #{fId}
- </foreach>
- </update>
- <update id="anPinDeleteFeeUpdateByfPid">
- update
- t_warehousebillsfees
- <trim prefix="SET" suffixOverrides=",">
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- </trim>
- where f_pid in
- <foreach item="fId" collection="fPid" open="(" separator="," close=")">
- #{fId}
- </foreach>
- </update>
- <select id="anPinTWarehousebillsfeesList" parameterType="TWarehousebillsfees"
- resultMap="TWarehousebillsfeesResult">
- select tw.f_id,
- tw.f_pid,
- tw.f_lineno,
- tw.f_corpid,
- tw.f_feeid,
- tf.f_name AS feeName,
- tf.f_currency AS fCurrencyName,
- tw.f_feeUnitid,
- sc.dict_label AS fFeeunitName,
- tw.f_qty,
- tw.f_unitprice,
- tw.f_amount,
- tw.f_currency,
- tw.f_exrate,
- tw.f_taxrate,
- tw.f_dc,
- tw.f_billstatus,
- CASE
- WHEN tw.f_billstatus = '1' THEN
- '保存'
- WHEN tw.f_billstatus = '2' THEN
- '暂存'
- WHEN tw.f_billstatus = '3' THEN
- '审批驳回'
- WHEN tw.f_billstatus = '4' THEN
- '提交审核'
- WHEN tw.f_billstatus = '5' THEN
- '审核中'
- WHEN tw.f_billstatus = '6' THEN
- '审核完成'
- END AS fBillstatusName,
- tw.f_review_date,
- tw.f_statement_no,
- tw.f_accamount,
- tw.f_stlamount,
- tw.f_accamount_date,
- tw.f_invnos,
- tw.f_invamount,
- tw.f_stlamount_no,
- tw.f_askamount,
- tw.f_status,
- tw.f_stlamount_date,
- tw.del_flag,
- tw.create_by,
- tw.create_time,
- tw.update_by,
- tw.update_time,
- tw.remark,
- tw.src_id,
- tw.src_bill_no,
- tw.f_mblno,
- tw.f_product_name,
- tw.f_marks,
- tw.f_chargedate,
- tw.f_billing_deadline,
- tw.f_inventory_days,
- tw.f_amt,
- tw.f_billing_days,
- tw.f_billing_qty,
- tw.f_billtype,
- tw.f_billingway,
- tw.f_bsdate,
- tw.f_originalbilldate,
- tw.f_stltypeid,
- sd.dict_label AS fBillingwayName,
- tw.f_business_type,
- tw.f_src_type_id,
- tw.f_warehouseid,
- th.f_warehouse_information AS fWarehouseName,
- tw.f_purchase,
- tw.t_productdate,
- tw.f_lotno,
- tw.f_valid,
- tw.f_units,
- tw.f_store_env,
- tw.f_isfilles,
- si.dict_label AS fUnitsName,
- st.dict_label AS fStoreEnvName,
- sti.dict_label AS fIsfillesName,
- tw.f_allot_warehouseid
- from t_warehousebillsfees tw
- LEFT JOIN t_fees tf ON tw.f_feeid = tf.f_id
- LEFT JOIN t_warehouse th ON tw.f_warehouseid = th.f_id
- LEFT JOIN sys_dict_data sc ON sc.dict_value = tw.f_feeUnitid AND sc.dict_type = 'data_unitfees'
- LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_stltypeid AND sd.dict_type = 'f_paymode'
- LEFT JOIN sys_dict_data si ON si.dict_value = tw.f_units AND si.dict_type = 'f_floatunit'
- LEFT JOIN sys_dict_data st ON st.dict_value = tw.f_store_env AND st.dict_type = 'f_StorageEnvironment'
- LEFT JOIN sys_dict_data sti ON sti.dict_value = tw.f_isfilles AND sti.dict_type = 'f_evidence'
- <where>
- <if test="fPid != null ">and tw.f_pid = #{fPid}</if>
- <if test="fLineno != null ">and tw.f_lineno = #{fLineno}</if>
- <if test="fCorpid != null ">and tw.f_corpid = #{fCorpid}</if>
- <if test="fFeeid != null ">and tw.f_feeid = #{fFeeid}</if>
- <if test="fFeeunitid != null ">and tw.f_feeUnitid = #{fFeeunitid}</if>
- <if test="fQty != null ">and tw.f_qty = #{fQty}</if>
- <if test="fUnitprice != null ">and tw.f_unitprice = #{fUnitprice}</if>
- <if test="fAmount != null ">and tw.f_amount = #{fAmount}</if>
- <if test="fCurrency != null and fCurrency != ''">and tw.f_currency = #{fCurrency}</if>
- <if test="fExrate != null ">and tw.f_exrate = #{fExrate}</if>
- <if test="fTaxrate != null ">and tw.f_taxrate = #{fTaxrate}</if>
- <if test="fDc != null and fDc != ''">and tw.f_dc = #{fDc}</if>
- <if test="fBillstatus != null and fBillstatus != ''">and tw.f_billstatus = #{fBillstatus}</if>
- <if test="fReviewDate != null ">and tw.f_review_date = #{fReviewDate}</if>
- <if test="fStatementNo != null and fStatementNo != ''">and tw.f_statement_no = #{fStatementNo}</if>
- <if test="fAccamount != null ">and tw.f_accamount = #{fAccamount}</if>
- <if test="fStlamount != null ">and tw.f_stlamount = #{fStlamount}</if>
- <if test="fAccamountDate != null ">and tw.f_accamount_date = #{fAccamountDate}</if>
- <if test="fInvnos != null and fInvnos != ''">and tw.f_invnos = #{fInvnos}</if>
- <if test="fInvamount != null ">and tw.f_invamount = #{fInvamount}</if>
- <if test="fStlamountNo != null and fStlamountNo != ''">and tw.f_stlamount_no = #{fStlamountNo}</if>
- <if test="fAskamount != null ">and tw.f_askamount = #{fAskamount}</if>
- <if test="fStatus != null and fStatus != ''">and tw.f_status = #{fStatus}</if>
- <if test="delFlag != null">and tw.del_flag = #{delFlag}</if>
- <if test="fStlamountDate != null ">and tw.f_stlamount_date = #{fStlamountDate}</if>
- <if test="srcId != null ">and tw.src_id = #{srcId}</if>
- <if test="srcBillNo != null and srcBillNo != ''">and tw.src_bill_no = #{srcBillNo}</if>
- <if test="fMblno != null and fMblno != ''">and tw.f_mblno = #{fMblno}</if>
- <if test="fProductName != null and fProductName != ''">and tw.f_product_name like concat('%',
- #{fProductName},
- '%')
- </if>
- <if test="fMarks != null and fMarks != ''">and tw.f_marks = #{fMarks}</if>
- <if test="fChargedate != null ">and tw.f_chargedate = #{fChargedate}</if>
- <if test="fBillingDeadline != null ">and tw.f_billing_deadline = #{fBillingDeadline}</if>
- <if test="fInventoryDays != null ">and tw.f_inventory_days = #{fInventoryDays}</if>
- <if test="fAmt != null ">and tw.f_amt = #{fAmt}</if>
- <if test="fBillingDays != null ">and tw.f_billing_days = #{fBillingDays}</if>
- <if test="fBillingQty != null ">and tw.f_billing_qty = #{fBillingQty}</if>
- <if test="fBilltype != null and fBilltype != ''">and tw.f_billtype = #{fBilltype}</if>
- <if test="fBillingway != null ">and tw.f_billingway = #{fBillingway}</if>
- <if test="fBsdate != null ">and tw.f_bsdate = #{fBsdate}</if>
- <if test="fOriginalbilldate != null ">and tw.f_originalbilldate = #{fOriginalbilldate}</if>
- <if test="fStltypeid != null">and tw.f_stltypeid = #{fStltypeid},</if>
- <if test="fSrcTypeId != null">and tw.f_src_type_id = #{fSrcTypeId},</if>
- <if test="fWarehouseid != null ">and tw.f_warehouseid = #{fWarehouseid}</if>
- <if test="fPurchase != null ">and tw.f_purchase = #{fPurchase}</if>
- </where>
- </select>
- <!--安品出入库统计-->
- <select id="selectTWarehouseInorOut" parameterType="TWarehousebillsfees"
- resultType="com.ruoyi.anpin.WarhousrExcel">
- SELECT
- tw.f_id AS fId,
- th.f_warehouse_information as wareHouseName,/*仓库*/
- ti.f_bsdate AS fBsdate,/*进货时间*/
- tf.f_name AS feeName,/*物资名称*/
- tf.f_currency AS fCurrencyName,/*物资规格*/
- tw.f_qty AS fQty,/*实际数量*/
- tw.f_amount AS fAmount,/*金额*/
- tw.f_unitprice AS fUnitprice,/*单价*/
- tc.f_name AS corpName,/*供货商*/
- tc.f_manage AS fManage,/*联系人*/
- tc.f_tel AS fTel,/*联系电话*/
- tw.t_productdate AS tProductdate,/*生产日期*/
- tw.f_lotno AS fLotno,/*批次号*/
- CONCAT(tw.f_valid,si.dict_label) AS quality,/*保值期限*/
- st.dict_label AS fStoreEnvName,/*储存环境中文名*/
- sti.dict_label AS fIsfillesName,/*索证索票*/
- std.dict_label AS fFeetype,/*物资类别*/
- sr.user_name AS purchaseName,/*采购人*/
- tp.f_name AS projectName,/*项目名称*/
- CASE
- WHEN tw.f_billtype = 'CK' THEN
- '出库'
- WHEN tw.f_billtype = 'DB' THEN
- '调拨'
- WHEN tw.f_billtype = 'RK' THEN
- '入库'
- END AS fBilltypeName,/*出入库类型*/
- ti.f_sbu AS fSbu,/*开票公司ID*/
- ts.f_name AS fSbuName,/*开票公司名称*/
- sc.dict_label As feeUnitName/*计量单位中文名*/
- FROM t_warehousebillsfees tw
- LEFT JOIN t_fees tf ON tw.f_feeid = tf.f_id
- LEFT JOIN t_warehouse th ON tw.f_warehouseid = th.f_id
- LEFT JOIN sys_dict_data sc ON sc.dict_value = tw.f_feeUnitid
- AND sc.dict_type = 'data_unitfees'
- LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_stltypeid
- AND sd.dict_type = 'f_paymode'
- LEFT JOIN sys_dict_data si ON si.dict_value = tw.f_units
- AND si.dict_type = 'f_floatunit'
- LEFT JOIN sys_dict_data st ON st.dict_value = tw.f_store_env
- AND st.dict_type = 'f_StorageEnvironment'
- LEFT JOIN sys_dict_data sti ON sti.dict_value = tw.f_isfilles
- AND sti.dict_type = 'f_evidence'
- LEFT JOIN t_warehousebills ti ON tw.f_pid = ti.f_id
- LEFT JOIN t_project tp ON ti.f_goodsid = tp.f_id
- LEFT JOIN t_corps tc ON ti.f_corpid = tc.f_id
- LEFT JOIN t_corps ts ON ti.f_sbu = ts.f_id
- LEFT JOIN sys_user sr ON sr.user_id = ti.f_purchase
- LEFT JOIN sys_dict_data std ON std.dict_value = tf.f_feetype
- AND std.dict_type = 'data_cost_attribute'
- <where>
- tw.del_flag = '0'
- and ti.del_flag = '0'
- <if test="fBillstatus != null and fBillstatus == 1">and tw.f_billstatus = 6</if>
- <if test="fBillstatus != null and fBillstatus == 2">and tw.f_billstatus != 6</if>
- <if test="fCorpid != null ">and ti.f_corpid = #{fCorpid}</if>
- <if test="fGoodsid != null ">and ti.f_goodsid = #{fGoodsid}</if>
- <if test="fBilltype != null and fBilltype != ''">and tw.f_billtype = #{fBilltype}</if>
- <if test="fBilltype == null or fBilltype == ''">and tw.f_billtype in ('CK','RK')</if>
- <if test="fFeeid != null ">and tw.f_feeid = #{fFeeid}</if>
- <if test="fFeeType != null ">and tf.f_feetype = #{fFeeType}</if>
- <if test="fWarehouseid != null ">and ti.f_warehouseid = #{fWarehouseid}</if>
- <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
- and ti.f_bsdate >= #{cLoadDate[0]}
- </if>
- <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
- and ti.f_bsdate <= #{cLoadDate[1]}
- </if>
- </where>
- ORDER BY tw.f_id DESC
- </select>
- <!--安品出销售出库统计-->
- <select id="salesOfOutbound" parameterType="TWarehousebills"
- resultType="com.ruoyi.anpin.SalesOfOutbound">
- SELECT
- td.fgoodsid AS fgoodsid,/*项目id*/
- tp.f_name AS projectName,/*项目中文名*/
- td.ffeetype AS ffeetype,/*物资类别*/
- si.dict_label AS ffeetypeName /*物资类别中文名*/,
- td.fname AS fname,/*物资名*/
- td.fcurrency AS fcurrency,/*规格*/
- td.ffeeunitid AS ffeeunitid,/*计价单位id*/
- sc.dict_label AS ffeeunitidName,/*计价单位中文名*/
- td.fqty AS fqty,/*数量*/
- td.famount AS famount,/*金额*/
- tr.f_name AS fsbuName,/*开票公司*/
- round(td.price,2) AS price/*单价*/
- <if test="groupDate != null and groupDate == 0">
- ,td.fBsdate AS fBsdate/*入库日期*/
- </if>
- FROM
- (
- SELECT
- tc.fgoodsid,
- tc.ffeetype,
- tc.fname,
- tc.fcurrency,
- tc.ffeeunitid,
- tc.fBsdate,
- tc.fSbu,
- IFNULL( SUM( tc.fqty ), 0 ) fqty,
- IFNULL( SUM( tc.famount ), 0 ) famount,
- IFNULL( SUM( tc.famount )/ SUM( tc.fqty ), 0 ) price
- FROM
- (
- SELECT
- tb.f_goodsid fgoodsid,
- /*项目*/
- tf.f_feetype ffeetype,
- /*物资类别*/
- tf.f_name fname,
- /*物资名*/
- tf.f_currency fcurrency,
- /*规格*/
- tw.f_feeunitid ffeeunitid,
- /*计价单位*/
- tw.f_qty fqty,
- /*实际数量*/
- tw.f_amount famount, /*金额*/
- tb.f_sbu fSbu,/*开票公司*/
- tw.f_bsdate fBsdate/*出库日期*/
- FROM
- t_warehousebillsfees tw
- LEFT JOIN t_warehousebills tb ON tw.f_pid = tb.f_id
- LEFT JOIN t_fees tf ON tw.f_feeid = tf.f_id
- WHERE
- tw.del_flag = '0'
- AND tb.del_flag = '0'
- AND tw.f_billtype = 'XS'
- <if test="fBillstatus != null">and tw.f_billstatus = #{fBillstatus}</if>
- <if test="fFeeid != null ">and tw.f_feeid = #{fFeeid}</if>
- <if test="fGoodsid != null and fGoodsid != ''">and tb.f_goodsid = #{fGoodsid}</if>
- <if test="fFeeTypeList != null and fFeeTypeList != '[]'">and tf.f_feetype in
- <foreach item="fId" collection="fFeeTypeList" open="(" separator="," close=")">
- #{fId}
- </foreach>
- </if>
- <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
- and tb.f_bsdate >= #{cLoadDate[0]}
- </if>
- <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
- and tb.f_bsdate <= #{cLoadDate[1]}
- </if>
- <if test="fSbu != null ">and tb.f_sbu = #{fSbu}</if>
- ) tc
- GROUP BY
- tc.fgoodsid,
- tc.ffeetype,
- tc.fname,
- tc.fcurrency,
- tc.ffeeunitid,
- tc.fSbu
- <if test="groupDate != null and groupDate == 0">
- ,tc.fBsdate
- </if>
- ) td
- LEFT JOIN t_project tp ON td.fgoodsid = tp.f_id
- LEFT JOIN t_corps tr ON tr.f_id = td.fSbu
- LEFT JOIN sys_dict_data sc ON sc.dict_value = td.ffeeunitid AND sc.dict_type = 'data_unitfees'
- LEFT JOIN sys_dict_data si ON si.dict_value = td.ffeetype AND si.dict_type = 'data_cost_attribute'
- ORDER BY
- <if test="groupDate != null and groupDate == 0">
- td.fBsdate DESC,/*入库日期*/
- </if>
- td.fgoodsid DESC
- </select>
- <!--安品利润统计-->
- <select id="salectAnpinProfit" parameterType="TWarehousebills"
- resultType="com.ruoyi.anpin.ProfitExcel">
- SELECT
- DISTINCT
- temp.years AS annual,
- temp.months AS abbreviated,
- tp.f_name AS projectName,
- temp.market AS market,
- temp.purchase AS purchase,
- temp.profit AS profit,
- ROUND(ifnull((temp.profit/temp.market)* 100,0),2) AS profitMargin
- FROM
- (
- SELECT
- xs.years AS years,
- xs.months AS months,
- xs.fGoodid AS fGoodid,
- IFNULL( xs.pay, 0 ) AS market,
- IFNULL( sq.collect, 0 ) AS purchase,
- CASE WHEN xs.pay IS NOT NULL AND sq.collect IS NOT NULL THEN xs.pay-sq.collect
- WHEN xs.pay IS NULL AND sq.collect IS NOT NULL THEN 0 -sq.collect
- WHEN xs.pay IS NOT NULL AND sq.collect IS NULL THEN xs.pay- 0
- END AS profit
- FROM
- (
- SELECT
- tw.f_goodsid AS fGoodid,
- DATE_FORMAT( tf.f_bsdate, '%Y' ) AS years,
- DATE_FORMAT( tf.f_bsdate, '%m' ) AS months,
- IFNULL( SUM( tf.f_amount ), 0 ) AS pay
- FROM
- t_warehousebillsfees tf
- LEFT JOIN t_warehousebills tw ON tf.f_pid = tw.f_id
- WHERE
- tf.f_billtype = 'XS'
- AND tf.del_flag = '0'
- AND tw.del_flag = '0'
- <if test="fBillstatus != null and fBillstatus != ''">and tf.f_billstatus = #{fBillstatus}</if>
- <if test="fGoodsid != null and fGoodsid != ''">and tw.f_goodsid = #{fGoodsid}</if>
- <if test="fFeeType != null">and te.f_feetype = #{fFeeType}</if>
- <if test="annual != null and annual != ''">and DATE_FORMAT(tf.f_bsdate,'%Y') = #{annual}</if>
- <if test="monthList != null and monthList[0] != null and monthList[0]!= ''">
- and DATE_FORMAT(tf.f_bsdate,'%m') >= #{monthList[0]}
- </if>
- <if test="monthList != null and monthList[1] != null and monthList[1]!= ''">
- and DATE_FORMAT(tf.f_bsdate,'%m') <= #{monthList[1]}
- </if>
- GROUP BY
- DATE_FORMAT( tf.f_bsdate, '%Y' ),
- DATE_FORMAT( tf.f_bsdate, '%m' ),
- tw.f_goodsid
- ORDER BY
- DATE_FORMAT( tf.f_bsdate, '%Y' ),
- DATE_FORMAT( tf.f_bsdate, '%m' )
- ) xs
- LEFT JOIN (
- SELECT
- tw.f_goodsid AS fGoodid,
- DATE_FORMAT( tf.f_bsdate, '%Y' ) AS years,
- DATE_FORMAT( tf.f_bsdate, '%m' ) AS months,
- IFNULL( SUM( tf.f_amount ), 0 ) AS collect
- FROM
- t_warehousebillsfees tf
- LEFT JOIN t_warehousebills tw ON tf.f_pid = tw.f_id
- WHERE
- tf.f_billtype = 'CK'
- AND tf.del_flag = '0'
- AND tw.del_flag = '0'
- <if test="fBillstatus != null and fBillstatus != ''">and tf.f_billstatus = #{fBillstatus}</if>
- <if test="fGoodsid != null and fGoodsid != ''">and tw.f_goodsid = #{fGoodsid}</if>
- <if test="fFeeType != null">and te.f_feetype = #{fFeeType}</if>
- <if test="annual != null and annual != ''">and DATE_FORMAT(tf.f_bsdate,'%Y') = #{annual}</if>
- <if test='monthList != null and monthList[0] != null and monthList[0]!= ""'>
- and DATE_FORMAT(tf.f_bsdate,'%m') >= #{monthList[0]}
- </if>
- <if test='monthList != null and monthList[1] != null and monthList[1]!= ""'>
- and DATE_FORMAT(tf.f_bsdate,'%m') <= #{monthList[1]}
- </if>
- GROUP BY
- DATE_FORMAT( tf.f_bsdate, '%Y' ),
- DATE_FORMAT( tf.f_bsdate, '%m' ),
- tw.f_goodsid
- ORDER BY
- DATE_FORMAT( tf.f_bsdate, '%Y' ),
- DATE_FORMAT( tf.f_bsdate, '%m' )
- ) sq ON sq.fGoodid = xs.fGoodid
- AND sq.years = xs.years
- AND sq.months = xs.months
- UNION ALL
- SELECT
- sq.years AS years,
- sq.months AS months,
- sq.fGoodid AS fGoodid,
- IFNULL( xs.pay, 0 ) AS market,
- IFNULL( sq.collect, 0 ) AS purchase,
- CASE WHEN xs.pay IS NOT NULL AND sq.collect IS NOT NULL THEN xs.pay-sq.collect
- WHEN xs.pay IS NULL AND sq.collect IS NOT NULL THEN 0 -sq.collect
- WHEN xs.pay IS NOT NULL AND sq.collect IS NULL THEN xs.pay- 0
- END AS profit
- FROM
- (
- SELECT
- tw.f_goodsid AS fGoodid,
- DATE_FORMAT( tf.f_bsdate, '%Y' ) AS years,
- DATE_FORMAT( tf.f_bsdate, '%m' ) AS months,
- IFNULL( SUM( tf.f_amount ), 0 ) AS collect
- FROM
- t_warehousebillsfees tf
- LEFT JOIN t_warehousebills tw ON tf.f_pid = tw.f_id
- WHERE
- tf.f_billtype = 'CK'
- AND tf.del_flag = '0'
- AND tw.del_flag = '0'
- <if test="fBillstatus != null and fBillstatus != ''">and tf.f_billstatus = #{fBillstatus}</if>
- <if test="fGoodsid != null and fGoodsid != ''">and tw.f_goodsid = #{fGoodsid}</if>
- <if test="fFeeType != null">and te.f_feetype = #{fFeeType}</if>
- <if test="annual != null and annual != ''">and DATE_FORMAT(tf.f_bsdate,'%Y') = #{annual}</if>
- <if test='monthList != null and monthList[0] != null and monthList[0]!= ""'>
- and DATE_FORMAT(tf.f_bsdate,'%m') >= #{monthList[0]}
- </if>
- <if test='monthList != null and monthList[1] != null and monthList[1]!= ""'>
- and DATE_FORMAT(tf.f_bsdate,'%m') <= #{monthList[1]}
- </if>
- GROUP BY
- DATE_FORMAT( tf.f_bsdate, '%Y' ),
- DATE_FORMAT( tf.f_bsdate, '%m' ),
- tw.f_goodsid
- ORDER BY
- DATE_FORMAT( tf.f_bsdate, '%Y' ),
- DATE_FORMAT( tf.f_bsdate, '%m' )
- ) sq
- LEFT JOIN (
- SELECT
- tw.f_goodsid AS fGoodid,
- DATE_FORMAT( tf.f_bsdate, '%Y' ) AS years,
- DATE_FORMAT( tf.f_bsdate, '%m' ) AS months,
- IFNULL( SUM( tf.f_amount ), 0 ) AS pay
- FROM
- t_warehousebillsfees tf
- LEFT JOIN t_warehousebills tw ON tf.f_pid = tw.f_id
- WHERE
- tf.f_billtype = 'XS'
- AND tf.del_flag = '0'
- AND tw.del_flag = '0'
- <if test="fBillstatus != null and fBillstatus != ''">and tf.f_billstatus = #{fBillstatus}</if>
- <if test="fGoodsid != null and fGoodsid != ''">and tw.f_goodsid = #{fGoodsid}</if>
- <if test="fFeeType != null">and te.f_feetype = #{fFeeType}</if>
- <if test="annual != null and annual != ''">and DATE_FORMAT(tf.f_bsdate,'%Y') = #{annual}</if>
- <if test='monthList != null and monthList[0] != null and monthList[0]!= "" '>
- and DATE_FORMAT(tf.f_bsdate,'%m') >= #{monthList[0]}
- </if>
- <if test='monthList != null and monthList[1] != null and monthList[1]!= "" '>
- and DATE_FORMAT(tf.f_bsdate,'%m') <= #{monthList[1]}
- </if>
- GROUP BY
- DATE_FORMAT( tf.f_bsdate, '%Y' ),
- DATE_FORMAT( tf.f_bsdate, '%m' ),
- tw.f_goodsid
- ORDER BY
- DATE_FORMAT( tf.f_bsdate, '%Y' ),
- DATE_FORMAT( tf.f_bsdate, '%m' )
- ) xs ON sq.fGoodid = xs.fGoodid
- AND sq.years = xs.years
- AND sq.months = xs.months
- ) AS temp
- LEFT JOIN t_project tp ON tp.f_id = temp.fGoodid
- ORDER BY temp.years,temp.months,CONVERT(tp.f_name USING GBK)
- </select>
- <!--查询入库日期所在年月是否结账-->
- <select id="selectTMonthEndingClosingList" parameterType="object"
- resultType="com.ruoyi.anpin.TMonthEndingClosingExcel">
- select f_id, f_year, f_month, f_start, f_enf, f_status from t_month_ending_closing
- <where>
- <if test="fYear != null and fYear != ''">and f_year = #{fYear}</if>
- <if test="fMonth != null and fMonth != ''">and f_month = #{fMonth}</if>
- <if test="fStatus != null and fStatus != ''">and f_status = #{fStatus}</if>
- </where>
- ORDER BY f_year,f_month
- </select>
- <!--安品库存总账-->
- <select id="selectInventoryLedger" parameterType="TWarehousebills"
- resultType="com.ruoyi.anpin.InventoryLedgerExcel">
- SELECT
- DATE_FORMAT( MAX(tf.f_bsdate), '%Y' ) AS fyears,
- /*年*/
- /* DATE_FORMAT( MAX(tf.f_bsdate), '%m' ) AS fmonth,*/
- /*月*/
- tf.f_corpid AS fCorpid,
- /*供应商*/
- tc.f_name AS fCorpName,
- /*供应商名称*/
- tf.f_feeid AS fFeeid,
- /*货物id*/
- te.f_name AS fFName,
- /*货物名称*/
- te.f_currency AS fCurrency,
- /*规格*/
- te.f_feetype AS feetype,
- /*类别*/
- si.dict_label AS feetypeName,
- /*类别名称*/
- tf.f_feeUnitid AS fFeeUnitid,
- /*计价单位*/
- sc.dict_label AS feeUnitName,
- /*计价单位名称*/
- tf.f_warehouseid AS fWarehouseid,
- /*库区*/
- th.f_warehouse_information AS fWarehouseName,
- /*库区中文名*/
- ifnull(sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate<#{timeInterval[0]} THEN tf.f_qty ELSE 0 END ) + IFNULL( de.fQty, 0 ) - IFNULL( df.fQty, 0 ) - sum(
- CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate<#{timeInterval[0]} THEN tf.f_qty ELSE 0 END ),0) AS fBeginQty,
- /*期初数量*/
- ROUND(
- IFNULL((
- sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate<#{timeInterval[0]} THEN tf.f_amount ELSE 0 END )+ IFNULL( de.fAmount, 0 )- IFNULL( df.fAmount, 0 ) - sum(
- CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate<#{timeInterval[0]} THEN tf.f_amount ELSE 0 END ))/(
- sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate<#{timeInterval[0]} THEN tf.f_qty ELSE 0 END ) + IFNULL( de.fQty, 0 ) - IFNULL( df.fQty, 0 ) - sum( CASE
- WHEN tf.f_billtype='CK' AND tf.f_bsdate<#{timeInterval[0]} THEN tf.f_qty ELSE 0 END )),
- 0
- ),
- 2
- ) AS fBeginUnitprice,
- /*期初单价*/
- IFNULL(sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate<#{timeInterval[0]} THEN tf.f_amount ELSE 0 END )+ IFNULL( de.fAmount, 0 )- IFNULL( df.fAmount, 0 ) -
- sum( CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate<#{timeInterval[0]} THEN tf.f_amount ELSE 0 END ),0) AS
- fBeginAmount,
- /*期初金额*/
- IFNULL(sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate>=#{timeInterval[0]} AND tf.f_bsdate<=#{timeInterval[1]}
- THEN tf.f_qty ELSE 0 END ),0) AS rQty,
- /*入库数量*/
- IFNULL(sum( CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate>=#{timeInterval[0]} AND tf.f_bsdate<=#{timeInterval[1]}
- THEN tf.f_qty ELSE 0 END ),0) AS cQty,
- /*出库数量*/
- IFNULL(sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate>=#{timeInterval[0]} AND tf.f_bsdate<=#{timeInterval[1]}
- THEN tf.f_amount ELSE 0 END ),0) AS rfAmount,
- /*入库金额*/
- IFNULL(sum( CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate>=#{timeInterval[0]} AND tf.f_bsdate<=#{timeInterval[1]}
- THEN tf.f_amount ELSE 0 END ),0) AS cfAmount,
- /*出库金额*/
- IFNULL(sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate<=#{timeInterval[1]} THEN tf.f_qty ELSE 0 END ) + IFNULL( dg.fQty, 0 ) - IFNULL( dh.fQty, 0 ) -
- sum( CASE WHEN tf.f_billtype = 'CK' AND tf.f_bsdate<=#{timeInterval[1]} THEN tf.f_qty ELSE 0 END ),0) AS
- fAfterQty,
- /*结余数量*/
- ROUND(
- IFNULL((
- sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate<=#{timeInterval[1]} THEN tf.f_amount ELSE 0 END ) + IFNULL( dg.fAmount, 0 )- IFNULL( dh.fAmount, 0 ) - sum(
- CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate<=#{timeInterval[1]} THEN tf.f_amount ELSE 0 END ))/(
- sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate<= #{timeInterval[1]} THEN tf.f_qty ELSE 0 END ) + IFNULL( dg.fQty, 0 ) - IFNULL( dh.fQty, 0 ) - sum( CASE
- WHEN tf.f_billtype='CK' AND tf.f_bsdate<=#{timeInterval[1]} THEN tf.f_qty ELSE 0 END )),
- 0
- ),
- 2
- ) AS fAfterUnitprice,
- /*结余单价*/
- IFNULL(sum( CASE WHEN tf.f_billtype='RK' AND tf.f_bsdate<= #{timeInterval[1]} THEN tf.f_amount ELSE 0 END ) + IFNULL( dg.fAmount, 0 )- IFNULL( dh.fAmount, 0 )-
- sum( CASE WHEN tf.f_billtype='CK' AND tf.f_bsdate<= #{timeInterval[1]} THEN tf.f_amount ELSE 0 END ),0) AS
- fAfterAmount, /*结余金额*/
- IFNULL( dr.fQty, 0 ) AS foldQty,
- /*调入数量*/
- IFNULL( dr.fUnitprice, 0 ) AS foldUnitprice,
- /*调入单价*/
- IFNULL( dr.fAmount, 0 ) AS foldAmount,
- /*调入金额*/
- IFNULL( dc.fQty, 0 ) AS calloutQty,
- /*调出数量*/
- IFNULL( dc.fUnitprice, 0 ) AS calloutUnitprice,
- /*调出单价*/
- IFNULL( dc.fAmount, 0 ) AS calloutAmount /*调出金额*/
- FROM
- t_warehousebillsfees tf
- LEFT JOIN t_warehousebills tw ON tf.f_pid = tw.f_id
- LEFT JOIN t_warehouse th ON tf.f_warehouseid = th.f_id
- LEFT JOIN t_fees te ON tf.f_feeid = te.f_id
- LEFT JOIN t_corps tc ON tf.f_corpid = tc.f_id
- LEFT JOIN sys_dict_data sc ON sc.dict_value = tf.f_feeUnitid
- AND sc.dict_type = 'data_unitfees'
- LEFT JOIN sys_dict_data si ON si.dict_value = te.f_feetype
- AND si.dict_type = 'data_cost_attribute'
- LEFT JOIN (
- SELECT
- tf.f_corpid fCorpid,
- tf.f_feeid fFeeid,
- tf.f_feeUnitid fFeeUnitid,
- IFNULL(SUM(tf.f_qty),0) fQty,
- IFNULL(SUM(tf.f_unitprice),0) fUnitprice,
- IFNULL(SUM(tf.f_amount),0) fAmount,
- tf.f_allot_warehouseid fAllotWarehouseid
- FROM
- t_warehousebillsfees tf
- LEFT JOIN t_warehousebills tw ON tw.f_id = tf.f_pid
- WHERE
- tf.f_billtype = 'DB'
- AND tf.del_flag = '0'
- AND tw.f_billstatus = 6
- AND tf.f_bsdate>=#{timeInterval[0]}
- AND tf.f_bsdate<=#{timeInterval[1]}
- GROUP BY tf.f_corpid,tf.f_feeid,tf.f_feeUnitid,tf.f_allot_warehouseid
- ) dr ON tf.f_corpid = dr.fCorpid
- AND tf.f_feeid = dr.fFeeid
- AND tf.f_feeUnitid = dr.fFeeUnitid
- AND tf.f_warehouseid = dr.fAllotWarehouseid
- LEFT JOIN (
- SELECT
- tf.f_corpid fCorpid,
- tf.f_feeid fFeeid,
- tf.f_feeUnitid fFeeUnitid,
- IFNULL(SUM(tf.f_qty),0) fQty,
- IFNULL(SUM(tf.f_unitprice),0) fUnitprice,
- IFNULL(SUM(tf.f_amount),0) fAmount,
- tf.f_warehouseid fwarehouseid
- FROM
- t_warehousebillsfees tf
- LEFT JOIN t_warehousebills tw ON tw.f_id = tf.f_pid
- WHERE
- tf.f_billtype = 'DB'
- AND tf.del_flag = '0'
- AND tw.f_billstatus = 6
- AND tf.f_bsdate>=#{timeInterval[0]}
- AND tf.f_bsdate<=#{timeInterval[1]}
- GROUP BY tf.f_corpid,tf.f_feeid,tf.f_feeUnitid,tf.f_warehouseid
- ) dc ON tf.f_corpid = dc.fCorpid
- AND tf.f_feeid = dc.fFeeid
- AND tf.f_feeUnitid = dc.fFeeUnitid
- AND tf.f_warehouseid = dc.fwarehouseid
- LEFT JOIN (
- SELECT
- tf.f_corpid fCorpid,
- tf.f_feeid fFeeid,
- tf.f_feeUnitid fFeeUnitid,
- IFNULL(SUM(tf.f_qty),0) fQty,
- IFNULL(SUM(tf.f_unitprice),0) fUnitprice,
- IFNULL(SUM(tf.f_amount),0) fAmount,
- tf.f_allot_warehouseid fAllotWarehouseid
- FROM
- t_warehousebillsfees tf
- LEFT JOIN t_warehousebills tw ON tw.f_id = tf.f_pid
- WHERE
- tf.f_billtype = 'DB'
- AND tf.del_flag = '0'
- AND tw.f_billstatus = 6
- AND tf.f_bsdate<=#{timeInterval[0]}
- GROUP BY tf.f_corpid,tf.f_feeid,tf.f_feeUnitid,tf.f_allot_warehouseid
- ) de ON tf.f_corpid = de.fCorpid
- AND tf.f_feeid = de.fFeeid
- AND tf.f_feeUnitid = de.fFeeUnitid
- AND tf.f_warehouseid = de.fAllotWarehouseid
- LEFT JOIN (
- SELECT
- tf.f_corpid fCorpid,
- tf.f_feeid fFeeid,
- tf.f_feeUnitid fFeeUnitid,
- IFNULL(SUM(tf.f_qty),0) fQty,
- IFNULL(SUM(tf.f_unitprice),0) fUnitprice,
- IFNULL(SUM(tf.f_amount),0) fAmount,
- tf.f_warehouseid fwarehouseid
- FROM
- t_warehousebillsfees tf
- LEFT JOIN t_warehousebills tw ON tw.f_id = tf.f_pid
- WHERE
- tf.f_billtype = 'DB'
- AND tf.del_flag = '0'
- AND tw.f_billstatus = 6
- AND tf.f_bsdate<=#{timeInterval[0]}
- GROUP BY tf.f_corpid,tf.f_feeid,tf.f_feeUnitid,tf.f_warehouseid
- ) df ON tf.f_corpid = df.fCorpid
- AND tf.f_feeid = df.fFeeid
- AND tf.f_feeUnitid = df.fFeeUnitid
- AND tf.f_warehouseid = df.fwarehouseid
- LEFT JOIN (
- SELECT
- tf.f_corpid fCorpid,
- tf.f_feeid fFeeid,
- tf.f_feeUnitid fFeeUnitid,
- IFNULL(SUM(tf.f_qty),0) fQty,
- IFNULL(SUM(tf.f_unitprice),0) fUnitprice,
- IFNULL(SUM(tf.f_amount),0) fAmount,
- tf.f_allot_warehouseid fAllotWarehouseid
- FROM
- t_warehousebillsfees tf
- LEFT JOIN t_warehousebills tw ON tw.f_id = tf.f_pid
- WHERE
- tf.f_billtype = 'DB'
- AND tf.del_flag = '0'
- AND tw.f_billstatus = 6
- AND tf.f_bsdate<=#{timeInterval[1]}
- GROUP BY tf.f_corpid,tf.f_feeid,tf.f_feeUnitid,tf.f_allot_warehouseid
- ) dg ON tf.f_corpid = dg.fCorpid
- AND tf.f_feeid = dg.fFeeid
- AND tf.f_feeUnitid = dg.fFeeUnitid
- AND tf.f_warehouseid = dg.fAllotWarehouseid
- LEFT JOIN (
- SELECT
- tf.f_corpid fCorpid,
- tf.f_feeid fFeeid,
- tf.f_feeUnitid fFeeUnitid,
- IFNULL(SUM(tf.f_qty),0) fQty,
- IFNULL(SUM(tf.f_unitprice),0) fUnitprice,
- IFNULL(SUM(tf.f_amount),0) fAmount,
- tf.f_warehouseid fwarehouseid
- FROM
- t_warehousebillsfees tf
- LEFT JOIN t_warehousebills tw ON tw.f_id = tf.f_pid
- WHERE
- tf.f_billtype = 'DB'
- AND tf.del_flag = '0'
- AND tw.f_billstatus = 6
- AND tf.f_bsdate<=#{timeInterval[0]}
- GROUP BY tf.f_corpid,tf.f_feeid,tf.f_feeUnitid,tf.f_warehouseid
- ) dh ON tf.f_corpid = dh.fCorpid
- AND tf.f_feeid = dh.fFeeid
- AND tf.f_feeUnitid = dh.fFeeUnitid
- AND tf.f_warehouseid = dh.fwarehouseid
- WHERE
- tf.f_billtype IN ( 'RK', 'CK' )
- AND tf.del_flag = '0'
- AND tw.del_flag = '0'
- AND tf.f_bsdate<=#{timeInterval[1]}
- <if test="fFeeType != null">and te.f_feetype = #{fFeeType}</if>
- <if test="fBillstatus != null">and tf.f_billstatus = #{fBillstatus}</if>
- <if test="fBillstatus == null">and tf.f_billstatus = 6</if>
- <if test="fCorpid != null ">and tf.f_corpid = #{fCorpid}</if>
- <if test="fWarehouseid != null ">and tw.f_warehouseid = #{fWarehouseid}</if>
- <if test="feeName != null and feeName != ''">and tf.f_feeid = #{feeName}</if>
- GROUP BY
- /*DATE_FORMAT( tf.f_bsdate, '%Y' ),
- DATE_FORMAT( tf.f_bsdate, '%m' ),*/
- tf.f_corpid,
- tf.f_feeid,
- te.f_currency,
- tf.f_feeUnitid,
- tf.f_warehouseid,
- te.f_feetype
- ORDER BY
- DATE_FORMAT( tf.f_bsdate, '%Y' ),
- DATE_FORMAT( tf.f_bsdate, '%m' ),
- CONVERT (
- te.f_name USING GBK)
- </select>
- <!--安品查询费用信息-->
- <select id="selectFeeMessage" parameterType="TWarehousebills" resultType="com.ruoyi.anpin.AnPingOrderMessage">
- SELECT
- tc.f_name AS fCorpName,
- ROUND(temp.LastYear,2) AS LastYear,
- ROUND(temp.January,2) AS January,
- ROUND(temp.February,2) AS February,
- ROUND(temp.March,2) AS March,
- ROUND(temp.April,2) AS April,
- ROUND(temp.May,2) AS May,
- ROUND(temp.June,2) AS June,
- ROUND(temp.July,2) AS July,
- ROUND(temp.August,2) AS August,
- ROUND(temp.September,2) AS September,
- ROUND(temp.October,2) AS October,
- ROUND(temp.November,2) AS November,
- ROUND(temp.December,2) AS December,
- ROUND(SUM(temp.LastYear+temp.January+temp.February+temp.March+temp.April+temp.May+temp.June+
- temp.July+temp.August+temp.September+temp.October+temp.November+temp.December),2) AS total
- FROM
- ( SELECT
- tw.f_corpid AS fCorpid,
- CASE
- YEAR ( tw.f_bsdate )
- WHEN #{annum} THEN
- sum( tf.f_amount ) ELSE 0
- END AS LastYear,
- CASE
- MONTH ( tw.f_bsdate )
- WHEN '1' THEN
- sum( tf.f_amount ) ELSE 0
- END AS January,
- CASE
- MONTH ( tw.f_bsdate )
- WHEN '2' THEN
- sum( tf.f_amount ) ELSE 0
- END AS February,
- CASE
- MONTH ( tw.f_bsdate )
- WHEN '3' THEN
- sum( tf.f_amount ) ELSE 0
- END AS March,
- CASE
- MONTH ( tw.f_bsdate )
- WHEN '4' THEN
- sum( tf.f_amount ) ELSE 0
- END AS April,
- CASE
- MONTH ( tw.f_bsdate )
- WHEN '5' THEN
- sum( tf.f_amount ) ELSE 0
- END AS May,
- CASE
- MONTH ( tw.f_bsdate )
- WHEN '6' THEN
- sum( tf.f_amount ) ELSE 0
- END AS June,
- CASE
- MONTH ( tw.f_bsdate )
- WHEN '7' THEN
- sum( tf.f_amount ) ELSE 0
- END AS July,
- CASE
- MONTH ( tw.f_bsdate )
- WHEN '8' THEN
- sum( tf.f_amount ) ELSE 0
- END AS August,
- CASE
- MONTH ( tw.f_bsdate )
- WHEN '9' THEN
- sum( tf.f_amount ) ELSE 0
- END AS September,
- CASE
- MONTH ( tw.f_bsdate )
- WHEN '10' THEN
- sum( tf.f_amount ) ELSE 0
- END AS October,
- CASE
- MONTH ( tw.f_bsdate )
- WHEN '11' THEN
- sum( tf.f_amount ) ELSE 0
- END AS November,
- CASE
- MONTH ( tw.f_bsdate )
- WHEN '12' THEN
- sum( tf.f_amount ) ELSE 0
- END AS December
- FROM
- t_warehousebillsfees tf
- LEFT JOIN t_warehousebills tw ON tw.f_id = tf.f_pid
- where
- DATE_FORMAT( tw.f_bsdate, '%Y' ) = #{tw.annual}
- <if test="tw.fCorpid != null ">and tw.f_corpid = #{tw.fCorpid}</if>
- <if test="tw.fBillstatus != null">and tw.f_billstatus = #{tw.fBillstatus}</if>
- <if test="tw.fBilltype != null and tw.fBilltype != ''">and tw.f_billtype = #{tw.fBilltype}</if>
- GROUP BY
- tw.f_corpid ) AS temp
- LEFT JOIN t_corps tc ON tc.f_id = temp.fCorpid
- GROUP BY temp.fCorpid
- </select>
- <select id="selectAmount" parameterType="long" resultType="java.math.BigDecimal">
- SELECT
- IFNULL(SUM(tw.f_amount),0.00) famount
- FROM
- t_warehousebillsfees tw
- WHERE f_pid = #{fPid}
- AND tw.del_flag = '0'
- </select>
- <!--安品采购申请统计-->
- <select id="purchaseRequest" parameterType="TWarehousebills"
- resultType="com.ruoyi.anpin.PurchaseRequestExcel">
- SELECT
- td.fCorpid AS fCorpid,/*供应商id*/
- tp.f_name AS fCorpidName,/*供应商中文名*/
- td.ffeetype AS ffeetype,/*物资类别*/
- si.dict_label AS ffeetypeName /*物资类别中文名*/,
- td.fname AS fname,/*物资名*/
- td.fcurrency AS fcurrency,/*规格*/
- td.ffeeunitid AS ffeeunitid,/*计价单位id*/
- sc.dict_label AS ffeeunitidName,/*计价单位中文名*/
- td.fqty AS fqty,/*数量*/
- td.famount AS famount,/*金额*/
- tr.f_name AS fsbuName,/*开票公司*/
- round(td.price,2) AS price/*单价*/
- <if test="groupDate != null and groupDate == 0">
- ,td.fBsdate AS fBsdate/*入库日期*/
- </if>
- FROM
- (
- SELECT
- tc.fCorpid,
- tc.ffeetype,
- tc.fname,
- tc.fcurrency,
- tc.ffeeunitid,
- tc.fBsdate,
- tc.fSbu,
- IFNULL( SUM( tc.fqty ), 0 ) fqty,
- IFNULL( SUM( tc.famount ), 0 ) famount,
- IFNULL( SUM( tc.famount )/ SUM( tc.fqty ), 0 ) price
- FROM
- (
- SELECT
- tb.f_corpid fCorpid,
- /*供应商*/
- tf.f_feetype ffeetype,
- /*物资类别*/
- tf.f_name fname,
- /*物资名*/
- tf.f_currency fcurrency,
- /*规格*/
- tw.f_feeunitid ffeeunitid,
- /*计价单位*/
- tw.f_qty fqty,
- /*实际数量*/
- tw.f_amount famount, /*金额*/
- tb.f_sbu fSbu,/*开票公司*/
- tw.f_bsdate fBsdate/*出库日期*/
- FROM
- t_warehousebillsfees tw
- LEFT JOIN t_warehousebills tb ON tw.f_pid = tb.f_id
- LEFT JOIN t_fees tf ON tw.f_feeid = tf.f_id
- WHERE
- tw.del_flag = '0'
- AND tb.del_flag = '0'
- AND tw.f_billtype = 'SQ'
- <if test="fCorpid != null ">and tb.f_corpid = #{fCorpid}</if>
- <if test="fFeeid != null ">and tw.f_feeid = #{fFeeid}</if>
- <if test="fBillstatus != null">and tw.f_billstatus = #{fBillstatus}</if>
- <if test="fGoodsid != null and fGoodsid != ''">and tb.f_goodsid = #{fGoodsid}</if>
- <if test="fFeeTypeList != null and fFeeTypeList != '[]'">and tf.f_feetype in
- <foreach item="fId" collection="fFeeTypeList" open="(" separator="," close=")">
- #{fId}
- </foreach>
- </if>
- <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
- and tb.f_bsdate >= #{cLoadDate[0]}
- </if>
- <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
- and tb.f_bsdate <= #{cLoadDate[1]}
- </if>
- <if test="fSbu != null ">and tb.f_sbu = #{fSbu}</if>
- ) tc
- GROUP BY
- tc.fCorpid,
- tc.ffeetype,
- tc.fname,
- tc.fcurrency,
- tc.ffeeunitid,
- tc.fSbu
- <if test="groupDate != null and groupDate == 0">
- ,tc.fBsdate
- </if>
- ) td
- LEFT JOIN t_corps tp ON td.fCorpid = tp.f_id
- LEFT JOIN t_corps tr ON tr.f_id = td.fSbu
- LEFT JOIN sys_dict_data sc ON sc.dict_value = td.ffeeunitid AND sc.dict_type = 'data_unitfees'
- LEFT JOIN sys_dict_data si ON si.dict_value = td.ffeetype AND si.dict_type = 'data_cost_attribute'
- ORDER BY
- <if test="groupDate != null and groupDate == 0">
- td.fBsdate DESC,/*入库日期*/
- </if>
- td.fCorpid DESC
- </select>
- <select id="anPinAllotList" parameterType="TWarehousebillsfees"
- resultMap="TWarehousebillsfeesResult">
- select tw.f_id,
- tw.f_pid,
- tw.f_lineno,
- tw.f_corpid,
- tw.f_feeid,
- tf.f_name AS feeName,
- tf.f_currency AS fCurrencyName,
- tw.f_feeUnitid,
- sc.dict_label AS fFeeunitName,
- tw.f_qty,
- tw.f_unitprice,
- tw.f_amount,
- tw.f_currency,
- tw.f_exrate,
- tw.f_taxrate,
- tw.f_dc,
- tw.f_billstatus,
- CASE
- WHEN tw.f_billstatus = '1' THEN
- '保存'
- WHEN tw.f_billstatus = '2' THEN
- '暂存'
- WHEN tw.f_billstatus = '3' THEN
- '审批驳回'
- WHEN tw.f_billstatus = '4' THEN
- '提交审核'
- WHEN tw.f_billstatus = '5' THEN
- '审核中'
- WHEN tw.f_billstatus = '6' THEN
- '审核完成'
- END AS fBillstatusName,
- tw.f_review_date,
- tw.f_statement_no,
- tw.f_accamount,
- tw.f_stlamount,
- tw.f_accamount_date,
- tw.f_invnos,
- tw.f_invamount,
- tw.f_stlamount_no,
- tw.f_askamount,
- tw.f_status,
- tw.f_stlamount_date,
- tw.del_flag,
- tw.create_by,
- tw.create_time,
- tw.update_by,
- tw.update_time,
- tw.remark,
- tw.src_id,
- tw.src_bill_no,
- tw.f_mblno,
- tw.f_product_name,
- tw.f_marks,
- tw.f_chargedate,
- tw.f_billing_deadline,
- tw.f_inventory_days,
- tw.f_amt,
- tw.f_billing_days,
- tw.f_billing_qty,
- tw.f_billtype,
- tw.f_billingway,
- tw.f_bsdate,
- tw.f_originalbilldate,
- IFNULL(tw.f_stltypeid,0) AS f_stltypeid,
- sd.dict_label AS fBillingwayName,
- tw.f_business_type,
- tw.f_src_type_id,
- tw.f_warehouseid,
- th.f_warehouse_information AS fWarehouseName,
- tw.f_purchase,
- tw.t_productdate,
- tw.f_lotno,
- tw.f_valid,
- tw.f_units,
- tw.f_store_env,
- tw.f_isfilles,
- si.dict_label AS fUnitsName,
- st.dict_label AS fStoreEnvName,
- sti.dict_label AS fIsfillesName,
- tw.f_allot_warehouseid,
- te.f_warehouse_information AS fAllotWarehouseName,
- IFNULL(tl.f_grossweightblc,0) AS fGrossweightblc,
- IFNULL(tl.f_volumnblc,0) AS fVolumnblc,
- IFNULL(tl.f_netweightblc,0) AS fNetweightblc,
- tc.f_name AS corpName
- from t_warehousebillsfees tw
- LEFT JOIN t_fees tf ON tw.f_feeid = tf.f_id
- LEFT JOIN t_corps tc ON tw.f_corpid = tc.f_id
- LEFT JOIN t_warehouse th ON tw.f_warehouseid = th.f_id
- LEFT JOIN t_warehouse te ON tw.f_allot_warehouseid = te.f_id
- LEFT JOIN sys_dict_data sc ON sc.dict_value = tw.f_feeUnitid AND sc.dict_type = 'data_unitfees'
- LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_stltypeid AND sd.dict_type = 'f_paymode'
- LEFT JOIN sys_dict_data si ON si.dict_value = tw.f_units AND si.dict_type = 'f_floatunit'
- LEFT JOIN sys_dict_data st ON st.dict_value = tw.f_store_env AND st.dict_type = 'f_StorageEnvironment'
- LEFT JOIN sys_dict_data sti ON sti.dict_value = tw.f_isfilles AND sti.dict_type = 'f_evidence'
- LEFT JOIN t_warehousebills ti ON ti.f_id = tw.f_pid
- LEFT JOIN t_whgenleg tl ON tl.f_corpid = tw.f_corpid AND tl.f_goodsid = tw.f_feeid
- AND tl.f_billingway = tw.f_feeUnitid AND tl.f_warehouse_locationid = tw.f_warehouseid
- <where>
- <if test="fPid != null ">and tw.f_pid = #{fPid}</if>
- <if test="fLineno != null ">and tw.f_lineno = #{fLineno}</if>
- <if test="fCorpid != null ">and tw.f_corpid = #{fCorpid}</if>
- <if test="fFeeid != null ">and tw.f_feeid = #{fFeeid}</if>
- <if test="fFeeunitid != null ">and tw.f_feeUnitid = #{fFeeunitid}</if>
- <if test="fQty != null ">and tw.f_qty = #{fQty}</if>
- <if test="fUnitprice != null ">and tw.f_unitprice = #{fUnitprice}</if>
- <if test="fAmount != null ">and tw.f_amount = #{fAmount}</if>
- <if test="fCurrency != null and fCurrency != ''">and tw.f_currency = #{fCurrency}</if>
- <if test="fExrate != null ">and tw.f_exrate = #{fExrate}</if>
- <if test="fTaxrate != null ">and tw.f_taxrate = #{fTaxrate}</if>
- <if test="fDc != null and fDc != ''">and tw.f_dc = #{fDc}</if>
- <if test="fBillstatus != null and fBillstatus != ''">and tw.f_billstatus = #{fBillstatus}</if>
- <if test="fReviewDate != null ">and tw.f_review_date = #{fReviewDate}</if>
- <if test="fStatementNo != null and fStatementNo != ''">and tw.f_statement_no = #{fStatementNo}</if>
- <if test="fAccamount != null ">and tw.f_accamount = #{fAccamount}</if>
- <if test="fStlamount != null ">and tw.f_stlamount = #{fStlamount}</if>
- <if test="fAccamountDate != null ">and tw.f_accamount_date = #{fAccamountDate}</if>
- <if test="fInvnos != null and fInvnos != ''">and tw.f_invnos = #{fInvnos}</if>
- <if test="fInvamount != null ">and tw.f_invamount = #{fInvamount}</if>
- <if test="fStlamountNo != null and fStlamountNo != ''">and tw.f_stlamount_no = #{fStlamountNo}</if>
- <if test="fAskamount != null ">and tw.f_askamount = #{fAskamount}</if>
- <if test="fStatus != null and fStatus != ''">and tw.f_status = #{fStatus}</if>
- <if test="delFlag != null">and tw.del_flag = #{delFlag}</if>
- <if test="fStlamountDate != null ">and tw.f_stlamount_date = #{fStlamountDate}</if>
- <if test="srcId != null ">and tw.src_id = #{srcId}</if>
- <if test="srcBillNo != null and srcBillNo != ''">and tw.src_bill_no = #{srcBillNo}</if>
- <if test="fMblno != null and fMblno != ''">and tw.f_mblno = #{fMblno}</if>
- <if test="fProductName != null and fProductName != ''">and tw.f_product_name like concat('%',
- #{fProductName},
- '%')
- </if>
- <if test="fMarks != null and fMarks != ''">and tw.f_marks = #{fMarks}</if>
- <if test="fChargedate != null ">and tw.f_chargedate = #{fChargedate}</if>
- <if test="fBillingDeadline != null ">and tw.f_billing_deadline = #{fBillingDeadline}</if>
- <if test="fInventoryDays != null ">and tw.f_inventory_days = #{fInventoryDays}</if>
- <if test="fAmt != null ">and tw.f_amt = #{fAmt}</if>
- <if test="fBillingDays != null ">and tw.f_billing_days = #{fBillingDays}</if>
- <if test="fBillingQty != null ">and tw.f_billing_qty = #{fBillingQty}</if>
- <if test="fBilltype != null and fBilltype != ''">and tw.f_billtype = #{fBilltype}</if>
- <if test="fBillingway != null ">and tw.f_billingway = #{fBillingway}</if>
- <if test="fBsdate != null ">and tw.f_bsdate = #{fBsdate}</if>
- <if test="fOriginalbilldate != null ">and tw.f_originalbilldate = #{fOriginalbilldate}</if>
- <if test="fStltypeid != null">and tw.f_stltypeid = #{fStltypeid},</if>
- <if test="fSrcTypeId != null">and tw.f_src_type_id = #{fSrcTypeId},</if>
- <if test="fWarehouseid != null ">and tw.f_warehouseid = #{fWarehouseid}</if>
- <if test="fPurchase != null ">and tw.f_purchase = #{fPurchase}</if>
- </where>
- ORDER BY tw.f_id
- </select>
- <!--安品调入统计-->
- <select id="selectTWarehouseFold" parameterType="TWarehousebillsfees"
- resultType="com.ruoyi.anpin.WarhousrExcel">
- SELECT tw.f_id AS fId,
- th.f_warehouse_information as wareHouseName,/*仓库*/
- ti.f_bsdate AS fBsdate,/*进货时间*/
- tf.f_name AS feeName,/*物资名称*/
- tf.f_currency AS fCurrencyName,/*物资规格*/
- tw.f_qty AS fQty,/*实际数量*/
- tw.f_amount AS fAmount,/*金额*/
- tw.f_unitprice AS fUnitprice,/*单价*/
- tc.f_name AS corpName,/*供货商*/
- tc.f_manage AS fManage,/*联系人*/
- tc.f_tel AS fTel,/*联系电话*/
- tw.t_productdate AS tProductdate,/*生产日期*/
- tw.f_lotno AS fLotno,/*批次号*/
- CONCAT(tw.f_valid,si.dict_label) AS quality,/*保值期限*/
- st.dict_label AS fStoreEnvName,/*储存环境中文名*/
- sti.dict_label AS fIsfillesName,/*索证索票*/
- std.dict_label AS fFeetype,/*物资类别*/
- sr.user_name AS purchaseName,/*采购人*/
- tp.f_name AS projectName,/*项目名称*/
- CASE
- WHEN tw.f_billtype = 'CK' THEN
- '出库'
- WHEN tw.f_billtype = 'DB' THEN
- '调拨'
- WHEN tw.f_billtype = 'RK' THEN
- '入库'
- END AS fBilltypeName,/*出入库类型*/
- ti.f_sbu AS fSbu,/*开票公司ID*/
- ts.f_name AS fSbuName,/*开票公司名称*/
- sc.dict_label As feeUnitName/*计量单位中文名*/
- FROM t_warehousebillsfees tw
- LEFT JOIN t_fees tf ON tw.f_feeid = tf.f_id
- LEFT JOIN t_warehouse th ON tw.f_warehouseid = th.f_id
- LEFT JOIN sys_dict_data sc ON sc.dict_value = tw.f_feeUnitid
- AND sc.dict_type = 'data_unitfees'
- LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_stltypeid
- AND sd.dict_type = 'f_paymode'
- LEFT JOIN sys_dict_data si ON si.dict_value = tw.f_units
- AND si.dict_type = 'f_floatunit'
- LEFT JOIN sys_dict_data st ON st.dict_value = tw.f_store_env
- AND st.dict_type = 'f_StorageEnvironment'
- LEFT JOIN sys_dict_data sti ON sti.dict_value = tw.f_isfilles
- AND sti.dict_type = 'f_evidence'
- LEFT JOIN t_warehousebills ti ON tw.f_pid = ti.f_id
- LEFT JOIN t_project tp ON ti.f_project = tp.f_id
- LEFT JOIN t_corps tc ON ti.f_corpid = tc.f_id
- LEFT JOIN t_corps ts ON ti.f_sbu = ts.f_id
- LEFT JOIN sys_user sr ON sr.user_id = ti.f_purchase
- LEFT JOIN sys_dict_data std ON std.dict_value = tf.f_feetype
- AND std.dict_type = 'data_cost_attribute'
- <where>
- tw.del_flag = '0'
- and ti.del_flag = '0'
- and tw.f_billtype = 'DB'
- <if test="fBillstatus != null and fBillstatus == 1">and tw.f_billstatus = 6</if>
- <if test="fBillstatus != null and fBillstatus == 2">and tw.f_billstatus != 6</if>
- <if test="fCorpid != null ">and tw.f_corpid = #{fCorpid}</if>
- <if test="fGoodsid != null ">and ti.f_goodsid = #{fGoodsid}</if>
- <if test="fFeeid != null ">and tw.f_feeid = #{fFeeid}</if>
- <if test="fFeeType != null ">and tf.f_feetype = #{fFeeType}</if>
- <if test="fWarehouseid != null ">and ti.f_warehouseid = #{fWarehouseid}</if>
- <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
- and ti.f_bsdate >= #{cLoadDate[0]}
- </if>
- <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
- and ti.f_bsdate <= #{cLoadDate[1]}
- </if>
- </where>
- ORDER BY tw.f_id DESC
- </select>
- <!--安品调出统计-->
- <select id="selectTWarehouseCallout" parameterType="TWarehousebillsfees"
- resultType="com.ruoyi.anpin.WarhousrExcel">
- SELECT tw.f_id AS fId,
- th.f_warehouse_information as wareHouseName,/*仓库*/
- ti.f_bsdate AS fBsdate,/*进货时间*/
- tf.f_name AS feeName,/*物资名称*/
- tf.f_currency AS fCurrencyName,/*物资规格*/
- tw.f_qty AS fQty,/*实际数量*/
- tw.f_amount AS fAmount,/*金额*/
- tw.f_unitprice AS fUnitprice,/*单价*/
- tc.f_name AS corpName,/*供货商*/
- tc.f_manage AS fManage,/*联系人*/
- tc.f_tel AS fTel,/*联系电话*/
- tw.t_productdate AS tProductdate,/*生产日期*/
- tw.f_lotno AS fLotno,/*批次号*/
- CONCAT(tw.f_valid,si.dict_label) AS quality,/*保值期限*/
- st.dict_label AS fStoreEnvName,/*储存环境中文名*/
- sti.dict_label AS fIsfillesName,/*索证索票*/
- std.dict_label AS fFeetype,/*物资类别*/
- sr.user_name AS purchaseName,/*采购人*/
- tp.f_name AS projectName,/*项目名称*/
- CASE
- WHEN tw.f_billtype = 'CK' THEN
- '出库'
- WHEN tw.f_billtype = 'DB' THEN
- '调拨'
- WHEN tw.f_billtype = 'RK' THEN
- '入库'
- END AS fBilltypeName,/*出入库类型*/
- ti.f_sbu AS fSbu,/*开票公司ID*/
- ts.f_name AS fSbuName,/*开票公司名称*/
- sc.dict_label As feeUnitName/*计量单位中文名*/
- FROM t_warehousebillsfees tw
- LEFT JOIN t_fees tf ON tw.f_feeid = tf.f_id
- LEFT JOIN t_warehouse th ON tw.f_allot_warehouseid = th.f_id
- LEFT JOIN sys_dict_data sc ON sc.dict_value = tw.f_feeUnitid
- AND sc.dict_type = 'data_unitfees'
- LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_stltypeid
- AND sd.dict_type = 'f_paymode'
- LEFT JOIN sys_dict_data si ON si.dict_value = tw.f_units
- AND si.dict_type = 'f_floatunit'
- LEFT JOIN sys_dict_data st ON st.dict_value = tw.f_store_env
- AND st.dict_type = 'f_StorageEnvironment'
- LEFT JOIN sys_dict_data sti ON sti.dict_value = tw.f_isfilles
- AND sti.dict_type = 'f_evidence'
- LEFT JOIN t_warehousebills ti ON tw.f_pid = ti.f_id
- LEFT JOIN t_project tp ON ti.f_goodsid = tp.f_id
- LEFT JOIN t_corps tc ON tw.f_corpid = tc.f_id
- LEFT JOIN t_corps ts ON ti.f_sbu = ts.f_id
- LEFT JOIN sys_user sr ON sr.user_id = ti.f_purchase
- LEFT JOIN sys_dict_data std ON std.dict_value = tf.f_feetype
- AND std.dict_type = 'data_cost_attribute'
- <where>
- tw.del_flag = '0'
- and ti.del_flag = '0'
- and tw.f_billtype = 'DB'
- <if test="fBillstatus != null and fBillstatus == 1">and tw.f_billstatus = 6</if>
- <if test="fBillstatus != null and fBillstatus == 2">and tw.f_billstatus != 6</if>
- <if test="fCorpid != null ">and tw.f_corpid = #{fCorpid}</if>
- <if test="fGoodsid != null ">and ti.f_goodsid = #{fGoodsid}</if>
- <if test="fFeeid != null ">and tw.f_feeid = #{fFeeid}</if>
- <if test="fFeeType != null ">and tf.f_feetype = #{fFeeType}</if>
- <if test="fWarehouseid != null ">and ti.f_warehouseid = #{fWarehouseid}</if>
- <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
- and ti.f_bsdate >= #{cLoadDate[0]}
- </if>
- <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
- and ti.f_bsdate <= #{cLoadDate[1]}
- </if>
- </where>
- ORDER BY tw.f_id DESC
- </select>
- <select id="anPinExcePort" parameterType="TWarehousebillsfees"
- resultType="com.ruoyi.anpin.AnPinExcePort">
- select tw.f_id,
- tw.f_pid,
- tw.f_lineno,
- tw.f_corpid,
- tw.f_feeid,
- tf.f_name AS feeName,
- tf.f_currency AS fCurrencyName,
- tw.f_feeUnitid,
- sc.dict_label AS fFeeunitName,
- tw.f_qty AS fQty,
- tw.f_unitprice AS fUnitprice,
- tw.f_amount AS fAmount,
- tw.f_currency,
- tw.f_exrate,
- tw.f_taxrate,
- tw.f_dc,
- tw.f_billstatus,
- CASE
- WHEN tw.f_billstatus = '1' THEN
- '保存'
- WHEN tw.f_billstatus = '2' THEN
- '暂存'
- WHEN tw.f_billstatus = '3' THEN
- '审批驳回'
- WHEN tw.f_billstatus = '4' THEN
- '提交审核'
- WHEN tw.f_billstatus = '5' THEN
- '审核中'
- WHEN tw.f_billstatus = '6' THEN
- '审核完成'
- END AS fBillstatusName,
- tw.f_review_date,
- tw.f_statement_no,
- tw.f_accamount,
- tw.f_stlamount,
- tw.f_accamount_date,
- tw.f_invnos,
- tw.f_invamount,
- tw.f_stlamount_no,
- tw.f_askamount,
- tw.f_status,
- tw.f_stlamount_date,
- tw.del_flag,
- tw.create_by,
- tw.create_time,
- tw.update_by,
- tw.update_time,
- tw.remark,
- tw.src_id,
- tw.src_bill_no,
- tw.f_mblno,
- tw.f_product_name,
- tw.f_marks,
- tw.f_chargedate,
- tw.f_billing_deadline,
- tw.f_inventory_days,
- tw.f_amt,
- tw.f_billing_days,
- tw.f_billing_qty,
- tw.f_billtype,
- tw.f_billingway,
- tw.f_bsdate,
- tw.f_originalbilldate,
- tw.f_stltypeid,
- sd.dict_label AS fBillingwayName,
- tw.f_business_type,
- tw.f_src_type_id,
- tw.f_warehouseid,
- th.f_warehouse_information AS fWarehouseName,
- tw.f_purchase,
- tw.t_productdate,
- tw.f_lotno,
- tw.f_valid,
- tw.f_units,
- tw.f_store_env,
- tw.f_isfilles,
- si.dict_label AS fUnitsName,
- st.dict_label AS fStoreEnvName,
- sti.dict_label AS fIsfillesName,
- tw.f_allot_warehouseid,
- te.f_warehouse_information AS fAllotWarehouseName,
- IFNULL(tl.f_grossweightblc,0) AS fGrossweightblc,
- IFNULL(tl.f_volumnblc,0) AS fVolumnblc,
- IFNULL(tl.f_netweightblc,0) AS fNetweightblc,
- tc.f_name AS corpName
- from t_warehousebillsfees tw
- LEFT JOIN t_fees tf ON tw.f_feeid = tf.f_id
- LEFT JOIN t_corps tc ON tw.f_corpid = tc.f_id
- LEFT JOIN t_warehouse th ON tw.f_warehouseid = th.f_id
- LEFT JOIN t_warehouse te ON tw.f_allot_warehouseid = te.f_id
- LEFT JOIN sys_dict_data sc ON sc.dict_value = tw.f_feeUnitid AND sc.dict_type = 'data_unitfees'
- LEFT JOIN sys_dict_data sd ON sd.dict_value = tw.f_stltypeid AND sd.dict_type = 'f_paymode'
- LEFT JOIN sys_dict_data si ON si.dict_value = tw.f_units AND si.dict_type = 'f_floatunit'
- LEFT JOIN sys_dict_data st ON st.dict_value = tw.f_store_env AND st.dict_type = 'f_StorageEnvironment'
- LEFT JOIN sys_dict_data sti ON sti.dict_value = tw.f_isfilles AND sti.dict_type = 'f_evidence'
- LEFT JOIN t_warehousebills ti ON ti.f_id = tw.f_pid
- LEFT JOIN t_whgenleg tl ON tl.f_corpid = tw.f_corpid AND tl.f_goodsid = tw.f_feeid
- AND tl.f_billingway = tw.f_feeUnitid AND tl.f_warehouse_locationid = tw.f_warehouseid
- <where>
- tw.del_flag = '0'
- <if test="fPid != null ">and tw.f_pid = #{fPid}</if>
- <if test="fLineno != null ">and tw.f_lineno = #{fLineno}</if>
- <if test="fCorpid != null ">and tw.f_corpid = #{fCorpid}</if>
- <if test="fFeeid != null ">and tw.f_feeid = #{fFeeid}</if>
- <if test="fFeeunitid != null ">and tw.f_feeUnitid = #{fFeeunitid}</if>
- <if test="fQty != null ">and tw.f_qty = #{fQty}</if>
- <if test="fUnitprice != null ">and tw.f_unitprice = #{fUnitprice}</if>
- <if test="fAmount != null ">and tw.f_amount = #{fAmount}</if>
- <if test="fCurrency != null and fCurrency != ''">and tw.f_currency = #{fCurrency}</if>
- <if test="fExrate != null ">and tw.f_exrate = #{fExrate}</if>
- <if test="fTaxrate != null ">and tw.f_taxrate = #{fTaxrate}</if>
- <if test="fDc != null and fDc != ''">and tw.f_dc = #{fDc}</if>
- <if test="fBillstatus != null and fBillstatus != ''">and tw.f_billstatus = #{fBillstatus}</if>
- <if test="fReviewDate != null ">and tw.f_review_date = #{fReviewDate}</if>
- <if test="fStatementNo != null and fStatementNo != ''">and tw.f_statement_no = #{fStatementNo}</if>
- <if test="fAccamount != null ">and tw.f_accamount = #{fAccamount}</if>
- <if test="fStlamount != null ">and tw.f_stlamount = #{fStlamount}</if>
- <if test="fAccamountDate != null ">and tw.f_accamount_date = #{fAccamountDate}</if>
- <if test="fInvnos != null and fInvnos != ''">and tw.f_invnos = #{fInvnos}</if>
- <if test="fInvamount != null ">and tw.f_invamount = #{fInvamount}</if>
- <if test="fStlamountNo != null and fStlamountNo != ''">and tw.f_stlamount_no = #{fStlamountNo}</if>
- <if test="fAskamount != null ">and tw.f_askamount = #{fAskamount}</if>
- <if test="fStatus != null and fStatus != ''">and tw.f_status = #{fStatus}</if>
- <if test="delFlag != null">and tw.del_flag = #{delFlag}</if>
- <if test="fStlamountDate != null ">and tw.f_stlamount_date = #{fStlamountDate}</if>
- <if test="srcId != null ">and tw.src_id = #{srcId}</if>
- <if test="srcBillNo != null and srcBillNo != ''">and tw.src_bill_no = #{srcBillNo}</if>
- <if test="fMblno != null and fMblno != ''">and tw.f_mblno = #{fMblno}</if>
- <if test="fProductName != null and fProductName != ''">and tw.f_product_name like concat('%',
- #{fProductName},
- '%')
- </if>
- <if test="fMarks != null and fMarks != ''">and tw.f_marks = #{fMarks}</if>
- <if test="fChargedate != null ">and tw.f_chargedate = #{fChargedate}</if>
- <if test="fBillingDeadline != null ">and tw.f_billing_deadline = #{fBillingDeadline}</if>
- <if test="fInventoryDays != null ">and tw.f_inventory_days = #{fInventoryDays}</if>
- <if test="fAmt != null ">and tw.f_amt = #{fAmt}</if>
- <if test="fBillingDays != null ">and tw.f_billing_days = #{fBillingDays}</if>
- <if test="fBillingQty != null ">and tw.f_billing_qty = #{fBillingQty}</if>
- <if test="fBilltype != null and fBilltype != ''">and tw.f_billtype = #{fBilltype}</if>
- <if test="fBillingway != null ">and tw.f_billingway = #{fBillingway}</if>
- <if test="fBsdate != null ">and tw.f_bsdate = #{fBsdate}</if>
- <if test="fOriginalbilldate != null ">and tw.f_originalbilldate = #{fOriginalbilldate}</if>
- <if test="fStltypeid != null">and tw.f_stltypeid = #{fStltypeid},</if>
- <if test="fSrcTypeId != null">and tw.f_src_type_id = #{fSrcTypeId},</if>
- <if test="fWarehouseid != null ">and tw.f_warehouseid = #{fWarehouseid}</if>
- <if test="fPurchase != null ">and tw.f_purchase = #{fPurchase}</if>
- </where>
- </select>
- </mapper>
|