CargoConsignMapper.xml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace = "com.fuzamei.mapperInterface.CargoConsignMapper">
  4. <select id="queryOrdersBySupplier" parameterType="Params" resultType="SendOrder">
  5. select
  6. o.order_id,
  7. u.person_name as carrier_name,
  8. o.part_no,
  9. o.box_no,
  10. o.inbox_qty,
  11. o.send_time,
  12. o.update_time,
  13. s.status_name
  14. from
  15. orders o
  16. left join
  17. status s
  18. on
  19. o.status_id=s.status_id
  20. left join
  21. users u
  22. on
  23. o.carrier_id=u.user_id
  24. <where>
  25. o.supplier_id=#{userId}
  26. and o.status_id not in (1)
  27. <if test="orderId!=null">
  28. and o.order_id=#{orderId}
  29. </if>
  30. <if test="boxNo!=null and boxNo!=''">
  31. and o.box_no=#{boxNo}
  32. </if>
  33. <if test="statusId!=null">
  34. and o.status_id=#{statusId}
  35. </if>
  36. <if test="startTime!=null and endTime!=null">
  37. and o.require_time between #{startTime} and #{endTime}
  38. </if>
  39. </where>
  40. order by o.require_time desc
  41. limit #{startPage},#{rowNum}
  42. </select>
  43. <select id="findQueryCountBySupplier" parameterType="Params" resultType="int">
  44. select
  45. count(*)
  46. from
  47. orders
  48. <where>
  49. supplier_id=#{userId}
  50. and o.status_id not in (1)
  51. <if test="orderId!=null">
  52. and order_id=#{orderId}
  53. </if>
  54. <if test="boxNo!=null">
  55. and box_no=#{boxNo}
  56. </if>
  57. <if test="statusId!=null">
  58. and status_id=#{statusId}
  59. </if>
  60. <if test="startTime!=null and endTime!=null">
  61. and require_time between #{startTime} and #{endTime}
  62. </if>
  63. </where>
  64. </select>
  65. <select id="queryOrdersByCarrier" parameterType="Params" resultType="SendOrder">
  66. select
  67. o.order_id,
  68. o.part_no,
  69. o.box_no,
  70. o.inbox_qty,
  71. o.send_time,
  72. o.update_time,
  73. s.status_name
  74. from
  75. orders o
  76. left join
  77. status s
  78. on
  79. o.status_id=s.status_id
  80. <where>
  81. o.carrier_id=#{userId}
  82. and o.status_id not in (1,2)
  83. <if test="orderId!=null">
  84. and o.order_id=#{orderId}
  85. </if>
  86. <if test="boxNo!=null">
  87. and o.box_no=#{boxNo}
  88. </if>
  89. <if test="statusId!=null">
  90. and o.status_id=#{statusId}
  91. </if>
  92. <if test="startTime!=null and endTime!=null">
  93. and o.require_time between #{startTime} and #{endTime}
  94. </if>
  95. </where>
  96. order by o.require_time desc
  97. limit #{startPage},#{rowNum}
  98. </select>
  99. <select id="findQueryCountByCarrier" parameterType="Params" resultType="int">
  100. select
  101. count(*)
  102. from
  103. orders
  104. <where>
  105. carrier_id=#{userId}
  106. and o.status_id not in (1,2)
  107. <if test="orderId!=null">
  108. and order_id=#{orderId}
  109. </if>
  110. <if test="boxNo!=null">
  111. and box_no=#{boxNo}
  112. </if>
  113. <if test="statusId!=null">
  114. and status_id=#{statusId}
  115. </if>
  116. <if test="startTime!=null and endTime!=null">
  117. and require_time between #{startTime} and #{endTime}
  118. </if>
  119. </where>
  120. </select>
  121. <update id="doCarry">
  122. update
  123. orders
  124. set
  125. transport_time=#{transportTime},
  126. status_id=#{statusId},
  127. update_time=#{updateTime},
  128. car_no=#{carNo}
  129. where
  130. order_id=#{orderId}
  131. </update>
  132. </mapper>