CargoDeliverMapper.xml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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.CargoDeliverMapper">
  4. <select id="queryOrdersByCarrier" parameterType="Params" resultType="DeliverOrder">
  5. select
  6. o.order_id,
  7. o.box_no,
  8. o.box_qty,
  9. o.car_no,
  10. o.transport_time,
  11. o.update_time,
  12. s.status_name
  13. from
  14. orders o
  15. left join
  16. status s
  17. on
  18. o.status_id=s.status_id
  19. <where>
  20. o.carrier_id=#{userId}
  21. <if test="orderId!=null">
  22. and o.order_id=#{orderId}
  23. </if>
  24. <if test="carNo!=null">
  25. and o.car_no=#{carNo}
  26. </if>
  27. <if test="statusId!=null">
  28. and o.status_id=#{statusId}
  29. </if>
  30. <if test="startTime!=null and endTime!=null">
  31. and o.require_time between #{startTime} and #{endTime}
  32. </if>
  33. </where>
  34. order by o.require_time desc
  35. limit #{startPage},#{rowNum}
  36. </select>
  37. <select id="findQueryCountByCarrier" parameterType="Params" resultType="int">
  38. select
  39. count(*)
  40. from
  41. orders
  42. <where>
  43. carrier_id=#{userId}
  44. <if test="orderId!=null">
  45. and order_id=#{orderId}
  46. </if>
  47. <if test="carNo!=null">
  48. and car_no=#{carNo}
  49. </if>
  50. <if test="statusId!=null">
  51. and status_id=#{statusId}
  52. </if>
  53. <if test="startTime!=null and endTime!=null">
  54. and require_time between #{startTime} and #{endTime}
  55. </if>
  56. </where>
  57. </select>
  58. </mapper>