ftmsorderbillscarsMapper.xml 76 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340
  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.orderPlan.mapper.FtmsorderbillscarsMapper">
  6. <resultMap type="ftmsorderbillscars" id="ftmsorderbillscarsResult">
  7. <result property="id" column="id" />
  8. <result property="pId" column="p_id" />
  9. <result property="orgId" column="org_id" />
  10. <result property="orderNo" column="order_no" />
  11. <result property="cntrId" column="cntr_id" />
  12. <result property="cntrNo" column="cntr_no" />
  13. <result property="carcorPid" column="carcor_pid" />
  14. <result property="carregNo" column="carreg_no" />
  15. <result property="mblno" column="mblno" />
  16. <result property="driverName" column="driver_name" />
  17. <result property="driverTel" column="driver_tel" />
  18. <result property="driverUserId" column="driver_user_id" />
  19. <result property="planDate" column="plan_date" />
  20. <result property="planRemarks" column="plan_remarks" />
  21. <result property="acceptDate" column="accept_date" />
  22. <result property="acceptRemarks" column="accept_remarks" />
  23. <result property="loadDate" column="load_date" />
  24. <result property="loadRemarks" column="load_remarks" />
  25. <result property="mdLoadDate" column="md_load_date" />
  26. <result property="offData" column="off_data" />
  27. <result property="offRemarks" column="off_remarks" />
  28. <result property="mdLoadRemarks" column="md_load_remarks" />
  29. <result property="unLoadDate" column="un_load_date" />
  30. <result property="unLoadRemarks" column="un_load_remarks" />
  31. <result property="waybillDate" column="waybill_date" />
  32. <result property="qtyLoad" column="qty_load" />
  33. <result property="cntrQty" column="cntr_qty" />
  34. <result property="qtyUnLoad" column="qty_un_load" />
  35. <result property="cntrWeight" column="cntr_weight" />
  36. <result property="gopodsLossQty" column="gopods_loss_qty" />
  37. <result property="gopodsLossrate" column="gopods_lossrate" />
  38. <result property="gopodsLossamtCr" column="gopods_lossamt_cr" />
  39. <result property="qtyDr" column="qty_dr" />
  40. <result property="waybillRemarks" column="waybill_remarks" />
  41. <result property="gopodsLossamtDr" column="gopods_lossamt_dr" />
  42. <result property="qtyCr" column="qty_cr" />
  43. <result property="freightPriceDr" column="freight_price_dr" />
  44. <result property="freightPriceCr" column="freight_price_cr" />
  45. <result property="freightAmtDr" column="freight_amt_dr" />
  46. <result property="freightAmtCr" column="freight_amt_cr" />
  47. <result property="feeitemDr" column="feeitem_dr" />
  48. <result property="feeitemDrRemarks" column="feeitem_dr_remarks" />
  49. <result property="feeitemCr" column="feeitem_cr" />
  50. <result property="feeitemCrRemarks" column="feeitem_cr_remarks" />
  51. <result property="amtDr" column="amt_dr" />
  52. <result property="amtCr" column="amt_cr" />
  53. <result property="dueDateDr" column="due_date_dr" />
  54. <result property="dueDateCr" column="due_date_cr" />
  55. <result property="odometerFrom" column="odometer_from" />
  56. <result property="odometerEnd" column="odometer_end" />
  57. <result property="milesEmpty" column="miles_empty" />
  58. <result property="milesLoad" column="miles_load" />
  59. <result property="miles" column="miles" />
  60. <result property="driverbonus" column="driverbonus" />
  61. <result property="costtoll" column="costtoll" />
  62. <result property="costmaintain" column="costmaintain" />
  63. <result property="costOth" column="cost_oth" />
  64. <result property="costRemarks" column="cost_remarks" />
  65. <result property="oilQtyper" column="oil_qtyper" />
  66. <result property="oilQty1" column="oil_qty1" />
  67. <result property="oilPrice1" column="oil_price1" />
  68. <result property="oilAmt1" column="oil_amt1" />
  69. <result property="oilQty2" column="oil_qty2" />
  70. <result property="oilPrice2" column="oil_price2" />
  71. <result property="oilAmt2" column="oil_amt2" />
  72. <result property="oilQty" column="oil_qty" />
  73. <result property="oilPrice" column="oil_price" />
  74. <result property="oilAmt" column="oil_amt" />
  75. <result property="oilQtyBlc" column="oil_qty_blc" />
  76. <result property="oilAmtBlc" column="oil_amt_blc" />
  77. <result property="profit" column="profit" />
  78. <result property="invDrNeed" column="inv_dr_need" />
  79. <result property="invDrStatus" column="inv_dr_status" />
  80. <result property="invDrTaxrate" column="inv_dr_taxrate" />
  81. <result property="invDrTaxamt" column="inv_dr_taxamt" />
  82. <result property="invDrDate" column="inv_dr_date" />
  83. <result property="invDrNo" column="inv_dr_no" />
  84. <result property="accchkStaus" column="accchk_staus" />
  85. <result property="billStatus" column="bill_status" />
  86. <result property="orderStatus" column="order_status" />
  87. <result property="costomAmt01" column="costom_amt_01" />
  88. <result property="costomAmt02" column="costom_amt_02" />
  89. <result property="stlAmtDr" column="stl_amt_dr" />
  90. <result property="costomAmt03" column="costom_amt_03" />
  91. <result property="stlDateDr" column="stl_date_dr" />
  92. <result property="costomAmt04" column="costom_amt_04" />
  93. <result property="stlAmtCr" column="stl_amt_cr" />
  94. <result property="costomAmt05" column="costom_amt_05" />
  95. <result property="stlDateCr" column="stl_date_cr" />
  96. <result property="delFlag" column="del_flag" />
  97. <result property="costomAmt06" column="costom_amt_06" />
  98. <result property="costomStr01" column="costom_str_01" />
  99. <result property="createBy" column="create_by" />
  100. <result property="costomStr02" column="costom_str_02" />
  101. <result property="createTime" column="create_time" />
  102. <result property="updateBy" column="update_by" />
  103. <result property="updateTime" column="update_time" />
  104. <result property="remarks" column="remarks" />
  105. <result property="accchkDateCr" column="accchk_date_cr" />
  106. <result property="mBillNo" column="m_bill_no" />
  107. <result property="billKind" column="bill_kind" />
  108. <result property="profitBill" column="profit_bill" />
  109. <result property="profitCar" column="profit_car" />
  110. <result property="corpId" column="corp_id" />
  111. <result property="invAmtCr" column="inv_amt_cr" />
  112. <result property="invAmtDr" column="inv_amt_dr" />
  113. <result property="invDateCr" column="inv_date_cr" />
  114. <result property="invDateDr" column="inv_date_dr" />
  115. <result property="accchkAmtCr" column="accchk_amt_cr" />
  116. <result property="accchkAmtDr" column="accchk_amt_dr" />
  117. <result property="accchkDateDr" column="accchk_date_dr" />
  118. </resultMap>
  119. <sql id="selectftmsorderbillscarsVo">
  120. select id, p_id, org_id, order_no, cntr_id, corp_id, cntr_no, carcor_pid, mblno, carreg_no, driver_name, driver_user_id,
  121. driver_tel, plan_date, plan_remarks, accept_date, accept_remarks, load_date, load_remarks, md_load_date, off_data,
  122. off_remarks, md_load_remarks, un_load_date, un_load_remarks, waybill_date, qty_load, qty_un_load, cntr_qty,
  123. gopods_loss_qty, cntr_weight, gopods_lossrate, waybill_remarks, gopods_lossamt_cr, qty_dr, gopods_lossamt_dr,
  124. qty_cr, freight_price_dr, freight_price_cr, freight_amt_dr, freight_amt_cr, feeitem_dr, feeitem_dr_remarks,
  125. feeitem_cr, feeitem_cr_remarks, amt_dr, amt_cr, due_date_dr, due_date_cr, odometer_from, odometer_end, miles_empty,
  126. miles_load, miles, driverbonus, costtoll, costmaintain, cost_oth, cost_remarks, oil_qtyper, oil_qty1, oil_price1,
  127. oil_amt1, oil_qty2, oil_price2, oil_amt2, oil_qty, oil_price, oil_amt, oil_qty_blc, oil_amt_blc, profit, inv_dr_need,
  128. inv_dr_status, inv_dr_taxrate, inv_dr_taxamt, inv_dr_date, inv_dr_no, accchk_staus, bill_status, order_status, accchk_date_cr,
  129. costom_amt_01, stl_amt_dr, costom_amt_02, stl_date_dr, costom_amt_03, stl_amt_cr, costom_amt_04, stl_date_cr,
  130. costom_amt_05, costom_amt_06, del_flag, costom_str_01, create_by, create_time, costom_str_02, update_by, update_time,
  131. m_bill_no, bill_kind, remarks, profit_bill, profit_car, inv_amt_cr, inv_amt_dr, inv_date_cr, inv_date_dr, accchk_amt_cr, accchk_amt_dr,
  132. accchk_date_dr from F_TMSORDERBILLSCARS
  133. </sql>
  134. <select id="selectftmsorderbillscarsList" parameterType="ftmsorderbillscars" resultMap="ftmsorderbillscarsResult">
  135. <include refid="selectftmsorderbillscarsVo"/>
  136. <where>
  137. <if test="pId != null "> and p_id = #{pId}</if>
  138. <if test="orgId != null "> and org_id = #{orgId}</if>
  139. <if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
  140. <if test="cntrId != null "> and cntr_id = #{cntrId}</if>
  141. <if test="corpId != null "> and corp_id = #{corpId}</if>
  142. <if test="cntrNo != null and cntrNo != ''"> and cntr_no = #{cntrNo}</if>
  143. <if test="carcorPid != null "> and carcor_pid = #{carcorPid}</if>
  144. <if test="mblno != null and mblno != ''"> and mblno = #{mblno}</if>
  145. <if test="carregNo != null and carregNo != ''"> and carreg_no = #{carregNo}</if>
  146. <if test="driverName != null and driverName != ''"> and driver_name like concat('%', #{driverName}, '%')</if>
  147. <if test="driverUserId != null "> and driver_user_id = #{driverUserId}</if>
  148. <if test="driverTel != null and driverTel != ''"> and driver_tel = #{driverTel}</if>
  149. <if test="planDate != null "> and plan_date = #{planDate}</if>
  150. <if test="planRemarks != null and planRemarks != ''"> and plan_remarks = #{planRemarks}</if>
  151. <if test="acceptDate != null "> and accept_date = #{acceptDate}</if>
  152. <if test="acceptRemarks != null and acceptRemarks != ''"> and accept_remarks = #{acceptRemarks}</if>
  153. <if test="loadDate != null "> and load_date = #{loadDate}</if>
  154. <if test="loadRemarks != null and loadRemarks != ''"> and load_remarks = #{loadRemarks}</if>
  155. <if test="mdLoadDate != null "> and md_load_date = #{mdLoadDate}</if>
  156. <if test="offData != null "> and off_data = #{offData}</if>
  157. <if test="offRemarks != null and offRemarks != ''"> and off_remarks = #{offRemarks}</if>
  158. <if test="mdLoadRemarks != null and mdLoadRemarks != ''"> and md_load_remarks = #{mdLoadRemarks}</if>
  159. <if test="unLoadDate != null "> and un_load_date = #{unLoadDate}</if>
  160. <if test="unLoadRemarks != null and unLoadRemarks != ''"> and un_load_remarks = #{unLoadRemarks}</if>
  161. <if test="waybillDate != null "> and waybill_date = #{waybillDate}</if>
  162. <if test="qtyLoad != null "> and qty_load = #{qtyLoad}</if>
  163. <if test="mBillNo != null "> and m_bill_no = #{mBillNo}</if>
  164. <if test="billKind != null "> and bill_kind = #{billKind}</if>
  165. <if test="qtyUnLoad != null "> and qty_un_load = #{qtyUnLoad}</if>
  166. <if test="cntrQty != null "> and cntr_qty = #{cntrQty}</if>
  167. <if test="gopodsLossQty != null "> and gopods_loss_qty = #{gopodsLossQty}</if>
  168. <if test="cntrWeight != null "> and cntr_weight = #{cntrWeight}</if>
  169. <if test="gopodsLossrate != null "> and gopods_lossrate = #{gopodsLossrate}</if>
  170. <if test="waybillRemarks != null and waybillRemarks != ''"> and waybill_remarks = #{waybillRemarks}</if>
  171. <if test="gopodsLossamtCr != null "> and gopods_lossamt_cr = #{gopodsLossamtCr}</if>
  172. <if test="qtyDr != null "> and qty_dr = #{qtyDr}</if>
  173. <if test="gopodsLossamtDr != null "> and gopods_lossamt_dr = #{gopodsLossamtDr}</if>
  174. <if test="qtyCr != null "> and qty_cr = #{qtyCr}</if>
  175. <if test="freightPriceDr != null "> and freight_price_dr = #{freightPriceDr}</if>
  176. <if test="freightPriceCr != null "> and freight_price_cr = #{freightPriceCr}</if>
  177. <if test="freightAmtDr != null "> and freight_amt_dr = #{freightAmtDr}</if>
  178. <if test="freightAmtCr != null "> and freight_amt_cr = #{freightAmtCr}</if>
  179. <if test="feeitemDr != null "> and feeitem_dr = #{feeitemDr}</if>
  180. <if test="feeitemDrRemarks != null and feeitemDrRemarks != ''"> and feeitem_dr_remarks = #{feeitemDrRemarks}</if>
  181. <if test="feeitemCr != null "> and feeitem_cr = #{feeitemCr}</if>
  182. <if test="feeitemCrRemarks != null and feeitemCrRemarks != ''"> and feeitem_cr_remarks = #{feeitemCrRemarks}</if>
  183. <if test="amtDr != null "> and amt_dr = #{amtDr}</if>
  184. <if test="amtCr != null "> and amt_cr = #{amtCr}</if>
  185. <if test="dueDateDr != null "> and due_date_dr = #{dueDateDr}</if>
  186. <if test="dueDateCr != null "> and due_date_cr = #{dueDateCr}</if>
  187. <if test="odometerFrom != null "> and odometer_from = #{odometerFrom}</if>
  188. <if test="odometerEnd != null "> and odometer_end = #{odometerEnd}</if>
  189. <if test="milesEmpty != null "> and miles_empty = #{milesEmpty}</if>
  190. <if test="milesLoad != null "> and miles_load = #{milesLoad}</if>
  191. <if test="miles != null "> and miles = #{miles}</if>
  192. <if test="driverbonus != null "> and driverbonus = #{driverbonus}</if>
  193. <if test="costtoll != null "> and costtoll = #{costtoll}</if>
  194. <if test="costmaintain != null "> and costmaintain = #{costmaintain}</if>
  195. <if test="costOth != null "> and cost_oth = #{costOth}</if>
  196. <if test="costRemarks != null and costRemarks != ''"> and cost_remarks = #{costRemarks}</if>
  197. <if test="oilQtyper != null "> and oil_qtyper = #{oilQtyper}</if>
  198. <if test="oilQty1 != null "> and oil_qty1 = #{oilQty1}</if>
  199. <if test="oilPrice1 != null "> and oil_price1 = #{oilPrice1}</if>
  200. <if test="oilAmt1 != null "> and oil_amt1 = #{oilAmt1}</if>
  201. <if test="oilQty2 != null "> and oil_qty2 = #{oilQty2}</if>
  202. <if test="oilPrice2 != null "> and oil_price2 = #{oilPrice2}</if>
  203. <if test="oilAmt2 != null "> and oil_amt2 = #{oilAmt2}</if>
  204. <if test="oilQty != null "> and oil_qty = #{oilQty}</if>
  205. <if test="oilPrice != null "> and oil_price = #{oilPrice}</if>
  206. <if test="oilAmt != null "> and oil_amt = #{oilAmt}</if>
  207. <if test="oilQtyBlc != null "> and oil_qty_blc = #{oilQtyBlc}</if>
  208. <if test="oilAmtBlc != null "> and oil_amt_blc = #{oilAmtBlc}</if>
  209. <if test="profit != null "> and profit = #{profit}</if>
  210. <if test="invDrNeed != null and invDrNeed != ''"> and inv_dr_need = #{invDrNeed}</if>
  211. <if test="invDrStatus != null and invDrStatus != ''"> and inv_dr_status = #{invDrStatus}</if>
  212. <if test="invDrTaxrate != null "> and inv_dr_taxrate = #{invDrTaxrate}</if>
  213. <if test="invDrTaxamt != null "> and inv_dr_taxamt = #{invDrTaxamt}</if>
  214. <if test="invDrDate != null "> and inv_dr_date = #{invDrDate}</if>
  215. <if test="invDrNo != null and invDrNo != ''"> and inv_dr_no = #{invDrNo}</if>
  216. <if test="accchkStaus != null and accchkStaus != ''"> and accchk_staus = #{accchkStaus}</if>
  217. <if test="billStatus != null "> and bill_status = #{billStatus}</if>
  218. <if test="orderStatus != null "> and order_status = #{orderStatus}</if>
  219. <if test="accchkDateCr != null "> and accchk_date_cr = #{accchkDateCr}</if>
  220. <if test="costomAmt01 != null "> and costom_amt_01 = #{costomAmt01}</if>
  221. <if test="stlAmtDr != null "> and stl_amt_dr = #{stlAmtDr}</if>
  222. <if test="costomAmt02 != null "> and costom_amt_02 = #{costomAmt02}</if>
  223. <if test="stlDateDr != null "> and stl_date_dr = #{stlDateDr}</if>
  224. <if test="costomAmt03 != null "> and costom_amt_03 = #{costomAmt03}</if>
  225. <if test="stlAmtCr != null "> and stl_amt_cr = #{stlAmtCr}</if>
  226. <if test="costomAmt04 != null "> and costom_amt_04 = #{costomAmt04}</if>
  227. <if test="stlDateCr != null "> and stl_date_cr = #{stlDateCr}</if>
  228. <if test="costomAmt05 != null "> and costom_amt_05 = #{costomAmt05}</if>
  229. <if test="costomAmt06 != null "> and costom_amt_06 = #{costomAmt06}</if>
  230. <if test="costomStr01 != null and costomStr01 != ''"> and costom_str_01 = #{costomStr01}</if>
  231. <if test="costomStr02 != null and costomStr02 != ''"> and costom_str_02 = #{costomStr02}</if>
  232. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  233. </where>
  234. </select>
  235. <select id="selectftmsorderbillscarsCount" parameterType="ftmsorderbillscars" resultType="int">
  236. select count(id) from F_TMSORDERBILLSCARS
  237. <where>
  238. <if test="pId != null "> and p_id = #{pId}</if>
  239. <if test="orgId != null "> and org_id = #{orgId}</if>
  240. <if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
  241. <if test="cntrId != null "> and cntr_id = #{cntrId}</if>
  242. <if test="cntrNo != null and cntrNo != ''"> and cntr_no = #{cntrNo}</if>
  243. <if test="carcorPid != null "> and carcor_pid = #{carcorPid}</if>
  244. <if test="mblno != null and mblno != ''"> and mblno = #{mblno}</if>
  245. <if test="carregNo != null and carregNo != ''"> and carreg_no = #{carregNo}</if>
  246. <if test="driverName != null and driverName != ''"> and driver_name like concat('%', #{driverName}, '%')</if>
  247. <if test="driverUserId != null "> and driver_user_id = #{driverUserId}</if>
  248. <if test="driverTel != null and driverTel != ''"> and driver_tel = #{driverTel}</if>
  249. <if test="planDate != null "> and plan_date = #{planDate}</if>
  250. <if test="planRemarks != null and planRemarks != ''"> and plan_remarks = #{planRemarks}</if>
  251. <if test="acceptDate != null "> and accept_date = #{acceptDate}</if>
  252. <if test="acceptRemarks != null and acceptRemarks != ''"> and accept_remarks = #{acceptRemarks}</if>
  253. <if test="loadDate != null "> and load_date = #{loadDate}</if>
  254. <if test="loadRemarks != null and loadRemarks != ''"> and load_remarks = #{loadRemarks}</if>
  255. <if test="mdLoadDate != null "> and md_load_date = #{mdLoadDate}</if>
  256. <if test="offData != null "> and off_data = #{offData}</if>
  257. <if test="offRemarks != null and offRemarks != ''"> and off_remarks = #{offRemarks}</if>
  258. <if test="mdLoadRemarks != null and mdLoadRemarks != ''"> and md_load_remarks = #{mdLoadRemarks}</if>
  259. <if test="unLoadDate != null "> and un_load_date = #{unLoadDate}</if>
  260. <if test="unLoadRemarks != null and unLoadRemarks != ''"> and un_load_remarks = #{unLoadRemarks}</if>
  261. <if test="waybillDate != null "> and waybill_date = #{waybillDate}</if>
  262. <if test="qtyLoad != null "> and qty_load = #{qtyLoad}</if>
  263. <if test="qtyUnLoad != null "> and qty_un_load = #{qtyUnLoad}</if>
  264. <if test="cntrQty != null "> and cntr_qty = #{cntrQty}</if>
  265. <if test="gopodsLossQty != null "> and gopods_loss_qty = #{gopodsLossQty}</if>
  266. <if test="cntrWeight != null "> and cntr_weight = #{cntrWeight}</if>
  267. <if test="gopodsLossrate != null "> and gopods_lossrate = #{gopodsLossrate}</if>
  268. <if test="waybillRemarks != null and waybillRemarks != ''"> and waybill_remarks = #{waybillRemarks}</if>
  269. <if test="gopodsLossamtCr != null "> and gopods_lossamt_cr = #{gopodsLossamtCr}</if>
  270. <if test="qtyDr != null "> and qty_dr = #{qtyDr}</if>
  271. <if test="gopodsLossamtDr != null "> and gopods_lossamt_dr = #{gopodsLossamtDr}</if>
  272. <if test="qtyCr != null "> and qty_cr = #{qtyCr}</if>
  273. <if test="freightPriceDr != null "> and freight_price_dr = #{freightPriceDr}</if>
  274. <if test="freightPriceCr != null "> and freight_price_cr = #{freightPriceCr}</if>
  275. <if test="freightAmtDr != null "> and freight_amt_dr = #{freightAmtDr}</if>
  276. <if test="freightAmtCr != null "> and freight_amt_cr = #{freightAmtCr}</if>
  277. <if test="feeitemDr != null "> and feeitem_dr = #{feeitemDr}</if>
  278. <if test="feeitemDrRemarks != null and feeitemDrRemarks != ''"> and feeitem_dr_remarks = #{feeitemDrRemarks}</if>
  279. <if test="feeitemCr != null "> and feeitem_cr = #{feeitemCr}</if>
  280. <if test="feeitemCrRemarks != null and feeitemCrRemarks != ''"> and feeitem_cr_remarks = #{feeitemCrRemarks}</if>
  281. <if test="amtDr != null "> and amt_dr = #{amtDr}</if>
  282. <if test="amtCr != null "> and amt_cr = #{amtCr}</if>
  283. <if test="dueDateDr != null "> and due_date_dr = #{dueDateDr}</if>
  284. <if test="dueDateCr != null "> and due_date_cr = #{dueDateCr}</if>
  285. <if test="odometerFrom != null "> and odometer_from = #{odometerFrom}</if>
  286. <if test="odometerEnd != null "> and odometer_end = #{odometerEnd}</if>
  287. <if test="milesEmpty != null "> and miles_empty = #{milesEmpty}</if>
  288. <if test="milesLoad != null "> and miles_load = #{milesLoad}</if>
  289. <if test="miles != null "> and miles = #{miles}</if>
  290. <if test="driverbonus != null "> and driverbonus = #{driverbonus}</if>
  291. <if test="costtoll != null "> and costtoll = #{costtoll}</if>
  292. <if test="costmaintain != null "> and costmaintain = #{costmaintain}</if>
  293. <if test="costOth != null "> and cost_oth = #{costOth}</if>
  294. <if test="costRemarks != null and costRemarks != ''"> and cost_remarks = #{costRemarks}</if>
  295. <if test="oilQtyper != null "> and oil_qtyper = #{oilQtyper}</if>
  296. <if test="oilQty1 != null "> and oil_qty1 = #{oilQty1}</if>
  297. <if test="oilPrice1 != null "> and oil_price1 = #{oilPrice1}</if>
  298. <if test="oilAmt1 != null "> and oil_amt1 = #{oilAmt1}</if>
  299. <if test="oilQty2 != null "> and oil_qty2 = #{oilQty2}</if>
  300. <if test="oilPrice2 != null "> and oil_price2 = #{oilPrice2}</if>
  301. <if test="oilAmt2 != null "> and oil_amt2 = #{oilAmt2}</if>
  302. <if test="oilQty != null "> and oil_qty = #{oilQty}</if>
  303. <if test="oilPrice != null "> and oil_price = #{oilPrice}</if>
  304. <if test="oilAmt != null "> and oil_amt = #{oilAmt}</if>
  305. <if test="oilQtyBlc != null "> and oil_qty_blc = #{oilQtyBlc}</if>
  306. <if test="oilAmtBlc != null "> and oil_amt_blc = #{oilAmtBlc}</if>
  307. <if test="profit != null "> and profit = #{profit}</if>
  308. <if test="invDrNeed != null and invDrNeed != ''"> and inv_dr_need = #{invDrNeed}</if>
  309. <if test="invDrStatus != null and invDrStatus != ''"> and inv_dr_status = #{invDrStatus}</if>
  310. <if test="invDrTaxrate != null "> and inv_dr_taxrate = #{invDrTaxrate}</if>
  311. <if test="invDrTaxamt != null "> and inv_dr_taxamt = #{invDrTaxamt}</if>
  312. <if test="invDrDate != null "> and inv_dr_date = #{invDrDate}</if>
  313. <if test="invDrNo != null and invDrNo != ''"> and inv_dr_no = #{invDrNo}</if>
  314. <if test="accchkStaus != null and accchkStaus != ''"> and accchk_staus = #{accchkStaus}</if>
  315. <if test="billStatus != null "> and bill_status = #{billStatus}</if>
  316. <if test="orderStatus != null "> and order_status = #{orderStatus}</if>
  317. <if test="accchkDateCr != null "> and accchk_date_cr = #{accchkDateCr}</if>
  318. <if test="costomAmt01 != null "> and costom_amt_01 = #{costomAmt01}</if>
  319. <if test="stlAmtDr != null "> and stl_amt_dr = #{stlAmtDr}</if>
  320. <if test="costomAmt02 != null "> and costom_amt_02 = #{costomAmt02}</if>
  321. <if test="stlDateDr != null "> and stl_date_dr = #{stlDateDr}</if>
  322. <if test="costomAmt03 != null "> and costom_amt_03 = #{costomAmt03}</if>
  323. <if test="stlAmtCr != null "> and stl_amt_cr = #{stlAmtCr}</if>
  324. <if test="costomAmt04 != null "> and costom_amt_04 = #{costomAmt04}</if>
  325. <if test="stlDateCr != null "> and stl_date_cr = #{stlDateCr}</if>
  326. <if test="costomAmt05 != null "> and costom_amt_05 = #{costomAmt05}</if>
  327. <if test="costomAmt06 != null "> and costom_amt_06 = #{costomAmt06}</if>
  328. <if test="costomStr01 != null and costomStr01 != ''"> and costom_str_01 = #{costomStr01}</if>
  329. <if test="costomStr02 != null and costomStr02 != ''"> and costom_str_02 = #{costomStr02}</if>
  330. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  331. </where>
  332. </select>
  333. <select id="selectftmsorderbillscarsIdList" parameterType="ftmsorderbillscars" resultMap="ftmsorderbillscarsResult">
  334. select id from F_TMSORDERBILLSCARS
  335. <where>
  336. <if test="pId != null "> and p_id = #{pId}</if>
  337. <if test="orgId != null "> and org_id = #{orgId}</if>
  338. <if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
  339. <if test="cntrId != null "> and cntr_id = #{cntrId}</if>
  340. <if test="cntrNo != null and cntrNo != ''"> and cntr_no = #{cntrNo}</if>
  341. <if test="carcorPid != null "> and carcor_pid = #{carcorPid}</if>
  342. <if test="mblno != null and mblno != ''"> and mblno = #{mblno}</if>
  343. <if test="carregNo != null and carregNo != ''"> and carreg_no = #{carregNo}</if>
  344. <if test="driverName != null and driverName != ''"> and driver_name like concat('%', #{driverName}, '%')</if>
  345. <if test="driverUserId != null "> and driver_user_id = #{driverUserId}</if>
  346. <if test="driverTel != null and driverTel != ''"> and driver_tel = #{driverTel}</if>
  347. <if test="planDate != null "> and plan_date = #{planDate}</if>
  348. <if test="planRemarks != null and planRemarks != ''"> and plan_remarks = #{planRemarks}</if>
  349. <if test="acceptDate != null "> and accept_date = #{acceptDate}</if>
  350. <if test="acceptRemarks != null and acceptRemarks != ''"> and accept_remarks = #{acceptRemarks}</if>
  351. <if test="loadDate != null "> and load_date = #{loadDate}</if>
  352. <if test="loadRemarks != null and loadRemarks != ''"> and load_remarks = #{loadRemarks}</if>
  353. <if test="mdLoadDate != null "> and md_load_date = #{mdLoadDate}</if>
  354. <if test="offData != null "> and off_data = #{offData}</if>
  355. <if test="offRemarks != null and offRemarks != ''"> and off_remarks = #{offRemarks}</if>
  356. <if test="mdLoadRemarks != null and mdLoadRemarks != ''"> and md_load_remarks = #{mdLoadRemarks}</if>
  357. <if test="unLoadDate != null "> and un_load_date = #{unLoadDate}</if>
  358. <if test="unLoadRemarks != null and unLoadRemarks != ''"> and un_load_remarks = #{unLoadRemarks}</if>
  359. <if test="waybillDate != null "> and waybill_date = #{waybillDate}</if>
  360. <if test="qtyLoad != null "> and qty_load = #{qtyLoad}</if>
  361. <if test="qtyUnLoad != null "> and qty_un_load = #{qtyUnLoad}</if>
  362. <if test="cntrQty != null "> and cntr_qty = #{cntrQty}</if>
  363. <if test="gopodsLossQty != null "> and gopods_loss_qty = #{gopodsLossQty}</if>
  364. <if test="cntrWeight != null "> and cntr_weight = #{cntrWeight}</if>
  365. <if test="gopodsLossrate != null "> and gopods_lossrate = #{gopodsLossrate}</if>
  366. <if test="waybillRemarks != null and waybillRemarks != ''"> and waybill_remarks = #{waybillRemarks}</if>
  367. <if test="gopodsLossamtCr != null "> and gopods_lossamt_cr = #{gopodsLossamtCr}</if>
  368. <if test="qtyDr != null "> and qty_dr = #{qtyDr}</if>
  369. <if test="gopodsLossamtDr != null "> and gopods_lossamt_dr = #{gopodsLossamtDr}</if>
  370. <if test="qtyCr != null "> and qty_cr = #{qtyCr}</if>
  371. <if test="freightPriceDr != null "> and freight_price_dr = #{freightPriceDr}</if>
  372. <if test="freightPriceCr != null "> and freight_price_cr = #{freightPriceCr}</if>
  373. <if test="freightAmtDr != null "> and freight_amt_dr = #{freightAmtDr}</if>
  374. <if test="freightAmtCr != null "> and freight_amt_cr = #{freightAmtCr}</if>
  375. <if test="feeitemDr != null "> and feeitem_dr = #{feeitemDr}</if>
  376. <if test="feeitemDrRemarks != null and feeitemDrRemarks != ''"> and feeitem_dr_remarks = #{feeitemDrRemarks}</if>
  377. <if test="feeitemCr != null "> and feeitem_cr = #{feeitemCr}</if>
  378. <if test="feeitemCrRemarks != null and feeitemCrRemarks != ''"> and feeitem_cr_remarks = #{feeitemCrRemarks}</if>
  379. <if test="amtDr != null "> and amt_dr = #{amtDr}</if>
  380. <if test="amtCr != null "> and amt_cr = #{amtCr}</if>
  381. <if test="dueDateDr != null "> and due_date_dr = #{dueDateDr}</if>
  382. <if test="dueDateCr != null "> and due_date_cr = #{dueDateCr}</if>
  383. <if test="odometerFrom != null "> and odometer_from = #{odometerFrom}</if>
  384. <if test="odometerEnd != null "> and odometer_end = #{odometerEnd}</if>
  385. <if test="milesEmpty != null "> and miles_empty = #{milesEmpty}</if>
  386. <if test="milesLoad != null "> and miles_load = #{milesLoad}</if>
  387. <if test="miles != null "> and miles = #{miles}</if>
  388. <if test="driverbonus != null "> and driverbonus = #{driverbonus}</if>
  389. <if test="costtoll != null "> and costtoll = #{costtoll}</if>
  390. <if test="costmaintain != null "> and costmaintain = #{costmaintain}</if>
  391. <if test="costOth != null "> and cost_oth = #{costOth}</if>
  392. <if test="costRemarks != null and costRemarks != ''"> and cost_remarks = #{costRemarks}</if>
  393. <if test="oilQtyper != null "> and oil_qtyper = #{oilQtyper}</if>
  394. <if test="oilQty1 != null "> and oil_qty1 = #{oilQty1}</if>
  395. <if test="oilPrice1 != null "> and oil_price1 = #{oilPrice1}</if>
  396. <if test="oilAmt1 != null "> and oil_amt1 = #{oilAmt1}</if>
  397. <if test="oilQty2 != null "> and oil_qty2 = #{oilQty2}</if>
  398. <if test="oilPrice2 != null "> and oil_price2 = #{oilPrice2}</if>
  399. <if test="oilAmt2 != null "> and oil_amt2 = #{oilAmt2}</if>
  400. <if test="oilQty != null "> and oil_qty = #{oilQty}</if>
  401. <if test="oilPrice != null "> and oil_price = #{oilPrice}</if>
  402. <if test="oilAmt != null "> and oil_amt = #{oilAmt}</if>
  403. <if test="oilQtyBlc != null "> and oil_qty_blc = #{oilQtyBlc}</if>
  404. <if test="oilAmtBlc != null "> and oil_amt_blc = #{oilAmtBlc}</if>
  405. <if test="profit != null "> and profit = #{profit}</if>
  406. <if test="invDrNeed != null and invDrNeed != ''"> and inv_dr_need = #{invDrNeed}</if>
  407. <if test="invDrStatus != null and invDrStatus != ''"> and inv_dr_status = #{invDrStatus}</if>
  408. <if test="invDrTaxrate != null "> and inv_dr_taxrate = #{invDrTaxrate}</if>
  409. <if test="invDrTaxamt != null "> and inv_dr_taxamt = #{invDrTaxamt}</if>
  410. <if test="invDrDate != null "> and inv_dr_date = #{invDrDate}</if>
  411. <if test="invDrNo != null and invDrNo != ''"> and inv_dr_no = #{invDrNo}</if>
  412. <if test="accchkStaus != null and accchkStaus != ''"> and accchk_staus = #{accchkStaus}</if>
  413. <if test="billStatus != null "> and bill_status = #{billStatus}</if>
  414. <if test="orderStatus != null "> and order_status = #{orderStatus}</if>
  415. <if test="accchkDateCr != null "> and accchk_date_cr = #{accchkDateCr}</if>
  416. <if test="costomAmt01 != null "> and costom_amt_01 = #{costomAmt01}</if>
  417. <if test="stlAmtDr != null "> and stl_amt_dr = #{stlAmtDr}</if>
  418. <if test="costomAmt02 != null "> and costom_amt_02 = #{costomAmt02}</if>
  419. <if test="stlDateDr != null "> and stl_date_dr = #{stlDateDr}</if>
  420. <if test="costomAmt03 != null "> and costom_amt_03 = #{costomAmt03}</if>
  421. <if test="stlAmtCr != null "> and stl_amt_cr = #{stlAmtCr}</if>
  422. <if test="costomAmt04 != null "> and costom_amt_04 = #{costomAmt04}</if>
  423. <if test="stlDateCr != null "> and stl_date_cr = #{stlDateCr}</if>
  424. <if test="costomAmt05 != null "> and costom_amt_05 = #{costomAmt05}</if>
  425. <if test="costomAmt06 != null "> and costom_amt_06 = #{costomAmt06}</if>
  426. <if test="costomStr01 != null and costomStr01 != ''"> and costom_str_01 = #{costomStr01}</if>
  427. <if test="costomStr02 != null and costomStr02 != ''"> and costom_str_02 = #{costomStr02}</if>
  428. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  429. </where>
  430. </select>
  431. <select id="selectftmsorderbillscarsMapList" parameterType="ftmsorderbills" resultType="com.ruoyi.orderPlan.domain.FtmsorderbillscarsExcel">
  432. SELECT
  433. c.id,
  434. c.order_no orderNo,
  435. c.mblno,
  436. c.carreg_no carregNo,
  437. driver.f_name driverName,
  438. c.driver_tel driverTel,
  439. CASE
  440. c.order_status
  441. WHEN 10 THEN
  442. '车队安排'
  443. WHEN 20 THEN
  444. '司机受理'
  445. WHEN 40 THEN
  446. '提箱'
  447. WHEN 50 THEN
  448. '装卸货'
  449. WHEN 60 THEN
  450. '还卸柜'
  451. WHEN 80 THEN
  452. '回单'
  453. END orderName,
  454. c.order_status orderStatus,
  455. p.f_name corpId,
  456. CASE
  457. t.bill_type
  458. WHEN 1 THEN
  459. '进口'
  460. WHEN 2 THEN
  461. '出口'
  462. WHEN 3 THEN
  463. '内贸'
  464. WHEN 4 THEN
  465. '其他'
  466. END billType,
  467. CASE
  468. t.trans_type
  469. WHEN 1 THEN
  470. '集装箱'
  471. WHEN 2 THEN
  472. '搭建'
  473. WHEN 3 THEN
  474. '散货'
  475. END transType,
  476. CASE
  477. t.trans_type
  478. WHEN 1 THEN
  479. '重去重回'
  480. WHEN 2 THEN
  481. '重去空回'
  482. WHEN 3 THEN
  483. '空去重回'
  484. END transProp,
  485. CASE
  486. c.bill_kind
  487. WHEN 'NN' THEN
  488. '直单'
  489. WHEN 'MM' THEN
  490. '主单'
  491. WHEN 'MH' THEN
  492. '从单'
  493. END billKind,
  494. c.m_bill_no mBillNo,
  495. g.f_name goodsId,
  496. c.cntr_weight cntrWeight,
  497. t.qty_plan qtyPlan,
  498. t.weight_plan weightPlan,
  499. t.ysl,
  500. t.voy,
  501. t.load_addr loadAddr,
  502. t.load_date tLoadDate,
  503. t.load_attn loadAttn,
  504. t.load_attntel loadAttntel,
  505. t.md_load_addr mdLoadAddr,
  506. t.md_load_date tMdLoadDate,
  507. t.md_load_attn mdLoadAttn,
  508. t.md_load_attn_tel mdLoadAttnTel,
  509. t.un_load_addr unLoadAddr,
  510. t.un_load_date tUnLoadDate,
  511. t.un_load_attn unLoadAttn,
  512. t.un_load_attn_tel unLoadAttnTel,
  513. dic.dict_label cntrId,
  514. pol.f_name polId,
  515. pod.f_name podId,
  516. c.accept_date acceptDate,
  517. c.cntr_qty cntrQty,
  518. c.off_data offData,
  519. c.load_date loadDate,
  520. c.md_load_date mdLoadDate,
  521. c.un_load_date unLoadDate,
  522. c.waybill_date waybillDate,
  523. c.waybill_remarks waybillRemarks,
  524. c.oil_amt oilAmt,
  525. c.cost_oth costOth,
  526. c.driverbonus driverbonus,
  527. c.cost_remarks costRemarks,
  528. c.costom_amt_06 costomAmt06,
  529. c.costom_amt_05 costomAmt05,
  530. c.costom_amt_04 costomAmt04,
  531. c.costom_amt_03 costomAmt03,
  532. c.costom_amt_02 costomAmt02,
  533. c.costom_amt_01 costomAmt01,
  534. c.costom_str_02 costomStr02,
  535. c.costom_str_01 costomStr01
  536. FROM
  537. F_TMSORDERBILLSCARS c
  538. LEFT JOIN F_TMSORDERBILLS t ON t.id = c.org_id
  539. LEFT JOIN t_corps p ON p.f_id = t.corp_id
  540. LEFT JOIN t_corps fleet ON fleet.f_id = c.carcor_pid
  541. LEFT JOIN t_goods g ON g.f_id = t.goods_id
  542. LEFT JOIN t_address pol ON pol.f_id = t.pol_id
  543. AND pol.f_types = 1
  544. LEFT JOIN t_address pod ON pod.f_id = t.pod_id
  545. AND pod.f_types = 1
  546. LEFT JOIN sys_dict_data dic ON dic.dict_value = c.cntr_id
  547. AND dic.dict_type = 'data_cntrId'
  548. LEFT JOIN t_corps driver ON driver.f_id = c.driver_user_id
  549. <where>
  550. <if test="carStatus == null">and c.bill_status &gt;= 6</if>
  551. <if test="corpId != null">and t.corp_id = #{corpId}</if>
  552. <if test="billType != null">and t.bill_type = #{billType}</if>
  553. <if test="transType != null">and t.trans_type = #{transType}</if>
  554. <if test="transProp != null">and t.trans_prop = #{transProp}</if>
  555. <if test="goodsId != null">and t.goods_id = #{goodsId}</if>
  556. <if test="driverTel != null">and c.driver_tel = #{driverTel}</if>
  557. <if test="orderStatus != null">and c.order_status = #{orderStatus}</if>
  558. <if test="carStatus != null and carStatus == 'planDate'">and c.order_status = 10</if>
  559. <if test="carStatus != null and carStatus == 'acceptDate'">and c.order_status = 20</if>
  560. <if test="carStatus != null and carStatus == 'loadDate'">and c.order_status = 40</if>
  561. <if test="carStatus != null and carStatus == 'mdLoadDate'">and c.order_status = 50</if>
  562. <if test="carStatus != null and carStatus == 'unLoadDate'">and c.order_status = 60</if>
  563. <if test="carStatus != null and carStatus == 'receiptDate'">and c.order_status = 80</if>
  564. <if test="isFleet != null and isFleet == 1">
  565. AND fleet.f_id = #{fleetId}
  566. </if>
  567. <if test='planDate != null and planDate[0] != null and planDate[0]!= ""'>
  568. and c.plan_date &gt;= #{planDate[0]}
  569. </if>
  570. <if test='planDate != null and planDate[1] != null and planDate[1]!= ""'>
  571. and c.plan_date &lt;= #{planDate[1]}
  572. </if>
  573. <if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
  574. and c.load_date &gt;= #{cLoadDate[0]}
  575. </if>
  576. <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
  577. and c.load_date &lt;= #{cLoadDate[1]}
  578. </if>
  579. <if test="mblno != null and mblno != ''">and t.mblno like concat('%', #{mblno}, '%')</if>
  580. <if test="carregNo != null and carregNo != ''">and c.carreg_no like concat('%', #{carregNo}, '%')</if>
  581. <if test="loadAddr != null and loadAddr != ''">and t.load_addr like concat('%', #{loadAddr}, '%')</if>
  582. <if test="unLoadAddr != null and unLoadAddr != ''">and t.un_load_addr like concat('%', #{unLoadAddr},'%')</if>
  583. <if test="mdLoadAddr != null and mdLoadAddr != ''">and t.md_load_addr like concat('%', #{mdLoadAddr},'%')</if>
  584. </where>
  585. ORDER BY c.id desc
  586. </select>
  587. <select id="getButtonValue" parameterType="ftmsorderbills" resultType="Map">
  588. SELECT
  589. COUNT( CASE WHEN c.order_status &lt; 80 THEN 1 END ) AS quantity,
  590. COUNT( CASE WHEN c.order_status = 10 THEN 1 END ) AS planDate,
  591. COUNT( CASE WHEN c.order_status = 20 THEN 1 END ) AS acceptDate,
  592. COUNT( CASE WHEN c.order_status = 40 THEN 1 END ) AS loadDate,
  593. COUNT( CASE WHEN c.order_status = 50 THEN 1 END ) AS mdLoadDate,
  594. COUNT( CASE WHEN c.order_status = 60 THEN 1 END ) AS unLoadDate
  595. FROM
  596. F_TMSORDERBILLSCARS c
  597. LEFT JOIN t_corps fleet ON fleet.f_id = c.carcor_pid
  598. WHERE
  599. c.bill_status &gt;= 6
  600. <if test="driverTel != null">and c.driver_tel = #{driverTel}</if>
  601. <if test="isFleet != null and isFleet == 1">AND fleet.f_id = #{fleetId}</if>
  602. </select>
  603. <select id="selectftmsorderbillscarsById" parameterType="Long" resultMap="ftmsorderbillscarsResult">
  604. <include refid="selectftmsorderbillscarsVo"/>
  605. where id = #{id}
  606. </select>
  607. <select id="selectftmsorderbillscarsByPid" parameterType="Long" resultMap="ftmsorderbillscarsResult">
  608. <include refid="selectftmsorderbillscarsVo"/>
  609. where p_id = #{pId}
  610. </select>
  611. <select id="selectStowageList" parameterType="ftmsorderbills" resultType="Map">
  612. SELECT
  613. #{id} id,
  614. c.mblno,
  615. c.order_no orderNo,
  616. t.load_addr loadAddr,
  617. t.load_date loadDate
  618. FROM
  619. F_TMSORDERBILLS t
  620. LEFT JOIN F_TMSORDERBILLSCARS c ON c.org_id = t.id
  621. <where>
  622. c.id != #{id}
  623. AND c.bill_status = 6
  624. AND c.load_date IS NULL
  625. AND c.bill_kind = "NN"
  626. AND c.driver_user_id = #{driverUserId}
  627. </where>
  628. ORDER BY c.id desc
  629. </select>
  630. <select id="planSelectCarsCount" parameterType="ftmsorderbills" resultType="int">
  631. SELECT
  632. COUNT(id)
  633. FROM
  634. F_TMSORDERBILLSCARS
  635. WHERE
  636. org_id = #{id}
  637. AND order_status &gt;= 30
  638. </select>
  639. <select id="selectTmsorderbillsCarsByDriver" parameterType="Long" resultType="Map">
  640. SELECT
  641. c.id,
  642. c.p_id AS pId,
  643. c.org_id AS orgId,
  644. c.order_no AS orderNo,
  645. dic.dict_label cntrName,
  646. t.corp_id AS fCorpId,
  647. corp.f_name AS fCorpIds,
  648. u.nick_name AS planUserId,
  649. driver.nick_name AS driverUserIds,
  650. date_format( t.un_load_date, '%Y-%m-%d' ) AS tUnLoadDate,
  651. t.un_load_addr AS tUnLoadAddr,
  652. t.un_load_attn AS tUnLoadAttn,
  653. t.un_load_attn_tel AS tUnLoadAttnTel,
  654. t.qty_plan AS qtyPlan,
  655. t.weight_plan AS weightPlan,
  656. t.bill_type AS billType,
  657. t.trans_type AS transType,
  658. t.trans_prop AS transProp,
  659. t.md_load_addr AS tMdLoadAddr,
  660. t.md_load_attn AS tMdLoadAttn,
  661. t.md_load_attn_tel AS tMdLoadAttnTel,
  662. date_format( t.md_load_date, '%Y-%m-%d' ) AS tMdLoadDate,
  663. t.load_addr AS tLoadAddr,
  664. date_format( t.load_date, '%Y-%m-%d' ) AS tLoadDate,
  665. t.load_attn AS tLoadAttn,
  666. t.load_attntel AS tLoadAttntel,
  667. c.mblno,
  668. c.driver_user_id AS driverUserId,
  669. c.driverbonus,
  670. g.f_name AS goodsId,
  671. c.bill_status AS billStatus,
  672. c.order_status AS orderStatus,
  673. c.cntr_qty AS cntrQty,
  674. c.cntr_weight AS cntrWeight,
  675. t.ysl,
  676. t.voy,
  677. t.pol_id AS polId,
  678. t.pod_id AS podId,
  679. c.m_bill_no AS mBillNo,
  680. c.bill_kind AS billKind,
  681. c.oil_amt AS oilAmt,
  682. c.cost_oth AS costOth,
  683. c.cntr_id AS cntrId,
  684. c.carreg_no AS carregNo,
  685. c.carcor_pid AS carcorPid,
  686. c.driver_tel AS driverTel,
  687. c.driver_name AS driverName,
  688. c.cost_remarks AS costRemarks,
  689. c.odometer_end AS odometerEnd,
  690. c.odometer_from AS odometerFrom,
  691. c.freight_price_dr AS freightPriceDr,
  692. c.freight_price_cr AS freightPriceCr,
  693. date_format( c.accept_date, '%Y-%m-%d' ) AS acceptDate,
  694. c.accept_remarks AS acceptRemarks,
  695. IFNULL( c.costom_amt_01, 0 ) AS costomAmt01,
  696. IFNULL( c.costom_amt_02, 0 ) AS costomAmt02,
  697. IFNULL( c.costom_amt_03, 0 ) AS costomAmt03,
  698. IFNULL( c.costom_amt_04, 0 ) AS costomAmt04,
  699. IFNULL( c.costom_amt_05, 0 ) AS costomAmt05,
  700. IFNULL( c.costom_amt_06, 0 ) AS costomAmt06,
  701. c.costom_str_01 AS costomStr01,
  702. c.costom_str_02 AS costomStr02,
  703. c.load_date AS loadDate,
  704. c.load_remarks AS loadRemarks,
  705. date_format( c.md_load_date, '%Y-%m-%d' ) AS mdLoadDate,
  706. c.md_load_remarks AS mdLoadRemarks,
  707. date_format( c.un_load_date, '%Y-%m-%d' ) AS unLoadDate,
  708. c.un_load_remarks AS unLoadRemarks,
  709. date_format( c.waybill_date, '%Y-%m-%d' ) AS waybillDate,
  710. c.waybill_remarks AS waybillRemarks
  711. FROM
  712. F_TMSORDERBILLSCARS c
  713. LEFT JOIN F_TMSORDERBILLS t ON t.id = c.org_id
  714. LEFT JOIN sys_user u ON u.user_id = t.plan_user_id
  715. LEFT JOIN sys_user driver ON driver.user_id = c.driver_user_id
  716. LEFT JOIN t_corps corp ON corp.f_id = t.corp_id
  717. LEFT JOIN t_goods g ON g.f_id = t.goods_id
  718. LEFT JOIN sys_dict_data dic ON dic.dict_value = c.cntr_id
  719. AND dic.dict_type = 'data_cntrId'
  720. where
  721. c.id = #{id}
  722. ORDER BY c.id desc
  723. </select>
  724. <select id="selectMonthlyOrder" parameterType="ftmsorderbillscars" resultType="Map">
  725. SELECT count( p_id ) countOrders, IFNULL(SUM( miles ),0) miles, IFNULL( SUM( driverbonus ), 0 ) freightAmtDr
  726. FROM F_TMSORDERBILLSCARS
  727. <where>
  728. driver_tel = #{driverTel}
  729. and order_status &gt;= 7
  730. <if test='monthList != null and monthList[0] != null and monthList[0]!= ""'>
  731. and create_time &gt;= #{monthList[0]}
  732. </if>
  733. <if test='monthList != null and monthList[1] != null and monthList[1]!= ""'>
  734. and create_time &lt;= #{monthList[1]}
  735. </if>
  736. </where>
  737. </select>
  738. <select id="selectHomeUpperRightMapList" parameterType="ftmsorderbills" resultType="Map">
  739. SELECT
  740. car.id,
  741. car.mblno,
  742. car.carreg_no carregNo,
  743. car.order_status orderStatus,
  744. t.f_name corpName
  745. FROM
  746. F_TMSORDERBILLSCARS car
  747. LEFT JOIN F_TMSORDERBILLS bill ON bill.id = car.org_id
  748. LEFT JOIN t_corps fleet ON fleet.f_id = car.carcor_pid
  749. LEFT JOIN t_corps t ON t.f_id = bill.corp_id
  750. <where>
  751. car.bill_status &gt;= 6
  752. AND car.order_status != 80
  753. <if test="isFleet != null and isFleet == 1">
  754. AND fleet.f_id = #{fleetId}
  755. </if>
  756. </where>
  757. ORDER BY
  758. car.id DESC
  759. LIMIT 10
  760. </select>
  761. <select id="selectHomeUpperLeftCntrs" parameterType="ftmsorderbills" resultType="Map">
  762. SELECT
  763. IFNULL( SUM( p.cntr_qty ), 0 ) planQuantity,
  764. IFNULL( SUM( ( p.cntr_qty - p.car_qty ) ), 0 ) surplusQuantity
  765. FROM
  766. F_TMSORDERBILLSPLANS p
  767. LEFT JOIN t_corps fleet ON fleet.f_id = p.carcor_pid
  768. WHERE
  769. p.create_time &gt;= #{currentDay[0]}
  770. AND p.create_time &lt;= #{currentDay[1]}
  771. AND p.bill_status &gt;= 6
  772. <if test="isFleet != null and isFleet == 1">
  773. AND fleet.f_id = #{fleetId}
  774. </if>
  775. </select>
  776. <select id="selectHomeUpperLeftCars" parameterType="ftmsorderbills" resultType="int">
  777. SELECT
  778. COUNT( car.id )
  779. FROM
  780. F_TMSORDERBILLSCARS car
  781. LEFT JOIN t_corps fleet ON fleet.f_id = car.carcor_pid
  782. <where>
  783. car.bill_status &gt;= 6
  784. and car.create_time &gt;= #{currentDay[0]}
  785. and car.create_time &lt;= #{currentDay[1]}
  786. <if test="isFleet != null and isFleet == 1">
  787. AND fleet.f_id = #{fleetId}
  788. </if>
  789. </where>
  790. </select>
  791. <select id="selectMissedOrdersCount" parameterType="string" resultType="Integer">
  792. select count(id) from F_TMSORDERBILLSCARS where driver_tel = #{phoneNumber} and order_status = 10 and bill_status &gt;= 6
  793. </select>
  794. <select id="selectftmsorderbillscarsByOrderNo" parameterType="string" resultMap="ftmsorderbillscarsResult">
  795. <include refid="selectftmsorderbillscarsVo"/>
  796. where order_no = #{orderNo}
  797. </select>
  798. <select id="queryLedgerList" parameterType="com.ruoyi.orderPlan.domain.VehicleLedgerExcel" resultType="com.ruoyi.orderPlan.domain.VehicleLedgerExcel">
  799. SELECT
  800. c.id,
  801. c.order_no orderNo,
  802. c.mblno,
  803. c.carreg_no carregNo,
  804. driver.f_name driverName,
  805. c.driver_tel driverTel,
  806. CASE
  807. c.order_status
  808. WHEN 10 THEN
  809. '车队安排'
  810. WHEN 20 THEN
  811. '司机受理'
  812. WHEN 40 THEN
  813. '提箱'
  814. WHEN 50 THEN
  815. '装卸货'
  816. WHEN 60 THEN
  817. '还卸柜'
  818. WHEN 80 THEN
  819. '回单'
  820. END orderName,
  821. c.order_status orderStatus,
  822. p.f_name corpId,
  823. CASE
  824. t.bill_type
  825. WHEN 1 THEN
  826. '进口'
  827. WHEN 2 THEN
  828. '出口'
  829. WHEN 3 THEN
  830. '内贸'
  831. WHEN 4 THEN
  832. '其他'
  833. END billType,
  834. CASE
  835. t.trans_type
  836. WHEN 1 THEN
  837. '集装箱'
  838. WHEN 2 THEN
  839. '搭建'
  840. WHEN 3 THEN
  841. '散货'
  842. END transType,
  843. CASE
  844. t.trans_type
  845. WHEN 1 THEN
  846. '重去重回'
  847. WHEN 2 THEN
  848. '重去空回'
  849. WHEN 3 THEN
  850. '空去重回'
  851. END transProp,
  852. CASE
  853. c.bill_kind
  854. WHEN 'NN' THEN
  855. '直单'
  856. WHEN 'MM' THEN
  857. '主单'
  858. WHEN 'MH' THEN
  859. '从单'
  860. END billKind,
  861. c.m_bill_no mBillNo,
  862. g.f_name goodsId,
  863. c.cntr_weight cntrWeight,
  864. t.qty_plan qtyPlan,
  865. t.weight_plan weightPlan,
  866. t.ysl,
  867. t.voy,
  868. t.load_addr loadAddr,
  869. t.load_date tLoadDate,
  870. t.load_attn loadAttn,
  871. t.load_attntel loadAttntel,
  872. t.md_load_addr mdLoadAddr,
  873. t.md_load_date tMdLoadDate,
  874. t.md_load_attn mdLoadAttn,
  875. t.md_load_attn_tel mdLoadAttnTel,
  876. t.un_load_addr unLoadAddr,
  877. t.un_load_date tUnLoadDate,
  878. t.un_load_attn unLoadAttn,
  879. t.un_load_attn_tel unLoadAttnTel,
  880. dic.dict_label cntrId,
  881. pol.f_name polId,
  882. pod.f_name podId,
  883. c.accept_date acceptDate,
  884. c.cntr_qty cntrQty,
  885. c.off_data offData,
  886. c.load_date loadDate,
  887. c.md_load_date mdLoadDate,
  888. c.un_load_date unLoadDate,
  889. c.waybill_date waybillDate,
  890. c.waybill_remarks waybillRemarks,
  891. c.oil_amt oilAmt,
  892. c.cost_oth costOth,
  893. c.driverbonus driverbonus,
  894. c.cost_remarks costRemarks,
  895. c.costom_amt_06 costomAmt06,
  896. c.costom_amt_05 costomAmt05,
  897. c.costom_amt_04 costomAmt04,
  898. c.costom_amt_03 costomAmt03,
  899. c.costom_amt_02 costomAmt02,
  900. c.costom_amt_01 costomAmt01,
  901. c.costom_str_02 costomStr02,
  902. c.costom_str_01 costomStr01,
  903. c.amt_dr amtDr,
  904. c.amt_dr amtCr,
  905. c.stl_amt_dr stlAmtDr,
  906. c.stl_amt_cr stlAmtCr,
  907. c.profit_bill profitBill,
  908. c.profit_car profitCar
  909. FROM
  910. F_TMSORDERBILLSCARS c
  911. LEFT JOIN F_TMSORDERBILLS t ON t.id = c.org_id
  912. LEFT JOIN t_corps p ON p.f_id = t.corp_id
  913. LEFT JOIN t_corps fleet ON fleet.f_id = c.carcor_pid
  914. LEFT JOIN t_goods g ON g.f_id = t.goods_id
  915. LEFT JOIN t_address pol ON pol.f_id = t.pol_id
  916. AND pol.f_types = 1
  917. LEFT JOIN t_address pod ON pod.f_id = t.pod_id
  918. AND pod.f_types = 1
  919. LEFT JOIN sys_dict_data dic ON dic.dict_value = c.cntr_id
  920. AND dic.dict_type = 'data_cntrId'
  921. LEFT JOIN t_corps driver ON driver.f_id = c.driver_user_id
  922. <where>
  923. <if test='stlStatus != null and stlStatus == "T"'>and c.stl_amt_dr != 0 or c.stl_amt_cr != 0</if>
  924. <if test='stlStatus != null and stlStatus == "F"'>and c.stl_amt_dr = 0 and c.stl_amt_cr = 0</if>
  925. <if test='accchkStatus != null and accchkStatus == "T"'>and c.accchk_amt_cr != 0 or c.accchk_amt_cr != 0</if>
  926. <if test='accchkStatus != null and accchkStatus == "F"'>and c.accchk_amt_dr = 0 and c.accchk_amt_dr = 0</if>
  927. <if test='invStatus != null and invStatus == "T"'>and c.inv_amt_cr != 0 or c.inv_amt_cr != 0</if>
  928. <if test='invStatus != null and invStatus == "F"'>and c.inv_amt_dr = 0 and c.inv_amt_dr = 0</if>
  929. </where>
  930. ORDER BY c.id desc
  931. </select>
  932. <insert id="insertftmsorderbillscars" parameterType="ftmsorderbillscars" useGeneratedKeys="true" keyProperty="id">
  933. insert into F_TMSORDERBILLSCARS
  934. <trim prefix="(" suffix=")" suffixOverrides=",">
  935. <if test="pId != null">p_id,</if>
  936. <if test="orgId != null">org_id,</if>
  937. <if test="orderNo != null">order_no,</if>
  938. <if test="cntrId != null">cntr_id,</if>
  939. <if test="cntrNo != null">cntr_no,</if>
  940. <if test="carcorPid != null">carcor_pid,</if>
  941. <if test="carregNo != null">carreg_no,</if>
  942. <if test="mblno != null">mblno,</if>
  943. <if test="driverName != null">driver_name,</if>
  944. <if test="driverTel != null">driver_tel,</if>
  945. <if test="driverUserId != null">driver_user_id,</if>
  946. <if test="planDate != null">plan_date,</if>
  947. <if test="planRemarks != null">plan_remarks,</if>
  948. <if test="acceptDate != null">accept_date,</if>
  949. <if test="acceptRemarks != null">accept_remarks,</if>
  950. <if test="loadDate != null">load_date,</if>
  951. <if test="loadRemarks != null">load_remarks,</if>
  952. <if test="mdLoadDate != null">md_load_date,</if>
  953. <if test="offData != null">off_data,</if>
  954. <if test="offRemarks != null">off_remarks,</if>
  955. <if test="mdLoadRemarks != null">md_load_remarks,</if>
  956. <if test="unLoadDate != null">un_load_date,</if>
  957. <if test="unLoadRemarks != null">un_load_remarks,</if>
  958. <if test="waybillDate != null">waybill_date,</if>
  959. <if test="qtyLoad != null">qty_load,</if>
  960. <if test="cntrQty != null">cntr_qty,</if>
  961. <if test="qtyUnLoad != null">qty_un_load,</if>
  962. <if test="cntrWeight != null">cntr_weight,</if>
  963. <if test="gopodsLossQty != null">gopods_loss_qty,</if>
  964. <if test="gopodsLossrate != null">gopods_lossrate,</if>
  965. <if test="gopodsLossamtCr != null">gopods_lossamt_cr,</if>
  966. <if test="qtyDr != null">qty_dr,</if>
  967. <if test="waybillRemarks != null">waybill_remarks,</if>
  968. <if test="gopodsLossamtDr != null">gopods_lossamt_dr,</if>
  969. <if test="qtyCr != null">qty_cr,</if>
  970. <if test="freightPriceDr != null">freight_price_dr,</if>
  971. <if test="freightPriceCr != null">freight_price_cr,</if>
  972. <if test="freightAmtDr != null">freight_amt_dr,</if>
  973. <if test="freightAmtCr != null">freight_amt_cr,</if>
  974. <if test="feeitemDr != null">feeitem_dr,</if>
  975. <if test="feeitemDrRemarks != null">feeitem_dr_remarks,</if>
  976. <if test="feeitemCr != null">feeitem_cr,</if>
  977. <if test="feeitemCrRemarks != null">feeitem_cr_remarks,</if>
  978. <if test="amtDr != null">amt_dr,</if>
  979. <if test="amtCr != null">amt_cr,</if>
  980. <if test="dueDateDr != null">due_date_dr,</if>
  981. <if test="dueDateCr != null">due_date_cr,</if>
  982. <if test="odometerFrom != null">odometer_from,</if>
  983. <if test="odometerEnd != null">odometer_end,</if>
  984. <if test="milesEmpty != null">miles_empty,</if>
  985. <if test="milesLoad != null">miles_load,</if>
  986. <if test="miles != null">miles,</if>
  987. <if test="driverbonus != null">driverbonus,</if>
  988. <if test="costtoll != null">costtoll,</if>
  989. <if test="costmaintain != null">costmaintain,</if>
  990. <if test="costOth != null">cost_oth,</if>
  991. <if test="costRemarks != null">cost_remarks,</if>
  992. <if test="oilQtyper != null">oil_qtyper,</if>
  993. <if test="oilQty1 != null">oil_qty1,</if>
  994. <if test="oilPrice1 != null">oil_price1,</if>
  995. <if test="oilAmt1 != null">oil_amt1,</if>
  996. <if test="oilQty2 != null">oil_qty2,</if>
  997. <if test="oilPrice2 != null">oil_price2,</if>
  998. <if test="oilAmt2 != null">oil_amt2,</if>
  999. <if test="oilQty != null">oil_qty,</if>
  1000. <if test="oilPrice != null">oil_price,</if>
  1001. <if test="oilAmt != null">oil_amt,</if>
  1002. <if test="oilQtyBlc != null">oil_qty_blc,</if>
  1003. <if test="oilAmtBlc != null">oil_amt_blc,</if>
  1004. <if test="profit != null">profit,</if>
  1005. <if test="invDrNeed != null">inv_dr_need,</if>
  1006. <if test="invDrStatus != null">inv_dr_status,</if>
  1007. <if test="invDrTaxrate != null">inv_dr_taxrate,</if>
  1008. <if test="invDrTaxamt != null">inv_dr_taxamt,</if>
  1009. <if test="invDrDate != null">inv_dr_date,</if>
  1010. <if test="invDrNo != null">inv_dr_no,</if>
  1011. <if test="accchkStaus != null">accchk_staus,</if>
  1012. <if test="billStatus != null">bill_status,</if>
  1013. <if test="orderStatus != null">order_status,</if>
  1014. <if test="costomAmt01 != null">costom_amt_01,</if>
  1015. <if test="costomAmt02 != null">costom_amt_02,</if>
  1016. <if test="stlAmtDr != null">stl_amt_dr,</if>
  1017. <if test="costomAmt03 != null">costom_amt_03,</if>
  1018. <if test="stlDateDr != null">stl_date_dr,</if>
  1019. <if test="costomAmt04 != null">costom_amt_04,</if>
  1020. <if test="stlAmtCr != null">stl_amt_cr,</if>
  1021. <if test="costomAmt05 != null">costom_amt_05,</if>
  1022. <if test="stlDateCr != null">stl_date_cr,</if>
  1023. <if test="delFlag != null">del_flag,</if>
  1024. <if test="costomAmt06 != null">costom_amt_06,</if>
  1025. <if test="costomStr01 != null">costom_str_01,</if>
  1026. <if test="createBy != null">create_by,</if>
  1027. <if test="costomStr02 != null">costom_str_02,</if>
  1028. <if test="createTime != null">create_time,</if>
  1029. <if test="updateBy != null">update_by,</if>
  1030. <if test="updateTime != null">update_time,</if>
  1031. <if test="remarks != null">remarks,</if>
  1032. <if test="accchkDateCr != null">accchk_date_cr,</if>
  1033. <if test="mBillNo != null">m_bill_no,</if>
  1034. <if test="billKind != null">bill_kind,</if>
  1035. <if test="profitBill != null">profit_bill,</if>
  1036. <if test="profitCar != null">profit_car,</if>
  1037. <if test="corpId != null">corp_id,</if>
  1038. <if test="invAmtCr != null">inv_amt_cr,</if>
  1039. <if test="invAmtDr != null">inv_amt_dr,</if>
  1040. <if test="invDateCr != null">inv_date_cr,</if>
  1041. <if test="invDateDr != null">inv_date_dr,</if>
  1042. <if test="accchkAmtCr != null">accchk_amt_cr,</if>
  1043. <if test="accchkAmtDr != null">accchk_amt_dr,</if>
  1044. <if test="accchkDateDr != null">accchk_date_dr,</if>
  1045. </trim>
  1046. <trim prefix="values (" suffix=")" suffixOverrides=",">
  1047. <if test="pId != null">#{pId},</if>
  1048. <if test="orgId != null">#{orgId},</if>
  1049. <if test="orderNo != null">#{orderNo},</if>
  1050. <if test="cntrId != null">#{cntrId},</if>
  1051. <if test="cntrNo != null">#{cntrNo},</if>
  1052. <if test="carcorPid != null">#{carcorPid},</if>
  1053. <if test="carregNo != null">#{carregNo},</if>
  1054. <if test="mblno != null">#{mblno},</if>
  1055. <if test="driverName != null">#{driverName},</if>
  1056. <if test="driverTel != null">#{driverTel},</if>
  1057. <if test="driverUserId != null">#{driverUserId},</if>
  1058. <if test="planDate != null">#{planDate},</if>
  1059. <if test="planRemarks != null">#{planRemarks},</if>
  1060. <if test="acceptDate != null">#{acceptDate},</if>
  1061. <if test="acceptRemarks != null">#{acceptRemarks},</if>
  1062. <if test="loadDate != null">#{loadDate},</if>
  1063. <if test="loadRemarks != null">#{loadRemarks},</if>
  1064. <if test="mdLoadDate != null">#{mdLoadDate},</if>
  1065. <if test="offData != null">#{offData},</if>
  1066. <if test="offRemarks != null">#{offRemarks},</if>
  1067. <if test="mdLoadRemarks != null">#{mdLoadRemarks},</if>
  1068. <if test="unLoadDate != null">#{unLoadDate},</if>
  1069. <if test="unLoadRemarks != null">#{unLoadRemarks},</if>
  1070. <if test="waybillDate != null">#{waybillDate},</if>
  1071. <if test="qtyLoad != null">#{qtyLoad},</if>
  1072. <if test="cntrQty != null">#{cntrQty},</if>
  1073. <if test="qtyUnLoad != null">#{qtyUnLoad},</if>
  1074. <if test="cntrWeight != null">#{cntrWeight},</if>
  1075. <if test="gopodsLossQty != null">#{gopodsLossQty},</if>
  1076. <if test="gopodsLossrate != null">#{gopodsLossrate},</if>
  1077. <if test="gopodsLossamtCr != null">#{gopodsLossamtCr},</if>
  1078. <if test="qtyDr != null">#{qtyDr},</if>
  1079. <if test="waybillRemarks != null">#{waybillRemarks},</if>
  1080. <if test="gopodsLossamtDr != null">#{gopodsLossamtDr},</if>
  1081. <if test="qtyCr != null">#{qtyCr},</if>
  1082. <if test="freightPriceDr != null">#{freightPriceDr},</if>
  1083. <if test="freightPriceCr != null">#{freightPriceCr},</if>
  1084. <if test="freightAmtDr != null">#{freightAmtDr},</if>
  1085. <if test="freightAmtCr != null">#{freightAmtCr},</if>
  1086. <if test="feeitemDr != null">#{feeitemDr},</if>
  1087. <if test="feeitemDrRemarks != null">#{feeitemDrRemarks},</if>
  1088. <if test="feeitemCr != null">#{feeitemCr},</if>
  1089. <if test="feeitemCrRemarks != null">#{feeitemCrRemarks},</if>
  1090. <if test="amtDr != null">#{amtDr},</if>
  1091. <if test="amtCr != null">#{amtCr},</if>
  1092. <if test="dueDateDr != null">#{dueDateDr},</if>
  1093. <if test="dueDateCr != null">#{dueDateCr},</if>
  1094. <if test="odometerFrom != null">#{odometerFrom},</if>
  1095. <if test="odometerEnd != null">#{odometerEnd},</if>
  1096. <if test="milesEmpty != null">#{milesEmpty},</if>
  1097. <if test="milesLoad != null">#{milesLoad},</if>
  1098. <if test="miles != null">#{miles},</if>
  1099. <if test="driverbonus != null">#{driverbonus},</if>
  1100. <if test="costtoll != null">#{costtoll},</if>
  1101. <if test="costmaintain != null">#{costmaintain},</if>
  1102. <if test="costOth != null">#{costOth},</if>
  1103. <if test="costRemarks != null">#{costRemarks},</if>
  1104. <if test="oilQtyper != null">#{oilQtyper},</if>
  1105. <if test="oilQty1 != null">#{oilQty1},</if>
  1106. <if test="oilPrice1 != null">#{oilPrice1},</if>
  1107. <if test="oilAmt1 != null">#{oilAmt1},</if>
  1108. <if test="oilQty2 != null">#{oilQty2},</if>
  1109. <if test="oilPrice2 != null">#{oilPrice2},</if>
  1110. <if test="oilAmt2 != null">#{oilAmt2},</if>
  1111. <if test="oilQty != null">#{oilQty},</if>
  1112. <if test="oilPrice != null">#{oilPrice},</if>
  1113. <if test="oilAmt != null">#{oilAmt},</if>
  1114. <if test="oilQtyBlc != null">#{oilQtyBlc},</if>
  1115. <if test="oilAmtBlc != null">#{oilAmtBlc},</if>
  1116. <if test="profit != null">#{profit},</if>
  1117. <if test="invDrNeed != null">#{invDrNeed},</if>
  1118. <if test="invDrStatus != null">#{invDrStatus},</if>
  1119. <if test="invDrTaxrate != null">#{invDrTaxrate},</if>
  1120. <if test="invDrTaxamt != null">#{invDrTaxamt},</if>
  1121. <if test="invDrDate != null">#{invDrDate},</if>
  1122. <if test="invDrNo != null">#{invDrNo},</if>
  1123. <if test="accchkStaus != null">#{accchkStaus},</if>
  1124. <if test="billStatus != null">#{billStatus},</if>
  1125. <if test="orderStatus != null">#{orderStatus},</if>
  1126. <if test="costomAmt01 != null">#{costomAmt01},</if>
  1127. <if test="costomAmt02 != null">#{costomAmt02},</if>
  1128. <if test="stlAmtDr != null">#{stlAmtDr},</if>
  1129. <if test="costomAmt03 != null">#{costomAmt03},</if>
  1130. <if test="stlDateDr != null">#{stlDateDr},</if>
  1131. <if test="costomAmt04 != null">#{costomAmt04},</if>
  1132. <if test="stlAmtCr != null">#{stlAmtCr},</if>
  1133. <if test="costomAmt05 != null">#{costomAmt05},</if>
  1134. <if test="stlDateCr != null">#{stlDateCr},</if>
  1135. <if test="delFlag != null">#{delFlag},</if>
  1136. <if test="costomAmt06 != null">#{costomAmt06},</if>
  1137. <if test="costomStr01 != null">#{costomStr01},</if>
  1138. <if test="createBy != null">#{createBy},</if>
  1139. <if test="costomStr02 != null">#{costomStr02},</if>
  1140. <if test="createTime != null">#{createTime},</if>
  1141. <if test="updateBy != null">#{updateBy},</if>
  1142. <if test="updateTime != null">#{updateTime},</if>
  1143. <if test="remarks != null">#{remarks},</if>
  1144. <if test="accchkDateCr != null">#{accchkDateCr},</if>
  1145. <if test="mBillNo != null">#{mBillNo},</if>
  1146. <if test="billKind != null">#{billKind},</if>
  1147. <if test="profitBill != null">#{profitBill},</if>
  1148. <if test="profitCar != null">#{profitCar},</if>
  1149. <if test="corpId != null">#{corpId},</if>
  1150. <if test="invAmtCr != null">#{invAmtCr},</if>
  1151. <if test="invAmtDr != null">#{invAmtDr},</if>
  1152. <if test="invDateCr != null">#{invDateCr},</if>
  1153. <if test="invDateDr != null">#{invDateDr},</if>
  1154. <if test="accchkAmtCr != null">#{accchkAmtCr},</if>
  1155. <if test="accchkAmtDr != null">#{accchkAmtDr},</if>
  1156. <if test="accchkDateDr != null">#{accchkDateDr},</if>
  1157. </trim>
  1158. </insert>
  1159. <update id="updateftmsorderbillscars" parameterType="ftmsorderbillscars">
  1160. update F_TMSORDERBILLSCARS
  1161. <trim prefix="SET" suffixOverrides=",">
  1162. <if test="pId != null">p_id = #{pId},</if>
  1163. <if test="orgId != null">org_id = #{orgId},</if>
  1164. <if test="orderNo != null">order_no = #{orderNo},</if>
  1165. <if test="cntrId != null">cntr_id = #{cntrId},</if>
  1166. <if test="cntrNo != null">cntr_no = #{cntrNo},</if>
  1167. <if test="carcorPid != null">carcor_pid = #{carcorPid},</if>
  1168. <if test="carregNo != null">carreg_no = #{carregNo},</if>
  1169. <if test="mblno != null">mblno = #{mblno},</if>
  1170. <if test="driverName != null">driver_name = #{driverName},</if>
  1171. <if test="driverTel != null">driver_tel = #{driverTel},</if>
  1172. <if test="driverUserId != null">driver_user_id = #{driverUserId},</if>
  1173. <if test="planDate != null">plan_date = #{planDate},</if>
  1174. <if test="planRemarks != null">plan_remarks = #{planRemarks},</if>
  1175. <if test="acceptDate != null">accept_date = #{acceptDate},</if>
  1176. <if test="acceptRemarks != null">accept_remarks = #{acceptRemarks},</if>
  1177. <if test="loadDate != null">load_date = #{loadDate},</if>
  1178. <if test="loadRemarks != null">load_remarks = #{loadRemarks},</if>
  1179. <if test="mdLoadDate != null">md_load_date = #{mdLoadDate},</if>
  1180. <if test="offData != null">off_data = #{offData},</if>
  1181. <if test="offRemarks != null">off_remarks = #{offRemarks},</if>
  1182. <if test="mdLoadRemarks != null">md_load_remarks = #{mdLoadRemarks},</if>
  1183. <if test="unLoadDate != null">un_load_date = #{unLoadDate},</if>
  1184. <if test="unLoadRemarks != null">un_load_remarks = #{unLoadRemarks},</if>
  1185. <if test="waybillDate != null">waybill_date = #{waybillDate},</if>
  1186. <if test="qtyLoad != null">qty_load = #{qtyLoad},</if>
  1187. <if test="cntrQty != null">cntr_qty = #{cntrQty},</if>
  1188. <if test="qtyUnLoad != null">qty_un_load = #{qtyUnLoad},</if>
  1189. <if test="cntrWeight != null">cntr_weight = #{cntrWeight},</if>
  1190. <if test="gopodsLossQty != null">gopods_loss_qty = #{gopodsLossQty},</if>
  1191. <if test="gopodsLossrate != null">gopods_lossrate = #{gopodsLossrate},</if>
  1192. <if test="gopodsLossamtCr != null">gopods_lossamt_cr = #{gopodsLossamtCr},</if>
  1193. <if test="qtyDr != null">qty_dr = #{qtyDr},</if>
  1194. <if test="waybillRemarks != null">waybill_remarks = #{waybillRemarks},</if>
  1195. <if test="gopodsLossamtDr != null">gopods_lossamt_dr = #{gopodsLossamtDr},</if>
  1196. <if test="qtyCr != null">qty_cr = #{qtyCr},</if>
  1197. <if test="freightPriceDr != null">freight_price_dr = #{freightPriceDr},</if>
  1198. <if test="freightPriceCr != null">freight_price_cr = #{freightPriceCr},</if>
  1199. <if test="freightAmtDr != null">freight_amt_dr = #{freightAmtDr},</if>
  1200. <if test="freightAmtCr != null">freight_amt_cr = #{freightAmtCr},</if>
  1201. <if test="feeitemDr != null">feeitem_dr = #{feeitemDr},</if>
  1202. <if test="feeitemDrRemarks != null">feeitem_dr_remarks = #{feeitemDrRemarks},</if>
  1203. <if test="feeitemCr != null">feeitem_cr = #{feeitemCr},</if>
  1204. <if test="feeitemCrRemarks != null">feeitem_cr_remarks = #{feeitemCrRemarks},</if>
  1205. <if test="amtDr != null">amt_dr = #{amtDr},</if>
  1206. <if test="amtCr != null">amt_cr = #{amtCr},</if>
  1207. <if test="dueDateDr != null">due_date_dr = #{dueDateDr},</if>
  1208. <if test="dueDateCr != null">due_date_cr = #{dueDateCr},</if>
  1209. <if test="odometerFrom != null">odometer_from = #{odometerFrom},</if>
  1210. <if test="odometerEnd != null">odometer_end = #{odometerEnd},</if>
  1211. <if test="milesEmpty != null">miles_empty = #{milesEmpty},</if>
  1212. <if test="milesLoad != null">miles_load = #{milesLoad},</if>
  1213. <if test="miles != null">miles = #{miles},</if>
  1214. <if test="driverbonus != null">driverbonus = #{driverbonus},</if>
  1215. <if test="costtoll != null">costtoll = #{costtoll},</if>
  1216. <if test="costmaintain != null">costmaintain = #{costmaintain},</if>
  1217. <if test="costOth != null">cost_oth = #{costOth},</if>
  1218. <if test="costRemarks != null">cost_remarks = #{costRemarks},</if>
  1219. <if test="oilQtyper != null">oil_qtyper = #{oilQtyper},</if>
  1220. <if test="oilQty1 != null">oil_qty1 = #{oilQty1},</if>
  1221. <if test="oilPrice1 != null">oil_price1 = #{oilPrice1},</if>
  1222. <if test="oilAmt1 != null">oil_amt1 = #{oilAmt1},</if>
  1223. <if test="oilQty2 != null">oil_qty2 = #{oilQty2},</if>
  1224. <if test="oilPrice2 != null">oil_price2 = #{oilPrice2},</if>
  1225. <if test="oilAmt2 != null">oil_amt2 = #{oilAmt2},</if>
  1226. <if test="oilQty != null">oil_qty = #{oilQty},</if>
  1227. <if test="oilPrice != null">oil_price = #{oilPrice},</if>
  1228. <if test="oilAmt != null">oil_amt = #{oilAmt},</if>
  1229. <if test="oilQtyBlc != null">oil_qty_blc = #{oilQtyBlc},</if>
  1230. <if test="oilAmtBlc != null">oil_amt_blc = #{oilAmtBlc},</if>
  1231. <if test="profit != null">profit = #{profit},</if>
  1232. <if test="invDrNeed != null">inv_dr_need = #{invDrNeed},</if>
  1233. <if test="invDrStatus != null">inv_dr_status = #{invDrStatus},</if>
  1234. <if test="invDrTaxrate != null">inv_dr_taxrate = #{invDrTaxrate},</if>
  1235. <if test="invDrTaxamt != null">inv_dr_taxamt = #{invDrTaxamt},</if>
  1236. <if test="invDrDate != null">inv_dr_date = #{invDrDate},</if>
  1237. <if test="invDrNo != null">inv_dr_no = #{invDrNo},</if>
  1238. <if test="accchkStaus != null">accchk_staus = #{accchkStaus},</if>
  1239. <if test="billStatus != null">bill_status = #{billStatus},</if>
  1240. <if test="orderStatus != null">order_status = #{orderStatus},</if>
  1241. <if test="costomAmt01 != null">costom_amt_01 = #{costomAmt01},</if>
  1242. <if test="costomAmt02 != null">costom_amt_02 = #{costomAmt02},</if>
  1243. <if test="stlAmtDr != null">stl_amt_dr = #{stlAmtDr},</if>
  1244. <if test="costomAmt03 != null">costom_amt_03 = #{costomAmt03},</if>
  1245. <if test="stlDateDr != null">stl_date_dr = #{stlDateDr},</if>
  1246. <if test="costomAmt04 != null">costom_amt_04 = #{costomAmt04},</if>
  1247. <if test="stlAmtCr != null">stl_amt_cr = #{stlAmtCr},</if>
  1248. <if test="costomAmt05 != null">costom_amt_05 = #{costomAmt05},</if>
  1249. <if test="stlDateCr != null">stl_date_cr = #{stlDateCr},</if>
  1250. <if test="delFlag != null">del_flag = #{delFlag},</if>
  1251. <if test="costomAmt06 != null">costom_amt_06 = #{costomAmt06},</if>
  1252. <if test="costomStr01 != null">costom_str_01 = #{costomStr01},</if>
  1253. <if test="createBy != null">create_by = #{createBy},</if>
  1254. <if test="costomStr02 != null">costom_str_02 = #{costomStr02},</if>
  1255. <if test="createTime != null">create_time = #{createTime},</if>
  1256. <if test="updateBy != null">update_by = #{updateBy},</if>
  1257. <if test="updateTime != null">update_time = #{updateTime},</if>
  1258. <if test="remarks != null">remarks = #{remarks},</if>
  1259. <if test="accchkDateCr != null">accchk_date_cr = #{accchkDateCr},</if>
  1260. <if test="mBillNo != null">m_bill_no = #{mBillNo},</if>
  1261. <if test="billKind != null">bill_kind = #{billKind},</if>
  1262. <if test="profitBill != null">profit_bill = #{profitBill},</if>
  1263. <if test="profitCar != null">profit_car = #{profitCar},</if>
  1264. <if test="corpId != null">corp_id = #{corpId},</if>
  1265. <if test="invAmtCr != null">inv_amt_cr = #{invAmtCr},</if>
  1266. <if test="invAmtDr != null">inv_amt_dr = #{invAmtDr},</if>
  1267. <if test="invDateCr != null">inv_date_cr = #{invDateCr},</if>
  1268. <if test="invDateDr != null">inv_date_dr = #{invDateDr},</if>
  1269. <if test="accchkAmtCr != null">accchk_amt_cr = #{accchkAmtCr},</if>
  1270. <if test="accchkAmtDr != null">accchk_amt_dr = #{accchkAmtDr},</if>
  1271. <if test="accchkDateDr != null">accchk_date_dr = #{accchkDateDr},</if>
  1272. </trim>
  1273. where id = #{id}
  1274. </update>
  1275. <update id="updateTmsorderCarStatusByOrgId" parameterType="ftmsorderbillscars">
  1276. update F_TMSORDERBILLSCARS
  1277. set bill_status = #{billStatus}
  1278. where org_id = #{orgId}
  1279. </update>
  1280. <update id="updateftmsorderbillscarsDriverNamePhone">
  1281. UPDATE F_TMSORDERBILLSCARS car
  1282. LEFT JOIN sys_user u ON u.user_id = car.driver_user_id
  1283. SET car.driver_name = u.nick_name,
  1284. car.driver_tel = u.phonenumber
  1285. WHERE
  1286. car.driver_user_id IS NOT NULL
  1287. </update>
  1288. <update id="updateftmsorderbillscarTel" parameterType="ftmsorderbillscars">
  1289. update F_TMSORDERBILLSCARS
  1290. set driver_name = #{driverName}, driver_tel = #{driverTel}
  1291. where driver_user_id = #{driverUserId} AND order_status &lt; 60
  1292. </update>
  1293. <delete id="deleteftmsorderbillscarsById" parameterType="Long">
  1294. delete from F_TMSORDERBILLSCARS where id = #{id}
  1295. </delete>
  1296. <delete id="deleteftmsorderbillscarsByPId" parameterType="Long">
  1297. delete from F_TMSORDERBILLSCARS c LEFT JOIN where p_id = #{id}
  1298. </delete>
  1299. <delete id="deleteFollowUpBusinessByCarPId" parameterType="Long">
  1300. DELETE f.*, c.*, a.* FROM F_TMSORDERBILLSCARS c
  1301. LEFT JOIN F_TMSORDERBILLSFEES f ON f.f_pid = c.id
  1302. LEFT JOIN F_TMSORDERBILLSATTACHS a ON a.p_id = c.id
  1303. WHERE c.p_id = #{id}
  1304. </delete>
  1305. <delete id="deleteftmsorderbillscarsByIds" parameterType="String">
  1306. delete from F_TMSORDERBILLSCARS where id in
  1307. <foreach item="id" collection="array" open="(" separator="," close=")">
  1308. #{id}
  1309. </foreach>
  1310. </delete>
  1311. </mapper>