OrderShareReportMapper.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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.gree.mall.manager.commonmapper.OrderShareReportMapper">
  4. <select id="queryReport" resultType="com.gree.mall.manager.bean.order.OrderShareReportBean">
  5. select od.order_id,
  6. CONCAT(od.goods_name, '(', od.goods_spec_value, ')') as goodsName,
  7. od.price,
  8. od.num,
  9. od.total_price,
  10. oi.order_status,
  11. oi.user_id,
  12. oi.create_time,
  13. oi.pay_amount,
  14. oi.pay_type,
  15. oi.freight,
  16. oi.pay_time,
  17. oi.remark,
  18. oi.rece_user_name,
  19. oi.rece_phone,
  20. CONCAT(oi.province,oi.city,oi.area,oi.street,oi.rece_address,oi.house_no) as address,
  21. oi.logistics_no,
  22. ec.name,
  23. ot.type,
  24. ot.name as tax_name,
  25. ot.content,
  26. ot.tax_no,
  27. ot.register_address,
  28. ot.register_phone,
  29. ot.bank,
  30. ot.account,
  31. ot.receiver_email,
  32. ot.receiver_phone,
  33. ot.receiver_name,
  34. ot.receiver_address,
  35. oi.discount_amount,
  36. oi.coupon_name,
  37. oi.transaction_id,
  38. os.order_share_id,
  39. os.status as shareStatus,
  40. os.work_user_name,
  41. aw.name as websitName,
  42. od.share_amount,
  43. od.main_number,
  44. os.amount,
  45. os.settle_time,
  46. eww.position
  47. from order_detail od
  48. left join order_info oi on od.order_id = oi.order_id
  49. LEFT JOIN order_share os on os.order_id = oi.order_id
  50. LEFT JOIN order_tax ot on ot.order_id = os.order_id
  51. LEFT JOIN enterprise_wechat_worker eww on eww.wechat_user_id = os.work_user_id
  52. LEFT JOIN admin_websit aw on eww.main_department = aw.id
  53. LEFT JOIN express_company ec on ec.code = oi.company_code
  54. where od.order_id in
  55. <foreach item="item" index="index" collection="orderIds" open="(" separator=","
  56. close=")">
  57. #{item}
  58. </foreach>
  59. order by od.order_id desc
  60. </select>
  61. <select id="queryReport2" resultType="com.gree.mall.manager.bean.order.OrderShareReportBean">
  62. select
  63. os.order_share_id as orderShareId,
  64. os.order_id as orderId,
  65. oi.total_product_amount as totalPrice,
  66. oi.pay_amount as payAmount,
  67. oi.freight as freight,
  68. oi.order_status as orderStatus,
  69. oi.refund_flag as refundFlag,
  70. oi.user_id as userId,
  71. oi.create_time as createTime,
  72. oi.pay_type as payType,
  73. oi.pay_time as payTime,
  74. oi.remark as remark,
  75. oi.rece_user_name as receUserName,
  76. oi.rece_phone as recePhone,
  77. CONCAT(oi.province,oi.city,oi.area,oi.street,oi.rece_address,oi.house_no) as address,
  78. oi.logistics_no as logisticsNo,
  79. ec.name as name,
  80. ot.type as type,
  81. ot.name as taxName,
  82. ot.content as content,
  83. ot.tax_no as taxNo,
  84. ot.register_address as registerAddress,
  85. ot.register_phone as registerPhone,
  86. ot.bank as bank,
  87. ot.account as account,
  88. ot.receiver_email as receiverEmail,
  89. ot.receiver_phone as receiverPhone,
  90. ot.receiver_name as receiverName,
  91. ot.receiver_address as receiverAddress,
  92. oi.discount_amount as discountAmount,
  93. oi.coupon_name as couponName,
  94. oi.transaction_id as transactionId,
  95. os.status as shareStatus ,
  96. os.work_user_name as workUserName,
  97. os.websit_id,
  98. os.amount as amount,
  99. os.settle_time as settleTime
  100. from order_share os
  101. left join order_info oi on os.order_id = oi.order_id
  102. left JOIN order_tax ot on oi.order_id = ot.order_id
  103. left JOIN express_company ec on ec.code = oi.company_code
  104. where os.order_share_id in
  105. <foreach item="item" index="index" collection="orderShareIdList" open="(" separator=","
  106. close=")">
  107. #{item}
  108. </foreach>
  109. group by os.order_share_id
  110. order by os.create_time desc ,ot.create_time desc
  111. </select>
  112. </mapper>