后台服务
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.

JmSportOrderMapper.xml 4.8 KiB

2 anni fa
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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.JmSportOrderMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.JmSportOrder">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="order_id" jdbcType="VARCHAR" property="orderId"/>
  7. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  8. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
  9. <result column="user_phone" jdbcType="VARCHAR" property="userPhone"/>
  10. <result column="user_id" jdbcType="BIGINT" property="userId"/>
  11. <result column="product_name" jdbcType="VARCHAR" property="productName"/>
  12. <result column="num" jdbcType="INTEGER" property="num"/>
  13. <result column="price" jdbcType="VARCHAR" property="price"/>
  14. <result column="payment" jdbcType="INTEGER" property="payment"/>
  15. <result column="payment_time" jdbcType="TIMESTAMP" property="paymentTime"/>
  16. <result column="pay_way" jdbcType="VARCHAR" property="payWay"/>
  17. <result column="gym_name" jdbcType="VARCHAR" property="gymName"/>
  18. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  19. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  20. </resultMap>
  21. <sql id="allColumns">
  22. `id`,`order_id`,`tenant_id`,`parent_tenant_id`,`user_phone`,`user_id`,
  23. `product_name`,`num`,`price`,`payment`,`payment_time`,`pay_way`,
  24. `gym_name`,
  25. `create_date`,`update_date`
  26. </sql>
  27. <sql id="dynamicWhereConditions">
  28. where 1 = 1
  29. <if test=" null != id ">
  30. and `id` = #{id}
  31. </if>
  32. <if test=" null != orderId and '' != orderId">
  33. and `order_id` = #{orderId}
  34. </if>
  35. <if test=" null != tenantId and '' != tenantId">
  36. and `tenant_id` = #{tenantId}
  37. </if>
  38. <if test=" null != parentTenantId and '' != parentTenantId">
  39. and `parent_tenant_id` = #{parentTenantId}
  40. </if>
  41. <if test=" null != userPhone and '' != userPhone">
  42. and `user_phone` like concat('%', #{userPhone},'%')
  43. </if>
  44. <if test=" null != userId ">
  45. and `user_id` = #{userId}
  46. </if>
  47. <if test=" null != productName and '' != productName">
  48. and `product_name` like concat('%', #{productName},'%')
  49. </if>
  50. <if test="startDate != null">
  51. and `payment_time` &gt;= #{startDate}
  52. </if>
  53. <if test="endDate != null">
  54. and `payment_time` &lt;= #{endDate}
  55. </if>
  56. <if test=" null != payWay and '' != payWay">
  57. and `pay_way` like concat('%', #{payWay},'%')
  58. </if>
  59. <if test=" null != ids ">
  60. and `id` in
  61. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  62. #{idItem}
  63. </foreach>
  64. </if>
  65. <if test=" null != sortColumns">order by ${sortColumns}</if>
  66. </sql>
  67. <select id="findList" parameterType="com.iformall.domain.po.JmSportOrder" resultMap="BaseResultMap">
  68. select
  69. <include refid="allColumns"/>
  70. from jm_sport_order
  71. <include refid="dynamicWhereConditions"/>
  72. </select>
  73. <select id="findCount" parameterType="com.iformall.domain.po.JmSportOrder" resultType="Integer">
  74. select count(1)
  75. from jm_sport_order
  76. where 1 = 1
  77. <if test=" null != tenantId and '' != tenantId">
  78. and `tenant_id` = #{tenantId}
  79. </if>
  80. <if test=" null != parentTenantId and '' != parentTenantId">
  81. and `parent_tenant_id` = #{parentTenantId}
  82. </if>
  83. <if test=" null != userId ">
  84. and `user_id` = #{userId}
  85. </if>
  86. <if test="startDate != null">
  87. and `payment_time` &gt;= #{startDate}
  88. </if>
  89. <if test="endDate != null">
  90. and `payment_time` &lt;= #{endDate}
  91. </if>
  92. </select>
  93. <select id="findAvgPayment" parameterType="com.iformall.domain.po.JmSportOrder" resultType="Integer">
  94. select TRUNCATE(Avg(payment),0)
  95. from jm_sport_order
  96. where 1 = 1
  97. <if test=" null != tenantId and '' != tenantId">
  98. and `tenant_id` = #{tenantId}
  99. </if>
  100. <if test=" null != parentTenantId and '' != parentTenantId">
  101. and `parent_tenant_id` = #{parentTenantId}
  102. </if>
  103. <if test=" null != userId ">
  104. and `user_id` = #{userId}
  105. </if>
  106. <if test="startDate != null">
  107. and `payment_time` &gt;= #{startDate}
  108. </if>
  109. <if test="endDate != null">
  110. and `payment_time` &lt;= #{endDate}
  111. </if>
  112. </select>
  113. </mapper>