| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628 | 
							- <?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.reportManagement.mapper.TWhgenlegMapper">
 
-     <resultMap type="TWhgenleg" id="TWhgenlegResult">
 
-         <result property="fId" column="f_id"/>
 
-         <result property="fAccyear" column="f_accyear"/>
 
-         <result property="fAccmonth" column="f_accmonth"/>
 
-         <result property="fCorpid" column="f_corpid"/>
 
-         <result property="fShipper" column="f_shipper"/>
 
-         <result property="fMblno" column="f_mblno"/>
 
-         <result property="fOriginalbillno" column="f_originalbillno"/>
 
-         <result property="fWarehouseLocationid" column="f_warehouse_locationid"/>
 
-         <result property="fGoodsid" column="f_goodsid"/>
 
-         <result property="fChargedate" column="f_chargedate"/>
 
-         <result property="fTrademodeid" column="f_trademodeid"/>
 
-         <result property="fPreqty" column="f_preqty"/>
 
-         <result property="fWarehouseid" column="f_warehouseid"/>
 
-         <result property="fPregrossweight" column="f_pregrossweight"/>
 
-         <result property="fPrenetweight" column="f_prenetweight"/>
 
-         <result property="fBsdate" column="f_bsdate"/>
 
-         <result property="fQtyd" column="f_qtyD"/>
 
-         <result property="fVolumnd" column="f_volumnD"/>
 
-         <result property="fBillingway" column="f_billingway"/>
 
-         <result property="fGrossweightd" column="f_grossweightD"/>
 
-         <result property="fNetweightd" column="f_netweightD"/>
 
-         <result property="fVolumnc" column="f_volumnC"/>
 
-         <result property="fVolumnblc" column="f_volumnblc"/>
 
-         <result property="fQtyc" column="f_qtyC"/>
 
-         <result property="fGrossweightc" column="f_grossweightC"/>
 
-         <result property="fQtyblc" column="f_qtyblc"/>
 
-         <result property="fGrossweightblc" column="f_grossweightblc"/>
 
-         <result property="fNetweightc" column="f_netweightC"/>
 
-         <result property="fNetweightblc" column="f_netweightblc"/>
 
-         <result property="fCntrno" column="f_cntrno"/>
 
-         <result property="fStatus" column="f_status"/>
 
-         <result property="delFlag" column="del_flag"/>
 
-         <result property="createBy" column="create_by"/>
 
-         <result property="fMarks" column="f_marks"/>
 
-         <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="fBusinessType" column="f_business_type"/>
 
-         <result property="fOriginalbilldate" column="f_originalbilldate"/>
 
-         <result property="fLocalcntrno" column="f_localcntrno"/>
 
-         <result property="fCustomno" column="f_customno"/>
 
-         <result property="fEmsSeqNo" column="f_ems_seq_no"/>
 
-         <result property="lockStatus" column="lock_status"/>
 
-         <result property="belongTo" column="belong_to"/>
 
-         <result property="lockTime" column="lock_time"/>
 
-         <result property="unlockTime" column="unlock_time"/>
 
-         <result property="wrNumber" column="wr_number"/>
 
-         <result property="checklists" column="checklists"/>
 
-     </resultMap>
 
-     <resultMap type="CalculateStorageFeesInfoVO" id="StorageFeesInfoResult">
 
-         <result property="fId" column="f_id"/>
 
-         <result property="warehouse" column="f_warehouseid"/>
 
-         <result property="fBillno" column="f_billno"/>
 
-         <result property="fGoodsid" column="f_goodsid"/>
 
-         <result property="fBsdate" column="f_bsdate"/>
 
-         <result property="fBillingway" column="f_billingway"/>
 
-         <result property="fBsdate" column="f_bsdate"/>
 
-         <result property="fChargedate" column="f_chargedate"/>
 
-         <result property="fSrcBsdate" column="f_src_bsdate"/>
 
-         <result property="fOriginalbilldate" column="f_originalbilldate"/>
 
-         <result property="fMblno" column="f_mblno"/>
 
-         <result property="fVolumn" column="f_volumn"/>
 
-         <result property="fMarks" column="f_marks"/>
 
-         <result property="ifCntrno" column="if_cntrno"/>
 
-         <result property="fBillingDays" column="f_billing_days"/>
 
-         <result property="fIsInventory" column="f_is_inventory"/>
 
-         <result property="fQty" column="f_qty"/>
 
-         <result property="warehouseLocationid" column="f_warehouse_locationid"/>
 
-         <result property="fOrgwarehouseInformation" column="f_orgwarehouse_information"/>
 
-         <result property="fGrossweight" column="f_grossweight"/>
 
-         <result property="fNetweight" column="f_netweight"/>
 
-         <result property="fBilltype" column="f_billtype"/>
 
-         <result property="fTypeid" column="f_typeid"/>
 
-         <result property="fCntrno" column="f_cntrno"/>
 
-         <result property="goodsName" column="goods_name"/>
 
-     </resultMap>
 
-     <resultMap type="whgenlegVO" id="WhgenlegInfoResult">
 
-         <result property="fId" column="f_id"/>
 
-         <result property="corpName" column="corp_name"/>
 
-         <result property="fMblno" column="f_mblno"/>
 
-         <result property="fBusinessType" column="f_business_type"/>
 
-         <result property="fMarks" column="f_marks"/>
 
-         <result property="fBsdate" column="f_bsdate"/>
 
-         <result property="fTrademodeid" column="f_trademodeid"/>
 
-         <result property="fBilltype" column="f_billtype"/>
 
-         <result property="qty" column="f_qty"/>
 
-         <result property="grossweight" column="f_netweight"/>
 
-         <result property="netweight" column="f_grossweight"/>
 
-     </resultMap>
 
-     <sql id="selectTWhgenlegVo">
 
-         select f_id, f_accyear, f_accmonth, f_corpid, f_shipper, f_mblno, f_originalbillno, f_warehouse_locationid, f_goodsid, f_trademodeid, f_preqty,
 
-          f_pregrossweight, f_warehouseid, f_prenetweight, f_bsdate, f_chargedate, f_volumnD, f_qtyD, f_billingway, f_grossweightD, f_netweightD, f_volumnC,
 
-           f_qtyC, f_grossweightC, f_qtyblc, f_grossweightblc, f_netweightC, f_netweightblc, f_cntrno, f_status, del_flag, f_marks, create_by,
 
-            create_time, update_by, f_volumnblc, update_time, remark, f_business_type, f_originalbilldate, f_localcntrno,f_customno,f_ems_seq_no,
 
-                lock_status, belong_to, lock_time, unlock_time, wr_number,checklists from t_whgenleg
 
-     </sql>
 
-     <select id="selectTWhgenlegList" parameterType="TWhgenleg" resultMap="TWhgenlegResult">
 
-         select
 
-             ware.*
 
-         from
 
-             t_whgenleg ware
 
-             left join sys_user u on ware.create_by = u.user_name
 
-             left join sys_dept d on u.dept_id = d.dept_id
 
-         <where>
 
-             <if test="fOriginalbillno != null  and fOriginalbillno != ''">and f_originalbillno = #{fOriginalbillno}</if>
 
-             <if test="fBsdate != null ">and f_bsdate = #{fBsdate}</if>
 
-             <if test="fChargedate != null ">and f_chargedate = #{fChargedate}</if>
 
-             <if test="fPreqty != null ">and f_preqty = #{fPreqty}</if>
 
-             <if test="fWarehouseid != null ">and f_warehouseid = #{fWarehouseid}</if>
 
-             <if test="fPregrossweight != null ">and f_pregrossweight = #{fPregrossweight}</if>
 
-             <if test="fPrenetweight != null ">and f_prenetweight = #{fPrenetweight}</if>
 
-             <if test="fQtyd != null ">and f_qtyD = #{fQtyd}</if>
 
-             <if test="fVolumnd != null ">and f_volumnD = #{fVolumnd}</if>
 
-             <if test="fBillingway != null ">and f_billingway = #{fBillingway}</if>
 
-             <if test="fGrossweightd != null ">and f_grossweightD = #{fGrossweightd}</if>
 
-             <if test="fNetweightd != null ">and f_netweightD = #{fNetweightd}</if>
 
-             <if test="fVolumnc != null ">and f_volumnC = #{fVolumnc}</if>
 
-             <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
 
-             <if test="fShipper != null and fShipper != ''">and f_shipper like concat('%', #{fShipper}, '%')</if>
 
-             <if test="fBusinessType != null "> and f_business_type = #{fBusinessType}</if>
 
-             <if test="fQtyc != null ">and f_qtyC = #{fQtyc}</if>
 
-             <if test="fGrossweightc != null ">and f_grossweightC = #{fGrossweightc}</if>
 
-             <if test="fQtyblc != null ">and f_qtyblc = #{fQtyblc}</if>
 
-             <if test="fGrossweightblc != null ">and f_grossweightblc = #{fGrossweightblc}</if>
 
-             <if test="fNetweightc != null ">and f_netweightC = #{fNetweightc}</if>
 
-             <if test="fNetweightblc != null ">and f_netweightblc = #{fNetweightblc}</if>
 
-             <if test="fCntrno != null  and fCntrno != ''">and f_cntrno = #{fCntrno}</if>
 
-             <if test="fStatus != null  and fStatus != ''">and f_status = #{fStatus}</if>
 
-             <if test="fMarks != null  and fMarks != ''">and f_marks = #{fMarks}</if>
 
-             <if test="fOriginalbilldate != null ">and f_originalbilldate = #{fOriginalbilldate}</if>
 
-             <if test="checklists != null and checklists != ''">and checklists = #{checklists}</if>
 
-             <if test="fMblno != null and fMblno != ''">and f_mblno like concat('%',#{fMblno},'%')</if>
 
-         </where>
 
-         ${params.dataScope}
 
-     </select>
 
-     <select id="selectTWhgenleg" parameterType="TWhgenleg" resultMap="TWhgenlegResult">
 
-         <include refid="selectTWhgenlegVo"/>
 
-         <where>
 
-             <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
 
-             <if test="fShipper != null ">and f_shipper = #{fShipper}</if>
 
-             <if test="fMblno != null ">and f_mblno = #{fMblno}</if>
 
-             <if test="fCntrno != null ">and f_cntrno = #{fCntrno}</if>
 
-             <if test="fBusinessType != null ">and f_business_type = #{fBusinessType}</if>
 
-             <if test="fMarks != null ">and f_marks = #{fMarks}</if>
 
-             <if test="fBsdate != null ">and f_bsdate = date_format(#{fBsdate},'%Y-%m-%d')</if>
 
-             <if test="fOriginalbilldate != null ">and f_originalbilldate = #{fOriginalbilldate}</if>
 
-             <if test="fWarehouseLocationid != null ">and f_warehouse_locationid = #{fWarehouseLocationid}</if>
 
-             <if test="fGoodsid != null ">and f_goodsid = #{fGoodsid}</if>
 
-             <if test="fTrademodeid != null ">and f_trademodeid = #{fTrademodeid}</if>
 
-         </where>
 
-     </select>
 
- <!--
 
-     <select id="selectTWhgenleg" parameterType="TWhgenleg" resultMap="TWhgenlegResult">
 
-         <include refid="selectTWhgenlegVo"/>
 
-         <where>
 
-             <if test="fCorpid != null ">and f_corpid = #{fCorpid}</if>
 
-             <if test="fMblno != null ">and f_mblno = #{fMblno}</if>
 
-             <if test="fCntrno != null ">and f_cntrno = #{fCntrno}</if>
 
-             <if test="fBusinessType != null ">and f_business_type = #{fBusinessType}</if>
 
-             <if test="fMarks != null ">and f_marks = #{fMarks}</if>
 
-             <if test="fOriginalbilldate != null ">and f_originalbilldate = #{fOriginalbilldate}</if>
 
-             <if test="fWarehouseLocationid != null ">and f_warehouse_locationid = #{fWarehouseLocationid}</if>
 
-             <if test="fGoodsid != null ">and f_goodsid = #{fGoodsid}</if>
 
-             <if test="fTrademodeid != null ">and f_trademodeid = #{fTrademodeid}</if>
 
-         </where>
 
-     </select>
 
- -->
 
-     <select id="selectTWhgenlegById" parameterType="Long" resultMap="TWhgenlegResult">
 
-         <include refid="selectTWhgenlegVo"/>
 
-         where f_id = #{fId}
 
-     </select>
 
-     <insert id="insertTWhgenleg" parameterType="TWhgenleg">
 
-         insert into t_whgenleg
 
-         <trim prefix="(" suffix=")" suffixOverrides=",">
 
-             <if test="fAccyear != null">f_accyear,</if>
 
-             <if test="fAccmonth != null">f_accmonth,</if>
 
-             <if test="fCorpid != null">f_corpid,</if>
 
-             <if test="fShipper != null">f_shipper,</if>
 
-             <if test="fMblno != null">f_mblno,</if>
 
-             <if test="fOriginalbillno != null">f_originalbillno,</if>
 
-             <if test="fWarehouseLocationid != null">f_warehouse_locationid,</if>
 
-             <if test="fGoodsid != null">f_goodsid,</if>
 
-             <if test="fTrademodeid != null">f_trademodeid,</if>
 
-             <if test="fPreqty != null">f_preqty,</if>
 
-             <if test="fPregrossweight != null">f_pregrossweight,</if>
 
-             <if test="fWarehouseid != null">f_warehouseid,</if>
 
-             <if test="fPrenetweight != null">f_prenetweight,</if>
 
-             <if test="fBsdate != null">f_bsdate,</if>
 
-             <if test="fChargedate != null">f_chargedate,</if>
 
-             <if test="fVolumnd != null">f_volumnD,</if>
 
-             <if test="fQtyd != null">f_qtyD,</if>
 
-             <if test="fBillingway != null">f_billingway,</if>
 
-             <if test="fGrossweightd != null">f_grossweightD,</if>
 
-             <if test="fNetweightd != null">f_netweightD,</if>
 
-             <if test="fVolumnc != null">f_volumnC,</if>
 
-             <if test="fQtyc != null">f_qtyC,</if>
 
-             <if test="fGrossweightc != null">f_grossweightC,</if>
 
-             <if test="fQtyblc != null">f_qtyblc,</if>
 
-             <if test="fGrossweightblc != null">f_grossweightblc,</if>
 
-             <if test="fNetweightc != null">f_netweightC,</if>
 
-             <if test="fNetweightblc != null">f_netweightblc,</if>
 
-             <if test="fCntrno != null">f_cntrno,</if>
 
-             <if test="fStatus != null">f_status,</if>
 
-             <if test="delFlag != null">del_flag,</if>
 
-             <if test="fMarks != null and fMarks != ''">f_marks,</if>
 
-             <if test="createBy != null">create_by,</if>
 
-             <if test="createTime != null">create_time,</if>
 
-             <if test="updateBy != null">update_by,</if>
 
-             <if test="fVolumnblc != null">f_volumnblc,</if>
 
-             <if test="updateTime != null">update_time,</if>
 
-             <if test="remark != null">remark,</if>
 
-             <if test="fBusinessType != null">f_business_type,</if>
 
-             <if test="fOriginalbilldate != null">f_originalbilldate,</if>
 
-             <if test="fLocalcntrno != null">f_localcntrno,</if>
 
-             <if test="fEmsSeqNo != null">f_ems_seq_no,</if>
 
-             <if test="lockStatus != null">lock_status,</if>
 
-             <if test="belongTo != null">belong_to,</if>
 
-             <if test="lockTime != null">lock_time,</if>
 
-             <if test="unlockTime != null">unlock_time,</if>
 
-             <if test="wrNumber != null">wr_number,</if>
 
-             <if test="checklists != null">checklists,</if>
 
-         </trim>
 
-         <trim prefix="values (" suffix=")" suffixOverrides=",">
 
-             <if test="fAccyear != null">#{fAccyear},</if>
 
-             <if test="fAccmonth != null">#{fAccmonth},</if>
 
-             <if test="fCorpid != null">#{fCorpid},</if>
 
-             <if test="fShipper != null">#{fShipper},</if>
 
-             <if test="fMblno != null">#{fMblno},</if>
 
-             <if test="fOriginalbillno != null">#{fOriginalbillno},</if>
 
-             <if test="fWarehouseLocationid != null">#{fWarehouseLocationid},</if>
 
-             <if test="fGoodsid != null">#{fGoodsid},</if>
 
-             <if test="fTrademodeid != null">#{fTrademodeid},</if>
 
-             <if test="fPreqty != null">#{fPreqty},</if>
 
-             <if test="fPregrossweight != null">#{fPregrossweight},</if>
 
-             <if test="fWarehouseid != null">#{fWarehouseid},</if>
 
-             <if test="fPrenetweight != null">#{fPrenetweight},</if>
 
-             <if test="fBsdate != null">#{fBsdate},</if>
 
-             <if test="fChargedate != null">#{fChargedate},</if>
 
-             <if test="fVolumnd != null">#{fVolumnd},</if>
 
-             <if test="fQtyd != null">#{fQtyd},</if>
 
-             <if test="fBillingway != null">#{fBillingway},</if>
 
-             <if test="fGrossweightd != null">#{fGrossweightd},</if>
 
-             <if test="fNetweightd != null">#{fNetweightd},</if>
 
-             <if test="fVolumnc != null">#{fVolumnc},</if>
 
-             <if test="fQtyc != null">#{fQtyc},</if>
 
-             <if test="fGrossweightc != null">#{fGrossweightc},</if>
 
-             <if test="fQtyblc != null">#{fQtyblc},</if>
 
-             <if test="fGrossweightblc != null">#{fGrossweightblc},</if>
 
-             <if test="fNetweightc != null">#{fNetweightc},</if>
 
-             <if test="fNetweightblc != null">#{fNetweightblc},</if>
 
-             <if test="fCntrno != null">#{fCntrno},</if>
 
-             <if test="fStatus != null">#{fStatus},</if>
 
-             <if test="delFlag != null">#{delFlag},</if>
 
-             <if test="fMarks != null and fMarks != ''">#{fMarks},</if>
 
-             <if test="createBy != null">#{createBy},</if>
 
-             <if test="createTime != null">#{createTime},</if>
 
-             <if test="updateBy != null">#{updateBy},</if>
 
-             <if test="fVolumnblc != null">#{fVolumnblc},</if>
 
-             <if test="updateTime != null">#{updateTime},</if>
 
-             <if test="remark != null">#{remark},</if>
 
-             <if test="fBusinessType != null">#{fBusinessType},</if>
 
-             <if test="fOriginalbilldate != null">#{fOriginalbilldate},</if>
 
-             <if test="fLocalcntrno != null">#{fLocalcntrno},</if>
 
-             <if test="fEmsSeqNo != null">#{fEmsSeqNo},</if>
 
-             <if test="lockStatus != null">#{lockStatus},</if>
 
-             <if test="belongTo != null">#{belongTo},</if>
 
-             <if test="lockTime != null">#{lockTime},</if>
 
-             <if test="unlockTime != null">#{unlockTime},</if>
 
-             <if test="wrNumber != null">#{wrNumber},</if>
 
-             <if test="checklists != null">#{checklists},</if>
 
-         </trim>
 
-     </insert>
 
-     <update id="updateTWhgenleg" parameterType="TWhgenleg">
 
-         update t_whgenleg
 
-         <trim prefix="SET" suffixOverrides=",">
 
-             <if test="fAccyear != null">f_accyear = #{fAccyear},</if>
 
-             <if test="fAccmonth != null">f_accmonth = #{fAccmonth},</if>
 
-             <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
 
-             <if test="fShipper != null">f_shipper = #{fShipper},</if>
 
-             <if test="fMblno != null">f_mblno = #{fMblno},</if>
 
-             <if test="fOriginalbillno != null">f_originalbillno = #{fOriginalbillno},</if>
 
-             <if test="fWarehouseLocationid != null">f_warehouse_locationid = #{fWarehouseLocationid},</if>
 
-             <if test="fGoodsid != null">f_goodsid = #{fGoodsid},</if>
 
-             <if test="fTrademodeid != null">f_trademodeid = #{fTrademodeid},</if>
 
-             <if test="fPreqty != null">f_preqty = #{fPreqty},</if>
 
-             <if test="fPregrossweight != null">f_pregrossweight = #{fPregrossweight},</if>
 
-             <if test="fWarehouseid != null">f_warehouseid = #{fWarehouseid},</if>
 
-             <if test="fPrenetweight != null">f_prenetweight = #{fPrenetweight},</if>
 
-             <if test="fBsdate != null">f_bsdate = #{fBsdate},</if>
 
-             <if test="fChargedate != null">f_chargedate = #{fChargedate},</if>
 
-             <if test="fVolumnd != null">f_volumnD = #{fVolumnd},</if>
 
-             <if test="fQtyd != null">f_qtyD = #{fQtyd},</if>
 
-             <if test="fBillingway != null">f_billingway = #{fBillingway},</if>
 
-             <if test="fGrossweightd != null">f_grossweightD = #{fGrossweightd},</if>
 
-             <if test="fNetweightd != null">f_netweightD = #{fNetweightd},</if>
 
-             <if test="fVolumnc != null">f_volumnC = #{fVolumnc},</if>
 
-             <if test="fQtyc != null">f_qtyC = #{fQtyc},</if>
 
-             <if test="fGrossweightc != null">f_grossweightC = #{fGrossweightc},</if>
 
-             <if test="fQtyblc != null">f_qtyblc = #{fQtyblc},</if>
 
-             <if test="fGrossweightblc != null">f_grossweightblc = #{fGrossweightblc},</if>
 
-             <if test="fNetweightc != null">f_netweightC = #{fNetweightc},</if>
 
-             <if test="fNetweightblc != null">f_netweightblc = #{fNetweightblc},</if>
 
-             <if test="fCntrno != null">f_cntrno = #{fCntrno},</if>
 
-             <if test="fStatus != null">f_status = #{fStatus},</if>
 
-             <if test="delFlag != null">del_flag = #{delFlag},</if>
 
-             <if test="fMarks != null and fMarks != ''">f_marks = #{fMarks},</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="fVolumnblc != null">f_volumnblc = #{fVolumnblc},</if>
 
-             <if test="updateTime != null">update_time = #{updateTime},</if>
 
-             <if test="remark != null">remark = #{remark},</if>
 
-             <if test="fBusinessType != null">f_business_type = #{fBusinessType},</if>
 
-             <if test="fOriginalbilldate != null">f_originalbilldate = #{fOriginalbilldate},</if>
 
-             <if test="fLocalcntrno != null">f_localcntrno = #{fLocalcntrno},</if>
 
-             <if test="fEmsSeqNo != null">f_ems_seq_no = #{fEmsSeqNo},</if>
 
-             <if test="lockStatus != null">lock_status = #{lockStatus},</if>
 
-             <if test="belongTo != null">belong_to = #{belongTo},</if>
 
-             <if test="lockTime != null">lock_time = #{lockTime},</if>
 
-             <if test="unlockTime != null">unlock_time = #{unlockTime},</if>
 
-             <if test="wrNumber != null">wr_number = #{wrNumber},</if>
 
-             <if test="checklists != null and checklists != ''">checklists = #{checklists},</if>
 
-         </trim>
 
-         where f_id = #{fId}
 
-     </update>
 
-     <update id="updateTWhgenlegData" parameterType="Map">
 
-         update t_whgenleg
 
-         <trim prefix="SET" suffixOverrides=",">
 
-             /*判断是否入库*/
 
-             <if test="map.billType == 'SJRK'">
 
-                 f_qtyD = f_qtyD + #{map.warehousebillsitems.fQty},
 
-                 f_volumnD = f_volumnD + #{map.warehousebillsitems.fVolumn},
 
-                 f_netweightD = f_netweightD + #{map.warehousebillsitems.fNetweight},
 
-                 f_grossweightD = f_grossweightD + #{map.warehousebillsitems.fGrossweight},
 
-                 f_qtyblc = f_qtyblc + #{map.warehousebillsitems.fQty}
 
-                 ,f_chargedate = #{map.warehousebillsitems.fBsdate},
 
-                 checklists = #{map.warehousebillsitems.checklists},
 
-                 <if test="map.warehousebillsitems.fCustomno != null  and map.warehousebillsitems.fCustomno != ''">
 
-                     ,f_customno = #{map.warehousebillsitems.fCustomno}
 
-                 </if>
 
-                 <if test="map.warehousebillsitems.remark != null  and map.warehousebillsitems.remark != ''">
 
-                     ,remark = #{map.warehousebillsitems.remark}
 
-                 </if>
 
-             </if>
 
-             /*判断是否撤销入库*/
 
-             <if test="map.billType == 'SJRKRevoke'">
 
-                 f_qtyD = f_qtyD - #{map.warehousebillsitems.fQty},
 
-                 f_volumnD = f_volumnD - #{map.warehousebillsitems.fVolumn},
 
-                 f_netweightD = f_netweightD - #{map.warehousebillsitems.fNetweight},
 
-                 f_grossweightD = f_grossweightD - #{map.warehousebillsitems.fGrossweight},
 
-                 f_qtyblc = f_qtyblc - #{map.warehousebillsitems.fQty}
 
-             </if>
 
-             /*判断是否出库*/
 
-             <if test="map.billType == 'SJCK'">
 
-                 f_qtyC = f_qtyC + #{map.warehousebillsitems.fQty},
 
-                 f_volumnC = f_volumnC + #{map.warehousebillsitems.fVolumn},
 
-                 f_netweightC = f_netweightC + #{map.warehousebillsitems.fNetweight},
 
-                 f_grossweightC = f_grossweightC + #{map.warehousebillsitems.fGrossweight},
 
-                 f_qtyblc = f_qtyblc - #{map.warehousebillsitems.fQty}
 
-             </if>
 
-             /*判断是否撤销出库*/
 
-             <if test="map.billType == 'SJCKRevoke'">
 
-                 f_qtyC = f_qtyC - #{map.warehousebillsitems.fQty},
 
-                 f_volumnC = f_volumnC - #{map.warehousebillsitems.fVolumn},
 
-                 f_netweightC = f_netweightC - #{map.warehousebillsitems.fNetweight},
 
-                 f_grossweightC = f_grossweightC - #{map.warehousebillsitems.fGrossweight},
 
-                 f_qtyblc = f_qtyblc + #{map.warehousebillsitems.fQty}
 
-             </if>
 
-             -- update_by = NOW()
 
-         </trim>
 
-         where f_id = #{map.whgenlegId}
 
-     </update>
 
- <!--
 
-     <update id="updateTWhgenlegData" parameterType="Map">
 
-         update t_whgenleg
 
-         <trim prefix="SET" suffixOverrides=",">
 
-             /*判断是否入库*/
 
-             <if test="map.billType == 'SJRK'">
 
-                 f_qtyD = f_qtyD + #{map.warehousebillsitems.fQty},
 
-                 f_volumnD = f_volumnD + #{map.warehousebillsitems.fVolumn},
 
-                 f_netweightD = f_netweightD + #{map.warehousebillsitems.fNetweight},
 
-                 f_grossweightD = f_grossweightD + #{map.warehousebillsitems.fGrossweight},
 
-                 f_qtyblc = f_qtyblc + #{map.warehousebillsitems.fQty}
 
-                 <if test="map.warehousebillsitems.fBilltype != null  and map.warehousebillsitems.fBilltype == 'HQZY'">
 
-                     ,f_chargedate = #{map.warehousebillsitems.fBsdate}
 
-                 </if>
 
-                 <if test="map.warehousebillsitems.fBilltype != null  and map.warehousebillsitems.fBilltype != 'HQZY'">
 
-                     ,f_chargedate = #{map.warehousebillsitems.fChargedate}
 
-                 </if>
 
-                 <if test="map.warehousebillsitems.fCustomno != null  and map.warehousebillsitems.fCustomno != ''">
 
-                     ,f_customno = #{map.warehousebillsitems.fCustomno}
 
-                 </if>
 
-                 <if test="map.warehousebillsitems.remark != null  and map.warehousebillsitems.remark != ''">
 
-                     ,remark = #{map.warehousebillsitems.remark}
 
-                 </if>
 
-             </if>
 
-             /*判断是否撤销入库*/
 
-             <if test="map.billType == 'SJRKRevoke'">
 
-                 f_qtyD = f_qtyD - #{map.warehousebillsitems.fQty},
 
-                 f_volumnD = f_volumnD - #{map.warehousebillsitems.fVolumn},
 
-                 f_netweightD = f_netweightD - #{map.warehousebillsitems.fNetweight},
 
-                 f_grossweightD = f_grossweightD - #{map.warehousebillsitems.fGrossweight},
 
-                 f_qtyblc = f_qtyblc - #{map.warehousebillsitems.fQty}
 
-             </if>
 
-             /*判断是否出库*/
 
-             <if test="map.billType == 'SJCK'">
 
-                 f_qtyC = f_qtyC + #{map.warehousebillsitems.fQty},
 
-                 f_volumnC = f_volumnC + #{map.warehousebillsitems.fVolumn},
 
-                 f_netweightC = f_netweightC + #{map.warehousebillsitems.fNetweight},
 
-                 f_grossweightC = f_grossweightC + #{map.warehousebillsitems.fGrossweight},
 
-                 f_qtyblc = f_qtyblc - #{map.warehousebillsitems.fQty}
 
-             </if>
 
-             /*判断是否撤销出库*/
 
-             <if test="map.billType == 'SJCKRevoke'">
 
-                 f_qtyC = f_qtyC - #{map.warehousebillsitems.fQty},
 
-                 f_volumnC = f_volumnC - #{map.warehousebillsitems.fVolumn},
 
-                 f_netweightC = f_netweightC - #{map.warehousebillsitems.fNetweight},
 
-                 f_grossweightC = f_grossweightC - #{map.warehousebillsitems.fGrossweight},
 
-                 f_qtyblc = f_qtyblc + #{map.warehousebillsitems.fQty}
 
-             </if>
 
-             -- update_by = NOW()
 
-         </trim>
 
-         where f_id = #{map.whgenlegId}
 
-     </update>
 
- -->
 
-     <delete id="deleteTWhgenlegById" parameterType="Long">
 
-         delete from t_whgenleg where f_id = #{fId}
 
-     </delete>
 
-     <delete id="deleteTWhgenlegByIds" parameterType="String">
 
-         delete from t_whgenleg where f_id in
 
-         <foreach item="fAccyear" collection="array" open="(" separator="," close=")">
 
-             #{fId}
 
-         </foreach>
 
-     </delete>
 
-     <select id="selectGoodsList"  resultType="Map">
 
-         SELECT
 
-             t.f_goodsid AS fGoodsid,
 
-             g.f_name AS fName
 
-         FROM
 
-             t_goods g
 
-             RIGHT JOIN (
 
-             SELECT
 
-                 f_goodsid AS f_goodsid
 
-             FROM
 
-                 t_whgenleg
 
-             GROUP BY
 
-                 f_goodsid
 
-             ) t ON g.f_id = t.f_goodsid
 
-     </select>
 
-     <select id="selectGoodsListWhouse"  resultType="Map">
 
-         SELECT
 
-             t.f_goodsid AS fGoodsid,
 
-             g.f_name AS fName,
 
- 			w.f_name AS fWarehouseName,
 
- 			w.f_totalgross AS fTotalgross,
 
-             t.f_grossweightblc  AS fGrossweightD
 
-         FROM
 
-             t_goods g
 
-             RIGHT JOIN (
 
-             SELECT
 
-                 f_goodsid AS f_goodsid,
 
- 				f_warehouseid AS f_warehouseid,
 
-                 sum( f_grossweightblc ) AS f_grossweightblc
 
-             FROM
 
-                 t_whgenleg
 
-             GROUP BY
 
-                 f_goodsid,
 
- 				f_warehouseid
 
-             ORDER BY
 
-                 sum( f_grossweightblc ) DESC
 
-             ) t ON g.f_id = t.f_goodsid
 
- 			LEFT JOIN  t_warehouse w ON w.f_id = t.f_warehouseid
 
-         <where>
 
-             <if test="fId != null ">and w.f_id = #{fId}</if>
 
-         </where>
 
-     </select>
 
-     <select id="selectWareHouseList" resultType="Map">
 
-         SELECT
 
-             t.f_warehouseid AS fWarehouseid,
 
-             w.f_name AS fName,
 
-             t.f_grossweightblc AS fGrossweightD,
 
- 	        w.f_totalgross AS fTotalgross
 
-         FROM
 
-             t_warehouse w
 
-             RIGHT JOIN (
 
-             SELECT
 
-                 f_warehouseid AS f_warehouseid,
 
-                 sum( f_grossweightblc ) AS f_grossweightblc
 
-             FROM
 
-                 t_whgenleg
 
-             GROUP BY
 
-                 f_warehouseid
 
-             ORDER BY
 
-                 sum( f_grossweightblc ) DESC
 
-             ) t ON w.f_id = t.f_warehouseid
 
-     </select>
 
-     <select id="selectWareHouseListWhouse"  resultType="Map">
 
-         SELECT
 
-             t.f_warehouseid AS fWarehouseid,
 
-             w.f_name AS fName,
 
-             t.f_grossweightblc AS fGrossweightD,
 
-             w.f_totalgross AS fTotalgross
 
-         FROM
 
-             t_warehouse w
 
-         RIGHT JOIN (
 
-         SELECT
 
-             f_warehouseid AS f_warehouseid,
 
-             sum( f_grossweightblc ) AS f_grossweightblc
 
-         FROM
 
-             t_whgenleg
 
-         GROUP BY
 
-             f_warehouseid
 
-         ORDER BY
 
-             sum( f_grossweightblc ) DESC
 
-             ) t ON w.f_id = t.f_warehouseid
 
-         <where>
 
-             <if test="fId != null ">and w.f_id = #{fId}</if>
 
-         </where>
 
-     </select>
 
-     <select id="selectCorpsList" resultType="Map">
 
-         SELECT
 
-             t.f_corpid AS fCorpid,
 
-             c.f_name AS fName
 
-         FROM
 
-             t_corps c
 
-             RIGHT JOIN (
 
-             SELECT
 
-                 f_corpid AS f_corpid
 
-             FROM
 
-                 t_whgenleg
 
-             GROUP BY
 
-                 f_corpid
 
-             ) t ON c.f_id = t.f_corpid
 
-     </select>
 
-     <select id="selectCorpsListWhouse"  resultType="Map">
 
-         SELECT
 
-             t.f_corpid AS fCorpid,
 
-             g.f_name AS fName,
 
-             w.f_name AS fWarehouseName,
 
-             w.f_totalgross AS fTotalgross,
 
-             t.f_grossweightblc  AS fGrossweightD
 
-         FROM
 
-             t_corps g
 
-         RIGHT JOIN (
 
-             SELECT
 
-             f_corpid AS f_corpid,
 
-             f_warehouseid AS f_warehouseid,
 
-             sum( f_grossweightblc ) AS f_grossweightblc
 
-             FROM
 
-             t_whgenleg
 
-             GROUP BY
 
-             f_corpid,
 
-             f_warehouseid
 
-             ORDER BY
 
-             sum( f_grossweightblc ) DESC
 
-             ) t ON g.f_id = t.f_corpid
 
-         LEFT JOIN  t_warehouse w ON w.f_id = t.f_warehouseid
 
-         <where>
 
-             <if test="fId != null ">and w.f_id = #{fId}</if>
 
-         </where>
 
-     </select>
 
-     <select id="selectDateFQtyblcListList"  resultType="Map">
 
-         SELECT
 
-             t.f_originalbilldate AS fOriginalbilldate,
 
-             sum(t.f_qtyblc) AS fQtyblc
 
-         FROM
 
-             t_whgenleg t
 
-         WHERE
 
-             t.f_originalbilldate > #{map.frontday}
 
-             AND t.f_originalbilldate < #{map.nowadays}
 
-         GROUP BY
 
- 	        t.f_originalbilldate
 
-         ORDER BY
 
-             t.f_originalbilldate
 
-     </select>
 
-     <select id="getCorpsByfMblno" parameterType="string" resultType="Map">
 
-         select
 
-             tc.f_id as fId,
 
-             tc.f_name as fName
 
-         from t_warehousebills tw left join t_corps tc on tw.f_corpid = tc.f_id
 
-         <where>
 
-             <if test="fId != null and fId != ''">and tw.f_mblno like concat('%',#{fMblno},'%')</if>
 
-         </where>
 
-         group by tc.f_id, tc.f_name
 
-     </select>
 
-     <select id="selectStorageFeeItemList" parameterType="com.ruoyi.warehouseBusiness.domain.TWarehouseBills" resultType="Map">
 
-         SELECT
 
-             wh.f_id AS fId,
 
-             wh.f_originalbillno AS fBillno,
 
-             wh.f_goodsid AS fGoodsid,
 
-             wh.f_originalbilldate AS fBsdate,
 
-             wh.f_billingway AS fBillingway,
 
-             wh.f_mblno AS fMblno,
 
-             wh.f_chargedate AS fChargedate,
 
-             wh.f_originalbilldate AS fOriginalbilldate,
 
-             wh.f_marks AS fMarks,
 
-             wh.f_cntrno AS fCntrno,
 
-             wh.f_volumnblc AS fVolumn,
 
-             wh.f_qtyblc AS fQty,
 
-             wh.f_grossweightblc AS fGrossweight,
 
-             wh.f_netweightblc AS fNetweight,
 
-             wh.f_warehouseid AS warehouse,
 
-             wh.f_warehouse_locationid AS warehouseLocationid,
 
-             "KCZZ" AS fBilltype,
 
-             goods.if_cntrno AS ifCntrno,
 
-             goods.f_typeid AS fTypeid,
 
-             goods.f_name AS fGoodsids
 
-         FROM
 
-             t_whgenleg wh
 
-             LEFT JOIN t_goods goods ON goods.f_id = wh.f_goodsid
 
-             LEFT JOIN t_warehouse ware ON ware.f_id = wh.f_warehouseid
 
-         <where>
 
-             wh.f_corpid = #{warehouse.fCorpid}
 
-             and ware.f_charg = 1
 
-             and wh.f_chargedate < #{warehouse.fBillingDeadline}
 
-             <if test="warehouse.fGoodsid != null and warehouse.fGoodsid != ''">and wh.f_goodsid = #{warehouse.fGoodsid}</if>
 
-             <if test="warehouse.fMblno != null and warehouse.fMblno != ''">and wh.f_mblno like concat('%',#{warehouse.fMblno},'%')</if>
 
-             <if test="warehouse.fWarehouseid != null and warehouse.fWarehouseid != ''">and wh.f_warehouseid = #{warehouse.fWarehouseid}</if>
 
-         </where>
 
-     </select>
 
-     <select id="selectStorageFeeItemList1" resultType="java.util.Map" resultMap="StorageFeesInfoResult">
 
-         SELECT
 
-             wh.f_id,
 
-             wh.f_originalbillno AS f_billno,
 
-             wh.f_goodsid,
 
-             wh.f_originalbilldate AS f_bsdate,
 
-             wh.f_billingway,
 
-             wh.f_mblno,
 
-             wh.f_chargedate,
 
-             wh.f_originalbilldate AS f_src_bsdate,
 
-             wh.f_originalbilldate,
 
-             wh.f_marks,
 
-             wh.f_cntrno,
 
-             wh.f_volumnblc AS f_volumn,
 
-             wh.f_qtyblc AS f_qty,
 
-             wh.f_grossweightblc AS f_grossweight,
 
-             wh.f_netweightblc AS f_netweight,
 
-             wh.f_warehouseid,
 
-             wh.f_warehouse_locationid,
 
-             'KCZZ' AS f_billtype,
 
-             goods.if_cntrno,
 
-             goods.f_typeid AS f_typeid,
 
-             goods.f_name AS goods_name
 
-         FROM
 
-             t_whgenleg wh
 
-             LEFT JOIN t_goods goods ON goods.f_id = wh.f_goodsid
 
-             LEFT JOIN t_warehouse ware ON ware.f_id = wh.f_warehouseid
 
-         <where>
 
-             wh.f_corpid = #{warehouse.fCorpid}
 
-             and ware.f_charg = 1
 
-             and wh.f_chargedate < #{warehouse.fBillingDeadline}
 
-             <if test="warehouse.fGoodsid != null and warehouse.fGoodsid != ''">and wh.f_goodsid = #{warehouse.fGoodsid}</if>
 
-             <if test="warehouse.fMblno != null and warehouse.fMblno != ''">and wh.f_mblno like concat('%',#{warehouse.fMblno},'%')</if>
 
-             <if test="warehouse.fWarehouseid != null and warehouse.fWarehouseid != ''">and wh.f_warehouseid = #{warehouse.fWarehouseid}</if>
 
-             <if test="warehouse.fTrademodeid != null and warehouse.fTrademodeid != ''">and wh.f_trademodeid = #{warehouse.fTrademodeid}</if>
 
-         </where>
 
-     </select>
 
-     <select id="selectInventoryList" parameterType="TWhgenleg" resultType="Map">
 
-         select
 
-             DISTINCT
 
-             leg.f_id AS fId,
 
-             leg.f_corpid AS fCorpIds,
 
-             leg.f_bsdate AS fBsdate,
 
-             corp.f_name AS fCorpid,
 
-             leg.f_shipper AS fShipper,
 
-             ware.f_warehouse_information AS fWarehouseids,
 
-             area.f_name AS fWarehouseLocationids,
 
-             leg.f_originalbillno AS fOriginalbillno,
 
-             leg.f_warehouse_locationid AS fWarehouseLocationid,
 
-             dict1.dict_label AS fTrademodeid,
 
-             goods.f_name AS fGoodsids,
 
-             leg.f_trademodeid AS fTrademodeids,
 
-             goods.f_packagespecs AS fPackagespecs,
 
-             leg.f_goodsid AS fGoodsid,
 
-             leg.f_volumnD AS fVolumnD,
 
-             leg.f_qtyD AS fQtyD,
 
-             leg.f_mblno AS fMblno,
 
-             leg.f_grossweightD AS fGrossweightD,
 
-             leg.f_netweightD AS fNetweightD,
 
-             leg.f_volumnC AS fVolumnC,
 
-             leg.f_volumnblc AS fVolumnblc,
 
-             leg.f_qtyC AS fQtyC,
 
-             leg.f_business_type AS fBusinessType,
 
-             leg.f_grossweightC AS fGrossweightC,
 
-             leg.f_netweightC AS fNetweightC,
 
-             leg.f_qtyblc AS fQtyblc,
 
-             leg.f_billingway AS fBillingway,
 
-             leg.f_chargedate AS fChargedate,
 
-             leg.f_grossweightblc AS fGrossweightblc,
 
-             leg.f_netweightblc AS fNetweightblc,
 
-             leg.f_localcntrno AS fLocalcntrno,
 
-             dict.dict_label AS fBusinessTypes,
 
-             leg.f_marks AS fMarks,
 
-             DATE_FORMAT( leg.create_time, '%Y-%m-%d' ) AS createTime,
 
-             DATE_FORMAT( leg.f_originalbilldate, '%Y-%m-%d' ) AS fOriginalbilldate,
 
-             leg.f_cntrno AS fCntrno
 
-         FROM
 
-             t_whgenleg leg
 
-             LEFT JOIN t_warehousebillsitems wt on wt.f_marks = leg.f_marks
 
-             left join sys_user u on leg.create_by = u.user_name
 
-             left join sys_dept d on u.dept_id = d.dept_id
 
-             LEFT JOIN t_corps corp ON corp.f_id = leg.f_corpid
 
-             LEFT JOIN t_goods goods ON goods.f_id = leg.f_goodsid
 
-             LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouse_locationid
 
-             LEFT JOIN sys_dict_data dict ON dict.dict_value = leg.f_business_type
 
-             LEFT JOIN t_warehouse_area area ON area.f_id = leg.f_warehouse_locationid
 
-             LEFT JOIN sys_dict_data dict1 ON dict1.dict_value = leg.f_trademodeid
 
-         <where>
 
-             dict.status = '0'
 
-             AND dict1.status = '0'
 
-             AND dict.dict_type = 'storage_type'
 
-             AND dict1.dict_type = 'data_trademodes'
 
-             AND leg.f_qtyD != 0
 
-             AND leg.f_qtyblc > 0
 
-             AND leg.f_grossweightblc > 0
 
-             AND leg.f_netweightblc > 0
 
-             AND leg.f_mblno = wt.f_mblno
 
-             <if test="fOriginalbillno != null  and fOriginalbillno != ''">and leg.f_originalbillno = #{fOriginalbillno}</if>
 
-             <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
 
-             <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
 
-             <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
 
-             <if test='orgStorageDate != null and orgStorageDate[0] != null and orgStorageDate[0]!= ""'>
 
-                 and leg.f_originalbilldate >= #{orgStorageDate[0]}
 
-             </if>
 
-             <if test='orgStorageDate != null and orgStorageDate[1] != null and orgStorageDate[1]!= ""'>
 
-                 and leg.f_originalbilldate <= #{orgStorageDate[1]}
 
-             </if>
 
-             <if test="fPregrossweight != null ">and leg.f_pregrossweight = #{fPregrossweight}</if>
 
-             <if test="fPrenetweight != null ">and leg.f_prenetweight = #{fPrenetweight}</if>
 
-             <if test="fQtyd != null ">and leg.f_qtyD = #{fQtyd}</if>
 
-             <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
 
-             <if test="fGoodsid != null ">and leg.f_goodsid = #{fGoodsid}</if>
 
-             <if test="fVolumnd != null ">and leg.f_volumnD = #{fVolumnd}</if>
 
-             <if test="fGrossweightd != null ">and leg.f_grossweightD = #{fGrossweightd}</if>
 
-             <if test="fNetweightd != null ">and leg.f_netweightD = #{fNetweightd}</if>
 
-             <if test="fVolumnc != null ">and leg.f_volumnC = #{fVolumnc}</if>
 
-             <if test="fQtyc != null ">and leg.f_qtyC = #{fQtyc}</if>
 
-             <if test="fOriginalbilldate != null ">and leg.f_originalbilldate = #{fOriginalbilldate}</if>
 
-             <if test="fMarks != null  and fMarks != ''">and leg.f_marks LIKE  concat('%', #{fMarks}, '%')</if>
 
-             <if test="fQtyblc != null ">and leg.f_qtyblc = #{fQtyblc}</if>
 
-             <if test="fGrossweightc != null ">and leg.f_grossweightC = #{fGrossweightc}</if>
 
-             <if test="fNetweightc != null ">and leg.f_netweightC = #{fNetweightc}</if>
 
-             <if test="fGrossweightblc != null ">and leg.f_grossweightblc = #{fGrossweightblc}</if>
 
-             <if test="fNetweightblc != null ">and leg.f_netweightblc = #{fNetweightblc}</if>
 
-             <if test="fCntrno != null  and fCntrno != ''">and leg.f_cntrno LIKE  concat('%', #{fCntrno}, '%')</if>
 
-             <if test="fMblno != null ">and leg.f_mblno LIKE  concat('%', #{fMblno}, '%') </if>
 
-             <if test="fStatus != null  and fStatus != ''">and leg.f_status = #{fStatus}</if>
 
-             <if test="fWarehouseid != null ">and leg.f_warehouseid = #{fWarehouseid} </if>
 
-             <if test="fLocation != null  and fLocation ==1 ">
 
-                 and leg.f_warehouse_locationid = #{fWarehouseLocationid}
 
-             </if>
 
-             <if test="fLocation != null  and fLocation ==0 ">
 
-                 and ware.ancestors  LIKE  concat('%', #{fWarehouseLocationid}, '%')
 
-             </if>
 
-         </where>
 
-     </select>
 
-     <select id="selectInventoryMapList" parameterType="TWhgenleg" resultType="Map">
 
-         select
 
-             DISTINCT
 
-             leg.f_id AS fId,
 
-             leg.f_corpid AS fCorpIds,
 
-             corp.f_name AS fCorpid,
 
-             leg.f_shipper AS fShipper,
 
-             <if test="isCntrno != 2 ">ware.f_warehouse_information AS fWarehouseids,</if>
 
-             <if test="isCntrno == 2 ">ware.f_name AS fWarehouseids,</if>
 
-             area.f_name AS fWarehouseLocationids,
 
-             leg.f_originalbillno AS fOriginalbillno,
 
-             leg.f_warehouse_locationid AS fWarehouseLocationid,
 
-             dict1.dict_label AS fTrademodeid,
 
-             goods.f_name AS fGoodsids,
 
-             leg.f_trademodeid AS fTrademodeids,
 
-             goods.f_packagespecs AS fPackagespecs,
 
-             leg.f_goodsid AS fGoodsid,
 
-         SUM(leg.f_volumnD) AS fVolumnD,
 
-         SUM(leg.f_qtyD) AS fQtyD,
 
-         leg.f_mblno AS fMblno,
 
-         SUM(leg.f_grossweightD) AS fGrossweightD,
 
-         SUM(leg.f_netweightD) AS fNetweightD,
 
-         SUM(leg.f_volumnC) AS fVolumnC,
 
-         SUM(leg.f_volumnblc) AS fVolumnblc,
 
-         SUM(leg.f_qtyC) AS fQtyC,
 
-         leg.f_business_type AS fBusinessType,
 
-         SUM(leg.f_grossweightC) AS fGrossweightC,
 
-         SUM(leg.f_netweightC) AS fNetweightC,
 
-         SUM(leg.f_qtyblc) AS fQtyblc,
 
-         leg.f_billingway AS fBillingway,
 
-         leg.f_chargedate AS fChargedate,
 
-         SUM(leg.f_grossweightblc) AS fGrossweightblc,
 
-         SUM(leg.f_netweightblc) AS fNetweightblc,
 
-             dict.dict_label AS fBusinessTypes,
 
-             leg.f_marks AS fMarks,
 
-             DATE_FORMAT( leg.create_time, '%Y-%m-%d' ) AS createTime,
 
-             DATE_FORMAT( leg.f_originalbilldate, '%Y-%m-%d' ) AS fOriginalbilldate,
 
-             leg.f_cntrno AS fCntrno,
 
-             leg.f_localcntrno fLocalcntrno,
 
-         leg.lock_status As lockStatus,
 
-         leg.belong_to As belongTo,
 
-         leg.lock_time As lockTime,
 
-         leg.unlock_time As unlockTime,
 
-         leg.wr_number As wrNumber
 
-         FROM
 
-             t_whgenleg leg
 
-             left join sys_user u on leg.create_by = u.user_name
 
-             left join sys_user u1 on leg.create_by = u1.user_name
 
-             left join sys_dept d on u.dept_id = d.dept_id
 
-             LEFT JOIN t_corps corp ON corp.f_id = leg.f_corpid
 
-             LEFT JOIN t_customer_contact tc ON tc.f_pid = corp.f_id
 
-             LEFT JOIN t_goods goods ON goods.f_id = leg.f_goodsid
 
-             <if test="isCntrno != 2 ">LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouse_locationid</if>
 
-             <if test="isCntrno == 2 ">LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouseid</if>
 
-             LEFT JOIN sys_dict_data dict ON dict.dict_value = leg.f_business_type
 
-             LEFT JOIN t_warehouse_area area ON area.f_id = leg.f_warehouse_locationid
 
-             LEFT JOIN sys_dict_data dict1 ON dict1.dict_value = leg.f_trademodeid
 
-         <where>
 
-             dict.status = '0'
 
-             AND dict1.status = '0'
 
-             AND leg.f_qtyD != 0
 
-             <if test="isMblno != null and isMblno == 0 ">
 
-                 AND leg.f_qtyblc != 0
 
-                 AND leg.f_grossweightblc != 0
 
-                 AND leg.f_netweightblc != 0
 
-             </if>
 
-             AND dict.dict_type = 'storage_type'
 
-             AND dict1.dict_type = 'data_trademodes'
 
-             <if test="fOriginalbillno != null  and fOriginalbillno != ''">and leg.f_originalbillno = #{fOriginalbillno}</if>
 
-             <if test="fTel != null  and fTel != ''">and tc.f_tel = #{fTel}</if>
 
-             <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
 
-             <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
 
-             <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
 
-             <if test="fMblno != null ">and leg.f_mblno LIKE  concat('%', #{fMblno}, '%') </if>
 
-             <if test='orgStorageDate != null and orgStorageDate[0] != null and orgStorageDate[0]!= ""'>and leg.f_originalbilldate >= #{orgStorageDate[0]}</if>
 
-             <if test='orgStorageDate != null and orgStorageDate[1] != null and orgStorageDate[1]!= ""'>and leg.f_originalbilldate <= #{orgStorageDate[1]}</if>
 
-             <if test="fPregrossweight != null ">and leg.f_pregrossweight = #{fPregrossweight}</if>
 
-             <if test="fPrenetweight != null ">and leg.f_prenetweight = #{fPrenetweight}</if>
 
-             <if test="fQtyd != null ">and leg.f_qtyD = #{fQtyd}</if>
 
-             <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
 
-             <if test="fGoodsid != null ">and leg.f_goodsid = #{fGoodsid}</if>
 
-             <if test="fVolumnd != null ">and leg.f_volumnD = #{fVolumnd}</if>
 
-             <if test="fGrossweightd != null ">and leg.f_grossweightD = #{fGrossweightd}</if>
 
-             <if test="fNetweightd != null ">and leg.f_netweightD = #{fNetweightd}</if>
 
-             <if test="fVolumnc != null ">and leg.f_volumnC = #{fVolumnc}</if>
 
-             <if test="fQtyc != null ">and leg.f_qtyC = #{fQtyc}</if>
 
-             <if test="fOriginalbilldate != null ">and leg.f_originalbilldate = #{fOriginalbilldate}</if>
 
-             <if test="fMarks != null  and fMarks != ''">and leg.f_marks LIKE  concat('%', #{fMarks}, '%')</if>
 
-             <if test="fQtyblc != null ">and leg.f_qtyblc = #{fQtyblc}</if>
 
-             <if test="fGrossweightc != null ">and leg.f_grossweightC = #{fGrossweightc}</if>
 
-             <if test="fNetweightc != null ">and leg.f_netweightC = #{fNetweightc}</if>
 
-             <if test="fGrossweightblc != null ">and leg.f_grossweightblc = #{fGrossweightblc}</if>
 
-             <if test="fNetweightblc != null ">and leg.f_netweightblc = #{fNetweightblc}</if>
 
-             <if test="fStatus != null  and fStatus != ''">and leg.f_status = #{fStatus}</if>
 
-             <if test="fWarehouseid != null ">and leg.f_warehouseid = #{fWarehouseid} </if>
 
-             <if test="fLocation != null and fLocation ==1 ">and leg.f_warehouse_locationid = #{fWarehouseLocationid}</if>
 
-             <if test="checklists != null and checklists !='' ">and leg.checklists = #{checklists}</if>
 
-             <if test="fCntrno != null  and fCntrno != ''">and leg.f_cntrno  LIKE  concat('%', #{fCntrno}, '%')</if>
 
-             <if test="fLocalcntrno != null  and fLocalcntrno != ''">and leg.f_localcntrno  LIKE  concat('%', #{fLocalcntrno}, '%')</if>
 
-             <if test="fLocation != null  and fLocation ==0 ">and ware.ancestors  LIKE  concat('%', #{fWarehouseLocationid}, '%')</if>
 
-             <if test="isCntrno == null">
 
-                 GROUP BY leg.f_corpid, leg.f_originalbillno, leg.f_originalbilldate, leg.f_warehouse_locationid, leg.f_goodsid, leg.f_trademodeid,leg.f_marks
 
-             </if>
 
-             <if test="isCntrno == 1 ">
 
-                 GROUP BY leg.f_corpid, leg.f_originalbillno, leg.f_originalbilldate, leg.f_warehouse_locationid, leg.f_goodsid, leg.f_trademodeid,leg.f_cntrno,leg.f_marks
 
-             </if>
 
-             <if test="isCntrno == 2 ">GROUP BY leg.f_corpid, leg.f_mblno, leg.f_goodsid, leg.f_warehouseid,leg.f_marks</if>
 
-         </where>
 
-         ${params.dataScope}
 
-         order by leg.f_bsdate desc
 
-     </select>
 
-     <select id="selectAppInventoryMapList" parameterType="TWhgenleg" resultType="Map">
 
-         select
 
-         DISTINCT
 
-         leg.f_id AS fId,
 
-         leg.f_corpid AS fCorpIds,
 
-         corp.f_name AS fCorpid,
 
-         leg.f_shipper AS fShipper,
 
-         ware.f_warehouse_information AS fWarehouseids,
 
-         area.f_name AS fWarehouseLocationids,
 
-         leg.f_originalbillno AS fOriginalbillno,
 
-         leg.f_warehouse_locationid AS fWarehouseLocationid,
 
-         dict1.dict_label AS fTrademodeid,
 
-         goods.f_name AS fGoodsids,
 
-         leg.f_trademodeid AS fTrademodeids,
 
-         goods.f_packagespecs AS fPackagespecs,
 
-         leg.f_goodsid AS fGoodsid,
 
-         IFNULL(SUM(leg.f_volumnD),0) AS fVolumnD,
 
-         IFNULL(SUM(leg.f_qtyD),0) AS fQtyD,
 
-         leg.f_mblno AS fMblno,
 
-         ROUND(IFNULL(SUM(leg.f_grossweightD),0) / 1000, 2)  AS fGrossweightD,
 
-         ROUND(IFNULL(SUM(leg.f_netweightD),0) / 1000, 2) AS fNetweightD,
 
-         IFNULL(SUM(leg.f_volumnC),0) AS fVolumnC,
 
-         IFNULL(SUM(leg.f_volumnblc),0) AS fVolumnblc,
 
-         SUM(leg.f_qtyC) AS fQtyC,
 
-         leg.f_business_type AS fBusinessType,
 
-         ROUND(IFNULL(SUM(leg.f_grossweightC),0) / 1000, 2) AS fGrossweightC,
 
-         ROUND(IFNULL(SUM(leg.f_netweightC),0) / 1000, 2) AS fNetweightC,
 
-         IFNULL(SUM(leg.f_qtyblc),0) AS fQtyblc,
 
-         leg.f_billingway AS fBillingway,
 
-         leg.f_chargedate AS fChargedate,
 
-         ROUND(IFNULL(SUM(leg.f_grossweightblc),0) / 1000, 2) AS fGrossweightblc,
 
-         ROUND(IFNULL(SUM(leg.f_netweightblc),0) / 1000, 2) AS fNetweightblc,
 
-         dict.dict_label AS fBusinessTypes,
 
-         leg.f_marks AS fMarks,
 
-         DATE_FORMAT( leg.create_time, '%Y-%m-%d' ) AS createTime,
 
-         DATE_FORMAT( leg.f_originalbilldate, '%Y-%m-%d' ) AS fOriginalbilldate,
 
-         leg.f_cntrno AS fCntrno,
 
-         leg.f_localcntrno fLocalcntrno
 
-         FROM
 
-         t_whgenleg leg
 
-         left join sys_user u on leg.create_by = u.user_name
 
-         left join sys_user u1 on leg.create_by = u1.user_name
 
-         left join sys_dept d on u.dept_id = d.dept_id
 
-         LEFT JOIN t_corps corp ON corp.f_id = leg.f_corpid
 
-         LEFT JOIN t_customer_contact tc ON tc.f_pid = corp.f_id
 
-         LEFT JOIN t_goods goods ON goods.f_id = leg.f_goodsid
 
-         LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouse_locationid
 
-         LEFT JOIN sys_dict_data dict ON dict.dict_value = leg.f_business_type
 
-         LEFT JOIN t_warehouse_area area ON area.f_id = leg.f_warehouse_locationid
 
-         LEFT JOIN sys_dict_data dict1 ON dict1.dict_value = leg.f_trademodeid
 
-         <where>
 
-             dict.status = '0'
 
-             AND dict1.status = '0'
 
-             AND leg.f_qtyD != 0
 
-             AND dict.dict_type = 'storage_type'
 
-             AND dict1.dict_type = 'data_trademodes'
 
-             <if test="fOriginalbillno != null  and fOriginalbillno != ''">and leg.f_originalbillno = #{fOriginalbillno}</if>
 
-             <if test="fTel != null  and fTel != ''">and tc.f_tel = #{fTel}</if>
 
-             <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
 
-             <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
 
-             <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
 
-             <if test="fMblno != null ">and leg.f_mblno LIKE  concat('%', #{fMblno}, '%') </if>
 
-             <if test='orgStorageDate != null and orgStorageDate[0] != null and orgStorageDate[0]!= ""'>
 
-                 and leg.f_originalbilldate >= #{orgStorageDate[0]}
 
-             </if>
 
-             <if test='orgStorageDate != null and orgStorageDate[1] != null and orgStorageDate[1]!= ""'>
 
-                 and leg.f_originalbilldate <= #{orgStorageDate[1]}
 
-             </if>
 
-             <if test="fPregrossweight != null ">and leg.f_pregrossweight = #{fPregrossweight}</if>
 
-             <if test="fPrenetweight != null ">and leg.f_prenetweight = #{fPrenetweight}</if>
 
-             <if test="fQtyd != null ">and leg.f_qtyD = #{fQtyd}</if>
 
-             <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
 
-             <if test="fGoodsid != null ">and leg.f_goodsid = #{fGoodsid}</if>
 
-             <if test="fVolumnd != null ">and leg.f_volumnD = #{fVolumnd}</if>
 
-             <if test="fGrossweightd != null ">and leg.f_grossweightD = #{fGrossweightd}</if>
 
-             <if test="fNetweightd != null ">and leg.f_netweightD = #{fNetweightd}</if>
 
-             <if test="fVolumnc != null ">and leg.f_volumnC = #{fVolumnc}</if>
 
-             <if test="fQtyc != null ">and leg.f_qtyC = #{fQtyc}</if>
 
-             <if test="fOriginalbilldate != null ">and leg.f_originalbilldate = #{fOriginalbilldate}</if>
 
-             <if test="fMarks != null  and fMarks != ''">and leg.f_marks LIKE  concat('%', #{fMarks}, '%')</if>
 
-             <if test="fQtyblc != null ">and leg.f_qtyblc = #{fQtyblc}</if>
 
-             <if test="fGrossweightc != null ">and leg.f_grossweightC = #{fGrossweightc}</if>
 
-             <if test="fNetweightc != null ">and leg.f_netweightC = #{fNetweightc}</if>
 
-             <if test="fGrossweightblc != null ">and leg.f_grossweightblc = #{fGrossweightblc}</if>
 
-             <if test="fNetweightblc != null ">and leg.f_netweightblc = #{fNetweightblc}</if>
 
-             <if test="fStatus != null  and fStatus != ''">and leg.f_status = #{fStatus}</if>
 
-             <if test="fWarehouseid != null ">and leg.f_warehouseid = #{fWarehouseid} </if>
 
-             <if test="fLocation != null and fLocation ==1 ">
 
-                 and leg.f_warehouse_locationid = #{fWarehouseLocationid}
 
-             </if>
 
-             <if test="fCntrno != null  and fCntrno != ''">
 
-                 and leg.f_cntrno  LIKE  concat('%', #{fCntrno}, '%')
 
-             </if>
 
-             <if test="fLocalcntrno != null  and fLocalcntrno != ''">
 
-                 and leg.f_localcntrno  LIKE  concat('%', #{fLocalcntrno}, '%')
 
-             </if>
 
-             <if test="fLocation != null  and fLocation ==0 ">
 
-                 and ware.ancestors  LIKE  concat('%', #{fWarehouseLocationid}, '%')
 
-             </if>
 
-             GROUP BY leg.f_corpid,leg.f_originalbillno, leg.f_originalbilldate, leg.f_warehouse_locationid, leg.f_goodsid, leg.f_trademodeid
 
-             <if test="isCntrno != null and isCntrno == 0 ">
 
-                 ,leg.f_cntrno
 
-             </if>
 
-             <if test="isMblno != null and isMblno == 0 ">
 
-                 ,leg.f_mblno
 
-             </if>
 
-         </where>
 
-         ${params.dataScope}
 
-         order by leg.f_bsdate desc
 
-     </select>
 
-     <select id="selectWhgenlegMessage" parameterType="TWhgenleg" resultType="com.ruoyi.reportManagement.excel.Whgenleg">
 
-         select
 
-         DISTINCT
 
-         leg.f_id AS fId,
 
-         leg.f_corpid AS fCorpIds,
 
-         corp.f_name AS fCorpid,
 
-         leg.f_shipper AS fShipper,
 
-         <if test="isCntrno != 2 ">ware.f_warehouse_information AS fWarehouseids,</if>
 
-         <if test="isCntrno == 2 ">ware.f_name AS fWarehouseids,</if>
 
-         area.f_name AS fWarehouseLocationids,
 
-         leg.f_originalbillno AS fOriginalbillno,
 
-         leg.f_warehouse_locationid AS fWarehouseLocationid,
 
-         dict1.dict_label AS fTrademodeid,
 
-         goods.f_name AS fGoodsids,
 
-         leg.f_trademodeid AS fTrademodeids,
 
-         goods.f_packagespecs AS fPackagespecs,
 
-         leg.f_goodsid AS fGoodsid,
 
-         SUM(leg.f_volumnD) AS fVolumnD,
 
-         SUM(leg.f_qtyD) AS fQtyD,
 
-         leg.f_mblno AS fMblno,
 
-         SUM(leg.f_grossweightD) AS fGrossweightD,
 
-         SUM(leg.f_netweightD) AS fNetweightD,
 
-         SUM(leg.f_volumnC) AS fVolumnC,
 
-         SUM(leg.f_volumnblc) AS fVolumnblc,
 
-         SUM(leg.f_qtyC) AS fQtyC,
 
-         leg.f_business_type AS fBusinessType,
 
-         SUM(leg.f_grossweightC) AS fGrossweightC,
 
-         SUM(leg.f_netweightC) AS fNetweightC,
 
-         SUM(leg.f_qtyblc) AS fQtyblc,
 
-         leg.f_billingway AS fBillingway,
 
-         leg.f_chargedate AS fChargedate,
 
-         SUM(leg.f_grossweightblc) AS fGrossweightblc,
 
-         SUM(leg.f_netweightblc) AS fNetweightblc,
 
-         leg.f_localcntrno AS fLocalcntrno,
 
-         dict.dict_label AS fBusinessTypes,
 
-         leg.f_marks AS fMarks,
 
-         DATE_FORMAT( leg.create_time, '%Y-%m-%d' ) AS createTime,
 
-         DATE_FORMAT( leg.f_originalbilldate, '%Y-%m-%d' ) AS fOriginalbilldate,
 
-         leg.f_cntrno AS fCntrno
 
-         FROM
 
-         t_whgenleg leg
 
-         left join sys_user u on leg.create_by = u.user_name
 
-         left join sys_dept d on u.dept_id = d.dept_id
 
-         LEFT JOIN t_corps corp ON corp.f_id = leg.f_corpid
 
-         LEFT JOIN t_goods goods ON goods.f_id = leg.f_goodsid
 
-         <if test="isCntrno != 2 ">LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouse_locationid</if>
 
-         <if test="isCntrno == 2 ">LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouseid</if>
 
-         LEFT JOIN sys_dict_data dict ON dict.dict_value = leg.f_business_type
 
-         LEFT JOIN t_warehouse_area area ON area.f_id = leg.f_warehouse_locationid
 
-         LEFT JOIN sys_dict_data dict1 ON dict1.dict_value = leg.f_trademodeid
 
-         <where>
 
-             dict.status = '0'
 
-             AND dict1.status = '0'
 
-             AND leg.f_qtyD != 0
 
-             <if test="isMblno != null and isMblno == 0 ">
 
-                 AND leg.f_qtyblc != 0
 
-                 AND leg.f_grossweightblc != 0
 
-                 AND leg.f_netweightblc != 0
 
-             </if>
 
-             AND dict.dict_type = 'storage_type'
 
-             AND dict1.dict_type = 'data_trademodes'
 
-             <if test="fOriginalbillno != null  and fOriginalbillno != ''">and leg.f_originalbillno = #{fOriginalbillno}</if>
 
-             <if test="fTel != null  and fTel != ''">and tc.f_tel = #{fTel}</if>
 
-             <if test="fPreqty != null ">and leg.f_preqty = #{fPreqty}</if>
 
-             <if test="fCorpid != null ">and leg.f_corpid = #{fCorpid}</if>
 
-             <if test="fShipper != null and fShipper != ''">and leg.f_shipper like concat('%', #{fShipper}, '%')</if>
 
-             <if test="fMblno != null ">and leg.f_mblno LIKE  concat('%', #{fMblno}, '%') </if>
 
-             <if test='orgStorageDate != null and orgStorageDate[0] != null and orgStorageDate[0]!= ""'>and leg.f_originalbilldate >= #{orgStorageDate[0]}</if>
 
-             <if test='orgStorageDate != null and orgStorageDate[1] != null and orgStorageDate[1]!= ""'>and leg.f_originalbilldate <= #{orgStorageDate[1]}</if>
 
-             <if test="fPregrossweight != null ">and leg.f_pregrossweight = #{fPregrossweight}</if>
 
-             <if test="fPrenetweight != null ">and leg.f_prenetweight = #{fPrenetweight}</if>
 
-             <if test="fQtyd != null ">and leg.f_qtyD = #{fQtyd}</if>
 
-             <if test="fTrademodeid != null ">and leg.f_trademodeid = #{fTrademodeid}</if>
 
-             <if test="fGoodsid != null ">and leg.f_goodsid = #{fGoodsid}</if>
 
-             <if test="fVolumnd != null ">and leg.f_volumnD = #{fVolumnd}</if>
 
-             <if test="fGrossweightd != null ">and leg.f_grossweightD = #{fGrossweightd}</if>
 
-             <if test="fNetweightd != null ">and leg.f_netweightD = #{fNetweightd}</if>
 
-             <if test="fVolumnc != null ">and leg.f_volumnC = #{fVolumnc}</if>
 
-             <if test="fQtyc != null ">and leg.f_qtyC = #{fQtyc}</if>
 
-             <if test="fOriginalbilldate != null ">and leg.f_originalbilldate = #{fOriginalbilldate}</if>
 
-             <if test="fMarks != null  and fMarks != ''">and leg.f_marks LIKE  concat('%', #{fMarks}, '%')</if>
 
-             <if test="fQtyblc != null ">and leg.f_qtyblc = #{fQtyblc}</if>
 
-             <if test="fGrossweightc != null ">and leg.f_grossweightC = #{fGrossweightc}</if>
 
-             <if test="fNetweightc != null ">and leg.f_netweightC = #{fNetweightc}</if>
 
-             <if test="fGrossweightblc != null ">and leg.f_grossweightblc = #{fGrossweightblc}</if>
 
-             <if test="fNetweightblc != null ">and leg.f_netweightblc = #{fNetweightblc}</if>
 
-             <if test="fStatus != null  and fStatus != ''">and leg.f_status = #{fStatus}</if>
 
-             <if test="fWarehouseid != null ">and leg.f_warehouseid = #{fWarehouseid} </if>
 
-             <if test="fLocation != null and fLocation ==1 ">and leg.f_warehouse_locationid = #{fWarehouseLocationid}</if>
 
-             <if test="fCntrno != null  and fCntrno != ''">and leg.f_cntrno  LIKE  concat('%', #{fCntrno}, '%')</if>
 
-             <if test="fLocalcntrno != null  and fLocalcntrno != ''">and leg.f_localcntrno  LIKE  concat('%', #{fLocalcntrno}, '%')</if>
 
-             <if test="fLocation != null  and fLocation ==0 ">and ware.ancestors  LIKE  concat('%', #{fWarehouseLocationid}, '%')</if>
 
-             <if test="isCntrno == null">
 
-                 GROUP BY leg.f_corpid, leg.f_originalbillno, leg.f_originalbilldate, leg.f_warehouse_locationid, leg.f_goodsid, leg.f_trademodeid,leg.f_marks
 
-             </if>
 
-             <if test="isCntrno == 1 ">
 
-                 GROUP BY leg.f_corpid, leg.f_originalbillno, leg.f_originalbilldate, leg.f_warehouse_locationid, leg.f_goodsid, leg.f_trademodeid,leg.f_cntrno,leg.f_marks
 
-             </if>
 
-             <if test="isCntrno == 2 ">GROUP BY leg.f_corpid, leg.f_mblno, leg.f_goodsid, leg.f_warehouseid ,leg.f_marks</if>
 
-         </where>
 
-         ${params.dataScope}
 
-         order by leg.f_bsdate desc
 
-     </select>
 
-     <select id="selectWhgenlegList" resultType="java.util.Map">
 
-         select
 
-             DISTINCT
 
-             leg.f_id AS fId,
 
-             corp.f_name AS fCorpid,
 
-             leg.f_shipper AS fShipper,
 
-             DATE_FORMAT( leg.f_originalbilldate, '%Y-%m-%d' ) AS fOriginalbilldate,
 
-             ware.f_warehouse_information AS fWarehouseids,
 
-             ware.f_no AS  fWarehouseNo,
 
-             leg.f_mblno AS fMblno,
 
-             goods.f_id AS fGoodsId,
 
-             goods.f_ems_no AS fEmsNo,
 
-             leg.f_ems_seq_no AS fEmsSeqNo,
 
-             goods.f_goods_ts AS fCodeTs,
 
-             goods.f_wms_dcl_unit AS fWmsDclUnit,
 
-             goods.f_wms_law_unit AS fWmsLawUnit,
 
-             goods.f_name AS fGoodsids,
 
-             goods.f_no AS fGoodsno,
 
-             goods.f_packageid AS goodsPackageId,
 
-             goods.f_specs AS goodsfSpecs,
 
-             leg.f_qtyC AS fQtyC,
 
-             leg.f_warehouse_locationid AS fWLID,
 
-             leg.f_status AS fLegStatus,
 
-             dict.dict_label AS fBusinessTypes,
 
-             sdict.dict_label AS fGoodsType,
 
-             leg.f_marks AS fMarks,
 
-             leg.f_qtyblc AS fQtyblc,
 
-             leg.f_grossweightblc AS fGrossweightblc,
 
-             leg.f_netweightblc AS fNetweightblc,
 
-             cast(leg.f_netweightD AS DECIMAL) AS fNetweightD
 
-         FROM
 
-             t_whgenleg leg
 
-             LEFT JOIN t_corps corp ON corp.f_id = leg.f_corpid
 
-             LEFT JOIN t_goods goods ON goods.f_id = leg.f_goodsid
 
-             LEFT JOIN t_warehouse ware ON ware.f_id = leg.f_warehouse_locationid
 
-             LEFT JOIN sys_dict_data dict ON dict.dict_value = leg.f_business_type
 
-             LEFT JOIN sys_dict_data sdict ON sdict.dict_value = leg.f_trademodeid
 
-             LEFT JOIN t_warehouse_area area ON area.f_id = leg.f_warehouse_locationid
 
-             LEFT JOIN t_warehouse wh ON wh.f_id = leg.f_warehouseid
 
-         <where>
 
-             dict.status = '0'
 
-             AND dict.dict_type = 'storage_type'
 
-             AND sdict.`status` = '0'
 
-             AND sdict.dict_type = 'data_trademodes'
 
-             AND	wh.supervise = 1
 
-             AND leg.f_qtyblc != 0
 
-             AND leg.f_grossweightblc != 0
 
-             AND leg.f_netweightblc != 0
 
-         </where>
 
-     </select>
 
-     <!--根据客户id或加上提单号查询库存不为0的仓库名-->
 
-     <select id="getWarehouse" parameterType="TWhgenleg" resultType="Map">
 
-         SELECT
 
-             DISTINCT
 
-             th.f_id AS fId,
 
-             th.f_name AS fName
 
-         FROM
 
-             t_whgenleg tw
 
-                 LEFT JOIN t_warehouse th ON th.f_id = tw.f_warehouseid
 
-         WHERE
 
-             (tw.f_qtyblc > 0 OR tw.f_grossweightblc > 0 OR f_netweightblc > 0)
 
-           AND f_corpid = #{fCorpid}
 
-           AND f_mblno = #{fMblno}
 
-     </select>
 
-     <select id="queryChangedByFchargedate" resultType="java.lang.Integer">
 
-         SELECT
 
-             count( f_id )
 
-         FROM
 
-             t_whgenleg
 
-         WHERE
 
-             f_chargedate != #{time}
 
-         <foreach collection="ids" item="id" open="and f_id in(" separator="," close=")">
 
-             #{id}
 
-         </foreach>
 
-     </select>
 
-     <select id="selectStockDetailsList" resultMap="WhgenlegInfoResult">
 
-         SELECT
 
-             w.f_id, c.f_name, wh.f_mblno, t.f_business_type, t.f_marks, t.f_bsdate, t.f_billtype, w.f_trademodeid,
 
-                t.f_qty, t.f_grossweight, t.f_netweight
 
-         FROM
 
-             t_whgenleg wh
 
-                 RIGHT JOIN t_corps c ON c.f_id = wh.f_corpid
 
-                 RIGHT JOIN t_warehousebills w ON w.f_corpid = wh.f_corpid
 
-                 AND w.f_trademodeid = wh.f_trademodeid
 
-                 RIGHT JOIN t_warehousebillsitems t ON t.f_pid = w.f_id AND t.f_mblno = wh.f_mblno
 
-                 AND t.f_business_type = wh.f_business_type
 
-                 AND t.f_marks = wh.f_marks
 
-                 AND t.f_goodsid = wh.f_goodsid
 
-                 AND t.f_warehouselocid = wh.f_warehouse_locationid
 
-                 AND IF(w.f_billtype = 'SJRK',  t.f_originalbilldate = wh.f_bsdate, t.f_src_bsdate = wh.f_bsdate)
 
-         WHERE
 
-             wh.f_id = #{fId}
 
-           and w.f_billtype in ('SJRK', 'SJCK')
 
-         GROUP BY t.f_id
 
-     </select>
 
-     <select id="selectOtherDetailsList" resultMap="WhgenlegInfoResult">
 
-         SELECT
 
-             w.f_id, c.f_name, wh.f_mblno, t.f_business_type, t.f_marks, t.f_bsdate, t.f_billtype,
 
-                w.f_trademodeid, t.f_qty, t.f_grossweight, t.f_netweight
 
-         FROM
 
-             t_whgenleg wh
 
-                 RIGHT JOIN t_corps c ON c.f_id = wh.f_corpid
 
-                 RIGHT JOIN t_warehousebills w ON wh.f_corpid in (w.f_corpid, w.f_tocorpid)
 
-                 AND IF ( w.f_billtype = 'HWTG', wh.f_trademodeid IN ( w.f_trademodeid, w.f_new_trademodeid ), w.f_trademodeid = wh.f_trademodeid )
 
-                 RIGHT JOIN t_warehousebillsitems t ON t.f_pid = w.f_id
 
-                 AND t.f_mblno = wh.f_mblno
 
-                 AND t.f_business_type = wh.f_business_type
 
-                 AND t.f_marks = wh.f_marks
 
-                 AND t.f_goodsid = wh.f_goodsid
 
-                 AND wh.f_warehouse_locationid IN ( t.f_warehouselocid, t.f_transfer_warehouselocid )
 
-         WHERE
 
-             wh.f_id = #{fId}
 
-             AND w.f_billtype IN ('CKDB','HWTG','HQZY')
 
-         GROUP BY t.f_id
 
-     </select>
 
-     <select id="stockStatistics" resultType="map">
 
-         select
 
-             <if test="mode == null or mode == ''">round(ifnull(sum(f_grossweightblc), 0) / 1000) as quantity</if>
 
-             <if test="mode != null and mode != ''">
 
-                 case #{mode}
 
-                     when '3' then round(ifnull(sum(f_volumnblc), 0))
 
-                     when '2' then round(ifnull(sum(f_grossweightblc) / 1000, 0))
 
-                     else ifnull(sum(f_qtyblc), 0)
 
-                 end as quantity
 
-             </if>
 
-         from t_whgenleg
 
-         where
 
-             f_qtyD != 0
 
-             and f_qtyblc != 0
 
-             <if test="beginDate != null and beginDate != ''">and f_bsdate >= #{beginDate}</if>
 
-             <if test="endDate != null and endDate != ''">and f_bsdate <= #{endDate}</if>
 
-             <if test="external != null and external != ''">
 
-                 and f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
 
-             </if>
 
-             <if test="warehouseId != null"> and f_warehouseid = #{warehouseId}</if>
 
-             <if test="customerId != null"> and f_corpid = #{customerId}</if>
 
-     </select>
 
-     <select id="stockTeuStatistics" resultType="map">
 
-         select
 
-             ifnull(sum(case tb.f_billtype when 'SJRK' then f_cntrcount end * tr.f_teu), 0) -
 
-             ifnull(sum(case tb.f_billtype when 'SJCK' then f_cntrcount end * tr.f_teu), 0) as quantity
 
-         from t_warehousebills_cntr twc
 
-         left join t_warehousebills tb on twc.f_pid = tb.f_id
 
-         left join t_cntr tr on twc.f_cntrid = tr.f_id
 
-         where tb.f_items_status = '4'
 
-             <if test="beginDate != null and beginDate != ''">and tb.f_bsdate >= #{beginDate}</if>
 
-             <if test="endDate != null and endDate != ''">and tb.f_bsdate <= #{endDate}</if>
 
-             <if test="external != null and external != ''">
 
-                 and tb.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
 
-             </if>
 
-             <if test="warehouseId != null"> and tb.f_warehouseid = #{warehouseId}</if>
 
-             <if test="customerId != null">and tb.f_corpid = #{customerId}</if>
 
-     </select>
 
-     <select id="stockDays" resultType="map">
 
-         select datediff(date_format(now(),'%Y-%m-%d'),date_format(min(f_bsdate),'%Y-%m-%d')) as stockDays
 
-         from t_whgenleg
 
-         where
 
-             f_qtyD != 0
 
-             and f_qtyblc != 0
 
-             <if test="external != null and external != ''">
 
-                 and f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
 
-             </if>
 
-             <if test="warehouseId != null"> and f_warehouseid = #{warehouseId}</if>
 
-             <if test="customerId != null"> and f_corpid = #{customerId}</if>
 
-     </select>
 
-     <select id="stockAfterMonthList" resultType="map">
 
-         select
 
-             tw.f_mblno as fMblno,
 
-             tg.f_name as goodsName,
 
-             tw.f_bsdate as fBsdate,
 
-             tc.f_name as customerName,
 
-             round(ifnull(tw.f_grossweightblc, 0) / 1000, 2) as fGrossweight
 
-         from t_whgenleg tw
 
-         left join t_goods tg on tg.f_id = tw.f_goodsid
 
-         left join t_corps tc on tw.f_corpid = tc.f_id
 
-         where
 
-             tw.f_qtyD != 0
 
-             and tw.f_qtyblc != 0
 
-             and datediff(date_format(now(),'%Y-%m-%d'),date_format(tw.f_bsdate,'%Y-%m-%d')) > 30
 
-             <if test="external != null and external != ''">
 
-                 and tw.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
 
-             </if>
 
-         order by tw.f_bsdate
 
-     </select>
 
-     <select id="biCustomerInfo" resultType="map">
 
-         select
 
-             ifnull(tw.f_shipper, tc.f_cname) as customerName,
 
-             <if test="mode == null or mode == ''">round(ifnull(sum(tw.f_grossweightblc), 0) / 1000) as quantity</if>
 
-             <if test="mode != null and mode != ''">
 
-                 case #{mode}
 
-                 when '3' then round(ifnull(sum(tw.f_volumnblc), 0))
 
-                 when '2' then round(ifnull(sum(tw.f_grossweightblc) / 1000, 0))
 
-                 else ifnull(sum(tw.f_qtyblc), 0)
 
-                 end as quantity
 
-             </if>
 
-         from t_whgenleg tw left join t_corps tc on tw.f_corpid = tc.f_id
 
-         where
 
-             tw.f_qtyD != 0
 
-             and tw.f_qtyblc != 0
 
-             <if test="warehouseId != null"> and tw.f_warehouseid = #{warehouseId}</if>
 
-             <if test="external != null and external != ''">
 
-                 and tw.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
 
-             </if>
 
-             <if test="customerId != null"> and tw.f_corpid = #{customerId}</if>
 
-         group by customerName
 
-         order by quantity desc limit 10
 
-     </select>
 
-     <select id="biWarehouseInfo" resultType="map">
 
-         select
 
-             t.f_cname as customerName,
 
-             <if test="mode == null or mode == ''">round(ifnull(sum(tw.f_grossweightblc), 0) / 1000) as quantity</if>
 
-             <if test="mode != null and mode != ''">
 
-                 case #{mode}
 
-                 when '3' then round(ifnull(sum(tw.f_volumnblc), 0))
 
-                 when '2' then round(ifnull(sum(tw.f_grossweightblc) / 1000, 0))
 
-                 else ifnull(sum(tw.f_qtyblc), 0)
 
-                 end as quantity
 
-             </if>
 
-         from t_whgenleg tw left join t_warehouse t on tw.f_warehouseid = t.f_id
 
-         where
 
-             tw.f_qtyD != 0
 
-             and tw.f_qtyblc != 0
 
-             <if test="external != null and external != ''">
 
-                 and tw.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
 
-             </if>
 
-             <if test="customerId != null"> and tw.f_corpid = #{customerId}</if>
 
-         group by customerName
 
-         order by quantity desc limit 10
 
-     </select>
 
-     <select id="biCustomerTeuInfo" resultType="map">
 
-         select
 
-             ifnull(tb.f_shipper, tc.f_cname) as customerName,
 
-             ifnull(sum(case tb.f_billtype when 'SJRK' then f_cntrcount end * tr.f_teu), 0) -
 
-             ifnull(sum(case tb.f_billtype when 'SJCK' then f_cntrcount end * tr.f_teu), 0) as quantity
 
-         from t_warehousebills_cntr twc
 
-         left join t_warehousebills tb on twc.f_pid = tb.f_id
 
-         left join t_corps tc on tb.f_corpid = tc.f_id
 
-         left join t_cntr tr on twc.f_cntrid = tr.f_id
 
-         where tb.f_items_status = '4'
 
-             <if test="external != null and external != ''">
 
-                 and tb.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
 
-             </if>
 
-             <if test="warehouseId != null"> and tb.f_warehouseid = #{warehouseId}</if>
 
-             <if test="customerId != null">and tb.f_corpid = #{customerId}</if>
 
-         group by customerName
 
-         order by quantity desc limit 10
 
-     </select>
 
-     <select id="biWarehouseTeuInfo" resultType="map">
 
-         select
 
-             t.f_cname as customerName,
 
-             ifnull(sum(case tb.f_billtype when 'SJRK' then f_cntrcount end * tr.f_teu), 0) -
 
-             ifnull(sum(case tb.f_billtype when 'SJCK' then f_cntrcount end * tr.f_teu), 0) as quantity
 
-         from t_warehousebills_cntr twc
 
-         left join t_warehousebills tb on twc.f_pid = tb.f_id
 
-         left join t_warehouse t on tb.f_warehouseid = t.f_id
 
-         left join t_cntr tr on twc.f_cntrid = tr.f_id
 
-         where tb.f_items_status = '4'
 
-             <if test="external != null and external != ''">
 
-                 and tb.f_corpid = (select f_pid from t_customer_contact where f_tel = #{external})
 
-             </if>
 
-             <if test="warehouseId != null"> and tb.f_warehouseid = #{warehouseId}</if>
 
-             <if test="customerId != null">and tb.f_corpid = #{customerId}</if>
 
-         group by customerName
 
-         order by quantity desc limit 10
 
-     </select>
 
-     <select id="warehouseSupervise" resultType="map">
 
-         select f_id as fId,
 
-                parent_id as parentId,
 
-                f_no as fNo,
 
-                f_name as fName,
 
-                f_addr as fAddr,
 
-                f_contacts as fContacts,
 
-                f_tel as fTel
 
-         from t_warehouse
 
-         <where>
 
-             <if test="parent != null">
 
-                 <if test="parent == 100">and supervise = 1</if>
 
-                 and parent_id = #{parent}
 
-             </if>
 
-         </where>
 
-     </select>
 
-     <select id="selectStockList" resultType="Map">
 
-         select DISTINCT
 
-                t3.dict_label as cargoType,
 
-                t2.f_no as cargoNo,
 
-                t2.f_name as cargoName,
 
-                t1.f_qtyD as number,
 
-                t1.f_qtyblc as numberLeft,
 
-                t1.f_grossweightD as weight,
 
-                t1.f_grossweightblc as weightLeft,
 
-                t6.f_packagespecs as speci,
 
-                t6.f_sealno as bondedStatus,
 
-                t4.f_no as shelvesName,
 
-                t5.f_no as warehouseNo,
 
-                t5.f_name as warehouseName,
 
-                t1.f_originalbillno as takeVoucher,
 
-                date_format(t1.f_bsdate, '%Y-%m-%d %H:%i:%S') as inStorageDate,
 
-                t1.f_mblno as blNumber,
 
-                date_format(t1.update_time, '%Y-%m-%d %H:%i:%S') as latestOptDate,
 
-                t1.lock_status as lockStatus,
 
-                t1.belong_to as belongTo,
 
-                t1.lock_time as lockTime,
 
-                t1.unlock_time as unlockTime,
 
-                t1.wr_number as wrNumber
 
-         from t_whgenleg t1
 
-             left join t_goods t2 on t2.f_id = t1.f_goodsid
 
-             left join sys_dict_data t3 on t3.dict_value = t2.f_typeid
 
-             left join t_warehouse t4 on t4.f_id = t1.f_warehouse_locationid
 
-             left join t_warehouse t5 on t5.f_id = t1.f_warehouseid
 
-             left join t_warehousebillsitems t6 on t6.f_billno = t1.f_originalbillno
 
-         <where>
 
-             t3.status = '0'
 
-             and t3.dict_type = 'data_goods_category'
 
-             and t1.f_qtyD != 0
 
-             and t1.f_qtyblc > 0
 
-             and t1.f_grossweightblc > 0
 
-             <if test="billNo != null and billNo != ''">and t1.f_originalbillno = #{billNo}</if>
 
-             <if test="corpId != null ">and t1.f_corpid = #{corpId}</if>
 
-         </where>
 
-     </select>
 
-     <select id="selectBlNumber" resultType="java.util.Map">
 
-         select
 
-         t3.dict_label as cargoType,
 
-         t2.f_no as cargoNo,
 
-         t2.f_name as cargoName,
 
-         t1.f_qtyD as number,
 
-         t1.f_qtyblc as numberLeft,
 
-         t1.f_grossweightD as weight,
 
-         t1.f_grossweightblc as weightLeft,
 
-         t6.f_packagespecs as speci,
 
-         t6.f_sealno as bondedStatus,
 
-         t4.f_no as shelvesName,
 
-         t5.f_no as warehouseNo,
 
-         t5.f_name as warehouseName,
 
-         t1.f_originalbillno as takeVoucher,
 
-         date_format(t1.f_bsdate, '%Y-%m-%d %H:%i:%S') as inStorageDate,
 
-         t1.f_mblno as blNumber,
 
-         date_format(t1.update_time, '%Y-%m-%d %H:%i:%S') as latestOptDate,
 
-         t1.lock_status as lockStatus,
 
-         t1.belong_to as belongTo,
 
-         t1.lock_time as lockTime,
 
-         t1.unlock_time as unlockTime,
 
-         t1.wr_number as wrNumber
 
-         from t_whgenleg t1
 
-         left join t_goods t2 on t2.f_id = t1.f_goodsid
 
-         left join sys_dict_data t3 on t3.dict_value = t2.f_typeid
 
-         left join t_warehouse t4 on t4.f_id = t1.f_warehouse_locationid
 
-         left join t_warehouse t5 on t5.f_id = t1.f_warehouseid
 
-         left join t_warehousebillsitems t6 on t6.f_billno = t1.f_originalbillno
 
-         <where>
 
-             t3.status = '0'
 
-             and t3.dict_type = 'data_goods_category'
 
-             and t1.f_qtyD != 0
 
-             and t1.f_qtyblc > 0
 
-             and t1.f_grossweightblc > 0
 
-             <if test="blNumber != null and blNumber != ''">and t1.f_mblno = #{blNumber}</if>
 
-             <if test="billNo != null and billNo != ''">and t1.f_originalbillno = #{billNo}</if>
 
-             <if test="corpId != null ">and t1.f_corpid = #{corpId}</if>
 
-         </where>
 
-     </select>
 
-     <select id="selectBlNumberPage" resultType="java.util.Map">
 
-         select
 
-         t3.dict_label as cargoType,
 
-         t2.f_no as cargoNo,
 
-         t2.f_name as cargoName,
 
-         t1.f_qtyD as number,
 
-         t1.f_qtyblc as numberLeft,
 
-         t1.f_grossweightD as weight,
 
-         t1.f_grossweightblc as weightLeft,
 
-         t6.f_packagespecs as speci,
 
-         t6.f_sealno as bondedStatus,
 
-         t4.f_no as shelvesName,
 
-         t5.f_no as warehouseNo,
 
-         t5.f_name as warehouseName,
 
-         t1.f_originalbillno as takeVoucher,
 
-         date_format(t1.f_bsdate, '%Y-%m-%d %H:%i:%S') as inStorageDate,
 
-         t1.f_mblno as blNumber,
 
-         date_format(t1.update_time, '%Y-%m-%d %H:%i:%S') as latestOptDate,
 
-         t1.lock_status as lockStatus,
 
-         t1.belong_to as belongTo,
 
-         t1.lock_time as lockTime,
 
-         t1.unlock_time as unlockTime,
 
-         t1.wr_number as wrNumber
 
-         from t_whgenleg t1
 
-         left join t_goods t2 on t2.f_id = t1.f_goodsid
 
-         left join sys_dict_data t3 on t3.dict_value = t2.f_typeid
 
-         left join t_warehouse t4 on t4.f_id = t1.f_warehouse_locationid
 
-         left join t_warehouse t5 on t5.f_id = t1.f_warehouseid
 
-         left join t_warehousebillsitems t6 on t6.f_billno = t1.f_originalbillno
 
-         <where>
 
-             t3.status = '0'
 
-             and t3.dict_type = 'data_goods_category'
 
-             and t1.f_qtyD != 0
 
-             and t1.f_qtyblc > 0
 
-             and t1.f_grossweightblc > 0
 
-             <if test="blNumber != null and blNumber != ''">and t1.f_mblno = #{blNumber}</if>
 
-             <if test="billNo != null and billNo != ''">and t1.f_originalbillno = #{billNo}</if>
 
-             <if test="corpId != null ">and t1.f_corpid = #{corpId}</if>
 
-             ORDER BY t1.f_bsdate DESC
 
-             LIMIT #{pageNo},#{pageSize}
 
-         </where>
 
-     </select>
 
-     <select id="selectQueryAssets" resultType="java.util.Map">
 
-         select
 
-         t3.dict_label as cargoType,
 
-         t2.f_no as cargoNo,
 
-         t2.f_name as cargoName,
 
-         t1.f_qtyD as number,
 
-         t1.f_qtyblc as numberLeft,
 
-         t1.f_grossweightD as weight,
 
-         t1.f_grossweightblc as weightLeft,
 
-         t6.f_packagespecs as speci,
 
-         t6.f_sealno as bondedStatus,
 
-         t4.f_no as shelvesName,
 
-         t5.f_no as warehouseNo,
 
-         t5.f_name as warehouseName,
 
-         t1.f_originalbillno as takeVoucher,
 
-         date_format(t1.f_bsdate, '%Y-%m-%d %H:%i:%S') as inStorageDate,
 
-         t1.f_mblno as blNumber,
 
-         date_format(t1.update_time, '%Y-%m-%d %H:%i:%S') as latestOptDate,
 
-         t1.lock_status as lockStatus,
 
-         t1.belong_to as belongTo,
 
-         t1.lock_time as lockTime,
 
-         t1.unlock_time as unlockTime,
 
-         t1.wr_number as wrNumber
 
-         from t_whgenleg t1
 
-         left join t_goods t2 on t2.f_id = t1.f_goodsid
 
-         left join sys_dict_data t3 on t3.dict_value = t2.f_typeid
 
-         left join t_warehouse t4 on t4.f_id = t1.f_warehouse_locationid
 
-         left join t_warehouse t5 on t5.f_id = t1.f_warehouseid
 
-         left join t_warehousebillsitems t6 on t6.f_billno = t1.f_originalbillno
 
-         <where>
 
-             t3.status = '0'
 
-             and t3.dict_type = 'data_goods_category'
 
-             and t1.f_qtyD != 0
 
-             and t1.f_qtyblc > 0
 
-             and t1.f_grossweightblc > 0
 
-             <if test="blNumber != null and blNumber != ''">and t1.f_mblno = #{blNumber}</if>
 
-             <if test="corpId != null ">and t1.f_corpid = #{corpId}</if>
 
-             <if test="wrNumber != null and wrNumber != ''">and t4.f_no = #{wrNumber}</if>
 
-             <if test="cargoType != null and cargoType != ''">and t2.f_no = #{cargoType}</if>
 
-         </where>
 
-     </select>
 
-     <select id="selectfOriginalbillno" resultType="java.lang.String">
 
-         select f_originalbillno from t_whgenleg where f_mblno = #{billNo} LIMIT 1
 
-     </select>
 
-     <select id="selectStockListCk" resultType="Map">
 
-         select DISTINCT
 
-         t3.dict_label as cargoType,
 
-         t2.f_no as cargoNo,
 
-         t2.f_name as cargoName,
 
-         t1.f_qtyD as number,
 
-         t1.f_qtyblc as numberLeft,
 
-         t1.f_grossweightD as weight,
 
-         t1.f_grossweightblc as weightLeft,
 
-         t6.f_packagespecs as speci,
 
-         t6.f_sealno as bondedStatus,
 
-         t4.f_no as shelvesName,
 
-         t5.f_no as warehouseNo,
 
-         t5.f_name as warehouseName,
 
-         t1.f_originalbillno as takeVoucher,
 
-         date_format(t1.f_bsdate, '%Y-%m-%d %H:%i:%S') as inStorageDate,
 
-         t1.f_mblno as blNumber,
 
-         date_format(t1.update_time, '%Y-%m-%d %H:%i:%S') as latestOptDate,
 
-         t1.lock_status as lockStatus,
 
-         t1.belong_to as belongTo,
 
-         t1.lock_time as lockTime,
 
-         t1.unlock_time as unlockTime,
 
-         t1.wr_number as wrNumber
 
-         from t_whgenleg t1
 
-         left join t_goods t2 on t2.f_id = t1.f_goodsid
 
-         left join sys_dict_data t3 on t3.dict_value = t2.f_typeid
 
-         left join t_warehouse t4 on t4.f_id = t1.f_warehouse_locationid
 
-         left join t_warehouse t5 on t5.f_id = t1.f_warehouseid
 
-         left join t_warehousebillsitems t6 on t6.f_billno = t1.f_originalbillno
 
-         <where>
 
-            t3.dict_type = 'data_goods_category'
 
-             AND t3.status = 0
 
-             AND t1.f_qtyD != 0
 
-             AND t1.f_qtyblc > 0
 
-             AND t1.f_grossweightblc > 0
 
-             <if test="corpId != null "> AND t1.f_corpid = #{corpId}</if>
 
-             <if test="fMblno != null and fMblno != ''"> AND t1.f_mblno = #{fMblno}</if>
 
-         </where>
 
-     </select>
 
-     <update id="changeBelongTo" parameterType="TWhgenleg">
 
-         update t_whgenleg
 
-         <trim prefix="SET" suffixOverrides=",">
 
-             <if test="lockStatus != null">lock_status = #{lockStatus},</if>
 
-             <if test="belongTo != null">belong_to = #{belongTo},</if>
 
-             <if test="lockTime != null">lock_time = #{lockTime},</if>
 
-             <if test="unlockTime != null">unlock_time = #{unlockTime},</if>
 
-             <if test="wrNumber != null">wr_number = #{wrNumber},</if>
 
-             <if test="fCorpid != null">f_corpid = #{fCorpid},</if>
 
-         </trim>
 
-         where f_mblno = #{fOriginalbillno}
 
-     </update>
 
- </mapper>
 
 
  |