CargoConsignMapper.xml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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="Param" 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. <if test="orderId!=null">
  27. and o.order_id=#{orderId}
  28. </if>
  29. <if test="boxNo!=null">
  30. and o.box_no=#{boxNo}
  31. </if>
  32. <if test="statusId!=null">
  33. and o.status_id=#{statusId}
  34. </if>
  35. <if test="startTime!=null and endTime!=null">
  36. and o.require_time between #{startTime} and #{endTime}
  37. </if>
  38. </where>
  39. order by o.require_time desc
  40. limit #{startPage},#{rowNum}
  41. </select>
  42. <select id="findQueryCountBySupplier" parameterType="Param" resultType="int">
  43. select
  44. count(*)
  45. from
  46. orders
  47. <where>
  48. supplier_id=#{userId}
  49. <if test="orderId!=null">
  50. and order_id=#{orderId}
  51. </if>
  52. <if test="boxNo!=null">
  53. and box_no=#{boxNo}
  54. </if>
  55. <if test="statusId!=null">
  56. and status_id=#{statusId}
  57. </if>
  58. <if test="startTime!=null and endTime!=null">
  59. and require_time between #{startTime} and #{endTime}
  60. </if>
  61. </where>
  62. </select>
  63. <select id="queryOrdersByCarrier" parameterType="Param" resultType="SendOrder">
  64. select
  65. o.order_id,
  66. o.part_no,
  67. o.box_no,
  68. o.inbox_qty,
  69. o.send_time,
  70. o.update_time,
  71. s.status_name
  72. from
  73. orders o
  74. left join
  75. status s
  76. on
  77. o.status_id=s.status_id
  78. <where>
  79. o.carrier_id=#{carrierId}
  80. <if test="orderId!=null">
  81. and o.order_id=#{orderId}
  82. </if>
  83. <if test="boxNo!=null">
  84. and o.box_no=#{boxNo}
  85. </if>
  86. <if test="statusId!=null">
  87. and o.status_id=#{statusId}
  88. </if>
  89. <if test="startTime!=null and endTime!=null">
  90. and o.require_time between #{startTime} and #{endTime}
  91. </if>
  92. </where>
  93. order by o.require_time desc
  94. limit #{startPage},#{rowNum}
  95. </select>
  96. <select id="findQueryCountByCarrier" parameterType="Param" resultType="int">
  97. select
  98. count(*)
  99. from
  100. orders
  101. <where>
  102. carrier_id=#{carrierId}
  103. <if test="orderId!=null">
  104. and order_id=#{orderId}
  105. </if>
  106. <if test="boxNo!=null">
  107. and box_no=#{boxNo}
  108. </if>
  109. <if test="statusId!=null">
  110. and status_id=#{statusId}
  111. </if>
  112. <if test="startTime!=null and endTime!=null">
  113. and require_time between #{startTime} and #{endTime}
  114. </if>
  115. </where>
  116. </select>
  117. <update id="doCarry">
  118. update
  119. orders
  120. set
  121. transport_time=#{transportTime},
  122. status_id=#{statusId},
  123. update_time=#{updateTime},
  124. car_no=#{carNo}
  125. where
  126. order_id=#{orderId}
  127. </update>
  128. </mapper>