123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241 |
- <?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.system.mapper.OrderBillsPlansMapper">
- <insert id="insertLoadFeeItems">
- Insert Into LoadFeeItems (SysID, EntityID, LineNo, CarID, ItemID, ItemProp, ItemAuditType, Dc, Qty, Price, Amt, AMT1, AMT2, AMTORG,
- OpUserID, OpUserName, SrcActID, SrcEntityID, SrcLineNo)
- values (1, #{o.loadBillsEntityId}, #{i.lineNo}, #{o.carId}, #{i.itemId}, #{i.itemProp}, #{i.auditType}, 'C', 1,
- #{i.amt}, #{i.amt}, #{i.amt}, #{i.amt}, #{i.amt},
- #{e.EmplId}, #{e.empl}, #{o.actId}, #{o.entityId}, #{o.lineNo})
- </insert>
- <insert id="insertAttachMngs">
- insert into AttachMngs (SYSID, ENTITYID, ACTID, LINENO, USERNAME,ATTACHNAME)
- values (#{loadBillsSysId}, #{loadBillsEntityId}, #{actId}, #{lineNo}, #{userName}, #{attachName})
- </insert>
- <update id="updateOrderBillsPlansByid">
- update OrderBillsPlans
- set LoadQty = #{loadQty},
- LoadDate = #{loadDate},
- UnLoadQty = #{unLoadQty},
- UnLoadDate = #{unLoadDate},
- EMPTYADDR1 = #{emptyaddr1},
- ODOMETERSTART = #{odometerstart},
- EMPTYADDR2 = #{emptyaddr2},
- ODOMETEREND = #{odometerend},
- LOADMILE = #{loadmile},
- driverassdesc = #{driverassdesc}
- where sysId = '1'
- and OrderNo = #{orderNo}
- </update>
- <update id="updateOrderBillsPlansByOrderNo">
- update OrderBillsPlans
- set loadetc = #{loadetc},
- loadtoll = #{loadtoll},
- oilhomeQty = #{oilhomeQty},
- oilhomeAmt = #{oilhomeAmt},
- oilappoint1Qty = #{oilappoint1Qty},
- oilappoint1Amt = #{oilappoint1Amt},
- oilappoint2Qty = #{oilappoint2Qty},
- oilappoint2Amt = #{oilappoint2Amt},
- oilcash1Qty = #{oilcash1Qty},
- oilcash1Amt = #{oilcash1Amt},
- oilcardQty = #{oilcardQty},
- oilcardAmt = #{oilcardAmt},
- gasstation1 = #{gasstation1},
- gasstation2 = #{gasstation2}
- where orderNo = #{orderNo}
- </update>
- <update id="updateOrderBillsPlansBySysidEntityidLineno">
- update LoadFeeItems
- set Price = #{amt},
- Amt = #{amt},
- AMT1 = #{amt},
- AMT2 = #{amt},
- AMTORG = #{amt}
- where sysId = '1'
- AND entityid = #{entityId} and lineno = #{lineNo}
- </update>
- <delete id="deleteLoadFeeItemsByEntityId">
- delete from LoadFeeItems where sysid = 1 and entityid = #{entityId}
- </delete>
- <delete id="deleteTmsAttachMngsByAttachId">
- delete from AttachMngs where attachId = #{attachId}
- </delete>
- <select id="getOrderBillsPlansLsit" parameterType="Map" resultType="com.ruoyi.system.domain.WfTaskList">
- Select
- Distinct p.SysID sysId
- , p.EntityID entityId
- , p.LineNo lineNo
- , p.OrderNo orderNo
- ,p.CarID carID
- , p.CarRegNo carRegNo
- ,p.PlanLoadDate planLoadDate
- , p.LoadDate loadDate
- , p.LoadAddr loadAddr
- , p.EMPTYADDR1 emptyAddr1
- , p.EMPTYADDR2 emptyAddr2
- ,p.PlanUnLoadDate planUnLoadDate
- , p.UnLoadDate unLoadDate
- , p.UnLoadAddr unLoadAddr
- , p.Remarks remarks
- ,t.TaskID taskId
- , t.Status status
- ,t.AuditStatus auditStatus
- , t.ActID wfActId
- ,c.SName corpSName
- , c.CName corpCName
- , g.CName goodsCName
- ,l.SName loadFactory
- , ul.SName unLoadFactory
- ,dr1.Empl driver1Name
- ,dr1.mobile driver1mobile
- , sp.Empl sUPERCARGOName
- ,e.Empl transact
- , b.BillDate billDate
- , p.rightqty
- , b.billStatus
- from wf_TaskList t
- Left join LoadBills b on (b.SysID=t.SysID and b.EntityID=t.EntityID)
- Left join OrderBillsPlans p on (p.SysID=b.SysID and p.EntityID=b.SrcEntityID and p.LineNo=b.SrcLineNo)
- Left join Empls e on (e.SysID=b.SysID and e.EmplID=b.TransactID)
- Left join Empls dr1 on (dr1.SysID=b.SysID and dr1.EmplID=p.DRIVER1ID)
- Left join Empls sp on (sp.SysID=b.SysID and sp.EmplID=p.SUPERCARGOID)
- Left join Corps c on (c.SysID=p.SysID and c.CorpID=p.CorpID)
- Left join Corps l on (l.SysID=p.SysID and l.CorpID=p.LoadFactoryID)
- Left join Corps ul on (ul.SysID=b.SysID and ul.CorpID=p.UnLoadFactoryID)
- Left join Goods g on (g.SysID=b.SysID and g.GoodsID=b.GoodsID)
- <where>
- t.SysID=1 and t.ActID=317 and (t.Status = 2 or t.Status = 6)
- and ((b.CarID=-1) or ((b.CarID <> -1)))
- <if test="dataStart != null and dataStart != '' and dataEnd != null and dataEnd != ''">
- and b.BillDate >= #{dataStart, jdbcType=VARCHAR} and b.BillDate <= #{dataEnd, jdbcType=VARCHAR}
- </if>
- and p.IFORDER1ED='T'
- and ((p.DRIVER1ID=#{emplId, jdbcType=VARCHAR}) or (p.SUPERCARGOID=#{emplId, jdbcType=VARCHAR}))
- <if test="orderNo != null and orderNo != ''">
- and p.orderNo like #{orderNo}
- </if>
- </where>
- ORDER BY b.BillDate desc
- </select>
- <select id="getOrderBillsPlansByid" resultType="com.ruoyi.system.domain.OrderBillsPlans">
- Select g.CName goodsCName
- , p.LoadAddr loadAddr
- , l.SName loadFactory
- , p.LoadAttn loadAttn
- , p.LoadAttnTel loadAttnTel
- , p.UnLoadAddr unLoadAddr
- , ul.SName unLoadFactory
- , p.UnLoadAttn unLoadAttn
- , p.UNLoadAttnTel unLoadAttnTel
- , p.planRemarks
- , p.orderNo
- , p.loadQty
- , p.loadDate
- , p.unLoadQty
- , p.unLoadDate
- , p.emptyaddr1
- , p.odometerstart
- , p.emptyaddr2
- , p.odometerend
- , p.loadmile
- , p.remarks
- , p.driverassdesc
- , dr1.Empl driver1Name
- , dr1.mobile driver1mobile
- , p.sysId
- , b.entityId loadBillsEntityId
- , b.sysId loadBillsSysId
- , b.billStatus
- from OrderBillsPlans p
- Left join Empls e on (e.SysID = p.SysID and e.EmplID = p.TransactID)
- Left join Empls dr1 on (dr1.SysID = p.SysID and dr1.EmplID = p.DRIVER1ID)
- Left join Empls sp on (sp.SysID = p.SysID and sp.EmplID = p.SUPERCARGOID)
- Left join Corps c on (c.SysID = p.SysID and c.CorpID = p.CorpID)
- Left join Corps l on (l.SysID = p.SysID and l.CorpID = p.LoadFactoryID)
- Left join Corps ul on (ul.SysID = p.SysID and ul.CorpID = p.UnLoadFactoryID)
- Left join Goods g on (g.SysID = p.SysID and g.GoodsID = p.GoodsID)
- INNER JOIN LoadBills b
- ON
- p.SysID = b.SysID
- AND p.EntityID = b.SrcEntityID
- AND p.LineNo = b.SrcLineNo
- where p.SysID = 1
- and p.OrderNo = #{orderNo}
- </select>
- <select id="getItemsList" resultType="com.ruoyi.system.domain.vo.ItemsVo">
- select itemId, cName, itemProp, auditType from Items where SysID=1 and itemProp='F'
- </select>
- <select id="getLoadFeeitemsMapByentityIdKeyItemId" resultType="java.util.Map">
- select itemId, atm1, entityId from LoadFeeItems where entityId = #{entityId}
- </select>
- <select id="getGasStations" resultType="com.ruoyi.system.domain.GasStations">
- select gasStationId, cName from GasStations
- </select>
- <select id="getOrderBillsPlansByOrder" resultType="com.ruoyi.system.domain.vo.OrderBillsPlansVo">
- select o.loadetc
- , o.loadtoll
- , o.oilhomeQty
- , o.oilhomeAmt
- , o.oilappoint1Qty
- , o.oilappoint1Amt
- , o.oilappoint2Qty
- , o.oilappoint2Amt
- , o.oilcash1Qty
- , o.oilcash1Amt
- , o.oilcardQty
- , o.oilcardAmt
- , o.gasstation1
- , o.gasstation2
- , o.entityId
- , o.orderNo
- , o.carId
- , o.lineNo
- , o.actId
- , b.entityID loadBillsEntityId
- , dr1.Empl driver1Name
- ,dr1.mobile driver1mobile
- FROM OrderBillsPlans o
- INNER JOIN LoadBills b
- ON
- o.SysID = b.SysID
- AND o.EntityID = b.SrcEntityID
- AND o.LineNo = b.SrcLineNo
- Left join Empls dr1 on dr1.EmplID = o.DRIVER1ID
- where o.orderNo = #{orderNo} and dr1.SysID = 1
- </select>
- <select id="getLoadFeeItemsByEntityId" resultType="com.ruoyi.system.domain.LoadFeeItems">
- select l.itemid, l.amt, i.cName, i.itemProp, i.auditType, l.lineNo, l.entityid
- from LoadFeeItems l
- inner join Items i on l.ItemID = i.ItemID
- where l.sysid = 1
- and l.entityId = #{entityId};
- </select>
- <select id="getAttachMngsBySysIdEntityId" resultType="java.lang.Long">
- select MAX(lineNo) from AttachMngs where sysId = #{loadBillsSysId} and entityId = #{loadBillsEntityId}
- </select>
- <select id="getAttachMngsAttachtypeIdBySysIdAndEntityIdAndLineNo" resultType="java.lang.Long">
- select attachId from AttachMngs where SysId = #{loadBillsSysId} and EntityId = #{loadBillsEntityId} and LineNo = #{lineNo}
- </select>
- <select id="getAttachMngsAttachIdBySysIdAndEntityIdAndActId" resultType="java.lang.Long">
- select attachId from AttachMngs where SysId = #{loadBillsSysId} and EntityId = #{loadBillsEntityId} and ActID = 375
- </select>
- </mapper>
|