ftmsorderbillscarsMapper.xml 64 KB

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