OrderBillsPlansMapper.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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}, #{l.lineNo}, #{o.carId}, #{l.itemId}, #{l.itemProp}, #{l.itemAuditType}, 'C', 1,
  10. '录入', '录入',
  11. #{e.}, #{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="updateLoadFeeItems">
  29. update LoadFeeItems
  30. set atm1 = #{atm1}
  31. where itemId = #{itemId}
  32. and entityId = #{entityId}
  33. </update>
  34. <select id="getOrderBillsPlansLsit" parameterType="Map" resultType="com.ruoyi.system.domain.WfTaskList">
  35. Select
  36. Distinct p.SysID sysId
  37. , p.EntityID entityId
  38. , p.LineNo lineNo
  39. , p.OrderNo orderNo
  40. ,p.CarID carID
  41. , p.CarRegNo carRegNo
  42. ,p.PlanLoadDate planLoadDate
  43. , p.LoadDate loadDate
  44. , p.LoadAddr loadAddr
  45. , p.EMPTYADDR1 emptyAddr1
  46. , p.EMPTYADDR2 emptyAddr2
  47. ,p.PlanUnLoadDate planUnLoadDate
  48. , p.UnLoadDate unLoadDate
  49. , p.UnLoadAddr unLoadAddr
  50. , p.Remarks remarks
  51. ,t.TaskID taskId
  52. , t.Status status
  53. ,t.AuditStatus auditStatus
  54. , t.ActID wfActId
  55. ,c.SName corpSName
  56. , c.CName corpCName
  57. , g.CName goodsCName
  58. ,l.SName loadFactory
  59. , ul.SName unLoadFactory
  60. ,dr1.Empl driver1Name
  61. ,dr1.mobile driver1mobile
  62. , sp.Empl sUPERCARGOName
  63. ,e.Empl transact
  64. from wf_TaskList t
  65. Left join LoadBills b on (b.SysID=t.SysID and b.EntityID=t.EntityID)
  66. Left join OrderBillsPlans p on (p.SysID=b.SysID and p.EntityID=b.SrcEntityID and p.LineNo=b.SrcLineNo)
  67. Left join Empls e on (e.SysID=b.SysID and e.EmplID=b.TransactID)
  68. Left join Empls dr1 on (dr1.SysID=b.SysID and dr1.EmplID=p.DRIVER1ID)
  69. Left join Empls sp on (sp.SysID=b.SysID and sp.EmplID=p.SUPERCARGOID)
  70. Left join Corps c on (c.SysID=p.SysID and c.CorpID=p.CorpID)
  71. Left join Corps l on (l.SysID=p.SysID and l.CorpID=p.LoadFactoryID)
  72. Left join Corps ul on (ul.SysID=b.SysID and ul.CorpID=p.UnLoadFactoryID)
  73. Left join Goods g on (g.SysID=b.SysID and g.GoodsID=b.GoodsID)
  74. <where>
  75. t.SysID=1 and t.ActID=317 and (t.Status = 2 or t.Status = 6)
  76. and ((b.CarID=-1) or ((b.CarID &lt;&gt; -1)))
  77. <if test="dataStart != null and dataStart != '' and dataEnd != null and dataEnd != ''">
  78. and b.BillDate >= #{dataStart, jdbcType=VARCHAR} and b.BillDate &lt;= #{dataEnd, jdbcType=VARCHAR}
  79. </if>
  80. and p.IFORDER1ED='T'
  81. and ((p.DRIVER1ID=#{emplId, jdbcType=VARCHAR}) or (p.SUPERCARGOID=#{emplId, jdbcType=VARCHAR}))
  82. <if test="orderNo != null and orderNo != ''">
  83. -- and p.orderNo like concat('%', #{orderNo}, '%')
  84. </if>
  85. </where>
  86. ORDER BY b.BillDate desc
  87. </select>
  88. <select id="getOrderBillsPlansByid" resultType="com.ruoyi.system.domain.OrderBillsPlans">
  89. Select g.CName goodsCName
  90. , p.LoadAddr loadAddr
  91. , l.SName loadFactory
  92. , p.LoadAttn loadAttn
  93. , p.LoadAttnTel loadAttnTel
  94. , p.UnLoadAddr unLoadAddr
  95. , ul.SName unLoadFactory
  96. , p.UnLoadAttn unLoadAttn
  97. , p.UNLoadAttnTel unLoadAttnTel
  98. , p.planRemarks
  99. from OrderBillsPlans p
  100. Left join Empls e on (e.SysID = p.SysID and e.EmplID = p.TransactID)
  101. Left join Empls dr1 on (dr1.SysID = p.SysID and dr1.EmplID = p.DRIVER1ID)
  102. Left join Empls sp on (sp.SysID = p.SysID and sp.EmplID = p.SUPERCARGOID)
  103. Left join Corps c on (c.SysID = p.SysID and c.CorpID = p.CorpID)
  104. Left join Corps l on (l.SysID = p.SysID and l.CorpID = p.LoadFactoryID)
  105. Left join Corps ul on (ul.SysID = p.SysID and ul.CorpID = p.UnLoadFactoryID)
  106. Left join Goods g on (g.SysID = p.SysID and g.GoodsID = p.GoodsID)
  107. where p.SysID = 1
  108. and p.OrderNo = #{orderNo}
  109. </select>
  110. <select id="getItemsList" resultType="com.ruoyi.system.domain.vo.ItemsVo">
  111. select itemId, cName from Items where SysID=1 and itemProp='F'
  112. </select>
  113. <select id="getLoadFeeitemsMapByentityIdKeyItemId" resultType="java.util.Map">
  114. select itemId, atm1, entityId from LoadFeeItems where entityId = #{entityId}
  115. </select>
  116. <select id="getGasStations" resultType="com.ruoyi.system.domain.GasStations">
  117. select gasStationId, cName from GasStations
  118. </select>
  119. </mapper>