金币系统后端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.8 KiB

4 weeks ago
4 weeks ago
4 weeks ago
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.example.demo.mapperPay.PayMapper">
  6. <select id="getPay" resultType="com.example.demo.domain.dou.Pay">
  7. SELECT gps.`name` as payStyle,go.jwcode,mi.name,mi.deptName,mi.shopName,go.type,go.order_no,go.price,go.count,gps.`name`,go.success_time from g_order as go
  8. LEFT JOIN member_info as mi on go.jwcode = mi.jwcode
  9. LEFT JOIN g_pay_style gps on go.pay_style=gps.id
  10. <where>
  11. <if test="jwcode != null">
  12. and go.jwcode = #{jwcode}
  13. </if>
  14. <if test="orderNo != null and orderNo.length > 0">
  15. and go.order_no = #{orderNo}
  16. </if>
  17. <if test="type != null and type.length > 0">
  18. and go.type = #{type}
  19. </if>
  20. <if test="payStyle != null and payStyle.length > 0">
  21. and gps.`name` = #{payStyle}
  22. </if>
  23. <if test="deptName !=null and deptName.length > 0">
  24. and mi.deptName = #{deptName}
  25. </if>
  26. <if test="startTime != null and endTime != null">
  27. and FROM_UNIXTIME(go.success_time) BETWEEN #{startTime} AND #{endTime}
  28. </if>
  29. </where>
  30. <choose>
  31. <when test="sortField != null and sortField.length > 0 or sortOrder != null and sortOrder.length > 0">
  32. ORDER BY ${sortField} ${sortOrder}
  33. </when>
  34. </choose>
  35. </select>
  36. <select id="getPayIp" resultType="java.lang.String">
  37. SELECT DISTINCT deptName FROM member_info
  38. </select>
  39. <select id="getStyle" resultType="java.lang.String">
  40. SELECT DISTINCT `name` FROM g_pay_style
  41. </select>
  42. <select id="getRechargeTotal" resultType="com.example.demo.domain.dou.RechargeTotal">
  43. SELECT
  44. sum(price) as priceTotal,
  45. sum(count) as countTotal
  46. FROM g_order as go
  47. LEFT JOIN g_pay_style gps on go.pay_style=gps.id
  48. <where>
  49. <if test="jwcode != null">
  50. and go.jwcode = #{jwcode}
  51. </if>
  52. <if test="orderNo != null and orderNo.length > 0">
  53. and go.order_no = #{orderNo}
  54. </if>
  55. <if test="type != null and type.length > 0">
  56. and go.type = #{type}
  57. </if>
  58. <if test="payStyle != null and payStyle.length > 0">
  59. and gps.`name` = #{payStyle}
  60. </if>
  61. <if test="deptName !=null and deptName.length > 0">
  62. and mi.deptName = #{deptName}
  63. </if>
  64. <if test="startTime != null and endTime != null">
  65. and FROM_UNIXTIME(go.success_time) BETWEEN #{startTime} AND #{endTime}
  66. </if>
  67. </where>
  68. </select>
  69. </mapper>