BrokerageUserMapper.xml 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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="cn.newfeifan.mall.module.trade.dal.mysql.order.TradeOrderMapper">
  4. <resultMap id="BaseResultMap" type="cn.newfeifan.mall.module.distri.mq.message.order.DistriOrderMessage">
  5. <id column="totalPrice" property="totalPrice"/>
  6. <result column="price" property="price"/>
  7. <result column="productCount" property="productCount"/>
  8. <result column="costPrice" property="costPrice"/>
  9. <result column="no" property="no"/>
  10. <result column="userId" property="userId"/>
  11. <result column="shopId" property="shopId"/>
  12. <result column="merchantId" property="merchantId"/>
  13. <result column="orderId" property="orderId"/>
  14. <result column="name" property="name"/>
  15. <result column="nickName" property="nickName"/>
  16. </resultMap>
  17. <select id="queryAllOrder" resultMap="BaseResultMap">
  18. select tor.total_price as totalPrice,
  19. ps.cost_price as costPrice,
  20. ps.price as price,
  21. tor.product_count as productCount,
  22. tor.`no` as `no`,
  23. tor.id as orderId,
  24. tor.user_id as userId,
  25. ps.merchant_id as merchantId,
  26. ps.shop_id as shopId,
  27. ps.shop_id as shopId,
  28. mu.`name` as name,
  29. mu.nickname as nickname
  30. from trade_order tor
  31. LEFT JOIN member_user mu
  32. ON tor.user_id = mu.id
  33. LEFT JOIN trade_order_item toi
  34. on tor.id = toi.order_id
  35. LEFT JOIN product_sku ps
  36. on toi.sku_id = ps.id
  37. where toi.after_sale_status &lt; 10
  38. or toi.after_sale_status &gt; 50
  39. and tor.update_time BETWEEN #{start} AND #{end}
  40. </select>
  41. <select id="queryAllOrderByOrderIds"
  42. resultMap="BaseResultMap">
  43. select tor.total_price as totalPrice,
  44. ps.cost_price as costPrice,
  45. ps.price as price,
  46. tor.product_count as productCount,
  47. tor.`no` as `no`,
  48. tor.id as orderId,
  49. tor.user_id as userId,
  50. ps.merchant_id as merchantId,
  51. ps.shop_id as shopId,
  52. ps.shop_id as shopId,
  53. mu.`name` as name,
  54. mu.nickname as nickname
  55. from trade_order tor
  56. LEFT JOIN member_user mu
  57. ON tor.user_id = mu.id
  58. LEFT JOIN trade_order_item toi
  59. on tor.id = toi.order_id
  60. LEFT JOIN product_sku ps
  61. on toi.sku_id = ps.id
  62. <where>
  63. tor.pay_status = 1
  64. <if test="orderIds!=null">
  65. and tor.id in (
  66. <foreach collection="orderIds" item="orderId" separator=",">
  67. #{orderId}
  68. </foreach>
  69. )
  70. </if>
  71. </where>
  72. </select>
  73. </mapper>