OrderBillsPlansMapper.xml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.system.mapper.OrderBillsPlansMapper">
  6. <insert id="insertLoadFeeItems">
  7. Insert Into LoadFeeItems (SysID, EntityID, LineNo, CarID, ItemID, ItemProp, ItemAuditType, Dc, Qty, Price, Amt,
  8. OpUserID, OpUserName, SrcActID, SrcEntityID, SrcLineNo)
  9. values (1, #{o.entityId}, #{i.lineNo}, #{o.carId}, #{i.itemId}, #{i.itemProp}, #{i.auditType}, 'C', 1,
  10. #{i.amt}, #{i.amt},
  11. #{e.EmplId}, #{e.empl}, #{o.actId}, #{o.entityId}, #{o.lineNo})
  12. </insert>
  13. <update id="updateOrderBillsPlansByid">
  14. update OrderBillsPlans
  15. set LoadQty = #{loadQty},
  16. LoadDate = #{loadDate},
  17. UnLoadQty = #{unLoadQty},
  18. UnLoadDate = #{unLoadDate},
  19. EMPTYADDR1 = #{emptyaddr1},
  20. ODOMETERSTART = #{odometerstart},
  21. EMPTYADDR2 = #{emptyaddr2},
  22. ODOMETEREND = #{odometerend},
  23. LOADMILE = #{loadmile},
  24. Remarks = #{remarks}
  25. where sysId = '1'
  26. and OrderNo = #{orderNo}
  27. </update>
  28. <update id="reimbursement">
  29. update OrderBillsPlans
  30. set loadetc = #{loadetc},
  31. loadtoll = #{loadtoll},
  32. oilhomeQty = #{oilhomeQty},
  33. oilhomeAmt = #{oilhomeAmt},
  34. oilappoint1Qty = #{oilappoint1Qty},
  35. oilappoint1Amt = #{oilappoint1Amt},
  36. oilappoint2Qty = #{oilappoint2Qty},
  37. oilappoint2Amt = #{oilappoint2Amt},
  38. oilcash1Qty = #{oilcash1Qty},
  39. oilcash1Amt = #{oilcash1Amt},
  40. oilcardQty = #{oilcardQty},
  41. oilcardAmt = #{oilcardAmt},
  42. gasstation1 = #{gasstation1},
  43. gasstation2 = #{gasstation2}
  44. where orderNo = #{orderNo}
  45. </update>
  46. <delete id="deleteLoadFeeItemsByCarId">
  47. delete from LoadFeeItems where CarId = #{carId}
  48. </delete>
  49. <select id="getOrderBillsPlansLsit" parameterType="Map" resultType="com.ruoyi.system.domain.WfTaskList">
  50. Select
  51. Distinct p.SysID sysId
  52. , p.EntityID entityId
  53. , p.LineNo lineNo
  54. , p.OrderNo orderNo
  55. ,p.CarID carID
  56. , p.CarRegNo carRegNo
  57. ,p.PlanLoadDate planLoadDate
  58. , p.LoadDate loadDate
  59. , p.LoadAddr loadAddr
  60. , p.EMPTYADDR1 emptyAddr1
  61. , p.EMPTYADDR2 emptyAddr2
  62. ,p.PlanUnLoadDate planUnLoadDate
  63. , p.UnLoadDate unLoadDate
  64. , p.UnLoadAddr unLoadAddr
  65. , p.Remarks remarks
  66. ,t.TaskID taskId
  67. , t.Status status
  68. ,t.AuditStatus auditStatus
  69. , t.ActID wfActId
  70. ,c.SName corpSName
  71. , c.CName corpCName
  72. , g.CName goodsCName
  73. ,l.SName loadFactory
  74. , ul.SName unLoadFactory
  75. ,dr1.Empl driver1Name
  76. ,dr1.mobile driver1mobile
  77. , sp.Empl sUPERCARGOName
  78. ,e.Empl transact
  79. from wf_TaskList t
  80. Left join LoadBills b on (b.SysID=t.SysID and b.EntityID=t.EntityID)
  81. Left join OrderBillsPlans p on (p.SysID=b.SysID and p.EntityID=b.SrcEntityID and p.LineNo=b.SrcLineNo)
  82. Left join Empls e on (e.SysID=b.SysID and e.EmplID=b.TransactID)
  83. Left join Empls dr1 on (dr1.SysID=b.SysID and dr1.EmplID=p.DRIVER1ID)
  84. Left join Empls sp on (sp.SysID=b.SysID and sp.EmplID=p.SUPERCARGOID)
  85. Left join Corps c on (c.SysID=p.SysID and c.CorpID=p.CorpID)
  86. Left join Corps l on (l.SysID=p.SysID and l.CorpID=p.LoadFactoryID)
  87. Left join Corps ul on (ul.SysID=b.SysID and ul.CorpID=p.UnLoadFactoryID)
  88. Left join Goods g on (g.SysID=b.SysID and g.GoodsID=b.GoodsID)
  89. <where>
  90. t.SysID=1 and t.ActID=317 and (t.Status = 2 or t.Status = 6)
  91. and ((b.CarID=-1) or ((b.CarID &lt;&gt; -1)))
  92. <if test="dataStart != null and dataStart != '' and dataEnd != null and dataEnd != ''">
  93. and b.BillDate >= #{dataStart, jdbcType=VARCHAR} and b.BillDate &lt;= #{dataEnd, jdbcType=VARCHAR}
  94. </if>
  95. and p.IFORDER1ED='T'
  96. and ((p.DRIVER1ID=#{emplId, jdbcType=VARCHAR}) or (p.SUPERCARGOID=#{emplId, jdbcType=VARCHAR}))
  97. <if test="orderNo != null and orderNo != ''">
  98. and p.orderNo like #{orderNo}
  99. </if>
  100. </where>
  101. ORDER BY b.BillDate desc
  102. </select>
  103. <select id="getOrderBillsPlansByid" resultType="com.ruoyi.system.domain.OrderBillsPlans">
  104. Select g.CName goodsCName
  105. , p.LoadAddr loadAddr
  106. , l.SName loadFactory
  107. , p.LoadAttn loadAttn
  108. , p.LoadAttnTel loadAttnTel
  109. , p.UnLoadAddr unLoadAddr
  110. , ul.SName unLoadFactory
  111. , p.UnLoadAttn unLoadAttn
  112. , p.UNLoadAttnTel unLoadAttnTel
  113. , p.planRemarks
  114. , p.orderNo
  115. , p.loadQty
  116. , p.loadDate
  117. , p.unLoadQty
  118. , p.unLoadDate
  119. , p.emptyaddr1
  120. , p.odometerstart
  121. , p.emptyaddr2
  122. , p.odometerend
  123. , p.loadmile
  124. , p.remarks
  125. from OrderBillsPlans p
  126. Left join Empls e on (e.SysID = p.SysID and e.EmplID = p.TransactID)
  127. Left join Empls dr1 on (dr1.SysID = p.SysID and dr1.EmplID = p.DRIVER1ID)
  128. Left join Empls sp on (sp.SysID = p.SysID and sp.EmplID = p.SUPERCARGOID)
  129. Left join Corps c on (c.SysID = p.SysID and c.CorpID = p.CorpID)
  130. Left join Corps l on (l.SysID = p.SysID and l.CorpID = p.LoadFactoryID)
  131. Left join Corps ul on (ul.SysID = p.SysID and ul.CorpID = p.UnLoadFactoryID)
  132. Left join Goods g on (g.SysID = p.SysID and g.GoodsID = p.GoodsID)
  133. where p.SysID = 1
  134. and p.OrderNo = #{orderNo}
  135. </select>
  136. <select id="getItemsList" resultType="com.ruoyi.system.domain.vo.ItemsVo">
  137. select itemId, cName, itemProp, auditType from Items where SysID=1 and itemProp='F'
  138. </select>
  139. <select id="getLoadFeeitemsMapByentityIdKeyItemId" resultType="java.util.Map">
  140. select itemId, atm1, entityId from LoadFeeItems where entityId = #{entityId}
  141. </select>
  142. <select id="getGasStations" resultType="com.ruoyi.system.domain.GasStations">
  143. select gasStationId, cName from GasStations
  144. </select>
  145. <select id="getOrderBillsPlansByOrder" resultType="com.ruoyi.system.domain.vo.OrderBillsPlansVo">
  146. select loadetc
  147. , loadtoll
  148. , oilhomeQty
  149. , oilhomeAmt
  150. , oilappoint1Qty
  151. , oilappoint1Amt
  152. , oilappoint2Qty
  153. , oilappoint2Amt
  154. , oilcash1Qty
  155. , oilcash1Amt
  156. , oilcardQty
  157. , oilcardAmt
  158. , gasstation1
  159. , gasstation2
  160. , entityid
  161. , orderNo
  162. , carId
  163. , lineNo
  164. , actId
  165. from OrderBillsPlans
  166. where orderNo = #{orderNo}
  167. </select>
  168. <select id="getLoadFeeItemsByOrder" resultType="com.ruoyi.system.domain.LoadFeeItems">
  169. select itemid, amt from LoadFeeItems where sysid = 1 and entityid = #{entityid}
  170. </select>
  171. </mapper>