ftmsorderbillscarsMapper.xml 68 KB

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