Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 
 

84 righe
2.9 KiB

  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.iformall.mapper.NeuPosOrderMasterExtMapper">
  4. <select id="queryShopPayTypeTradeList" parameterType="com.iformall.domain.po.NeuPosOrderMasterExt" resultType="java.util.Map">
  5. SELECT shop_id as shopId,
  6. sum(real_pay_amount) as payAmount,
  7. count(0) as payCount
  8. from order_master
  9. where order_status = 2 and order_type != '3'
  10. <if test=" orgId != null">
  11. and org_id = #{orgId}
  12. </if>
  13. <if test=" shopId != null">
  14. and shop_id = #{shopId}
  15. </if>
  16. <if test=" createBegin != null">
  17. and created_at &gt;= #{createBegin}
  18. </if>
  19. <if test=" createEnd != null">
  20. and created_at &lt;= #{createEnd}
  21. </if>
  22. GROUP BY shop_id
  23. ORDER BY shop_id asc
  24. </select>
  25. <select id="queryShopPayOrderList" parameterType="com.iformall.domain.po.NeuPosOrderMasterExt" resultType="java.util.Map">
  26. select ifnull(sum(order_amount),0) as payAmount,
  27. ifnull(sum(discount_amount),0) as discountAmount,
  28. count(order_amount) as payCount,
  29. ifnull(sum(if(order_status=4,real_pay_amount,0)),0) refundAmount,
  30. count(if(order_status=4,true,null)) refundCount,
  31. ifnull(sum(if(order_status=2,real_pay_amount,0)),0) as amount,
  32. pay_type as payType
  33. from order_master
  34. where pay_status = 2 and order_type != '3'
  35. <if test=" orgId != null">
  36. and org_id = #{orgId}
  37. </if>
  38. <if test=" shopId != null">
  39. and shop_id = #{shopId}
  40. </if>
  41. <if test=" createBegin != null">
  42. and created_at &gt;= #{createBegin}
  43. </if>
  44. <if test=" createEnd != null">
  45. and created_at &lt;= #{createEnd}
  46. </if>
  47. GROUP BY pay_type
  48. </select>
  49. <select id="selectShopList" parameterType="Integer" resultType="java.util.Map">
  50. select id,name from `shop` where status = 1
  51. <if test=" orgId != null">
  52. and org_id = #{orgId}
  53. </if>
  54. order by name asc
  55. </select>
  56. <select id="selectPayTypeList" resultType="java.util.Map">
  57. select pay_type,name from `trade_pay_type_dict`
  58. </select>
  59. <select id="queryOrderList" parameterType="com.iformall.domain.po.NeuPosOrderMasterExt" resultType="java.util.Map">
  60. SELECT order_number as orderNumber, serial_no as serialNo, order_amount as orderAmount,real_pay_amount as realPayAmount,
  61. discount_amount as discountAmount, pay_type as payType,paid_time as paidTime,order_status as orderStatus
  62. from order_master
  63. where order_status = 2 and order_type != '3'
  64. <if test=" orgId != null">
  65. and org_id = #{orgId}
  66. </if>
  67. <if test=" shopId != null">
  68. and shop_id = #{shopId}
  69. </if>
  70. <if test=" createBegin != null">
  71. and created_at &gt;= #{createBegin}
  72. </if>
  73. <if test=" createEnd != null">
  74. and created_at &lt;= #{createEnd}
  75. </if>
  76. ORDER BY created_at desc
  77. </select>
  78. </mapper>