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

112 lines
3.4 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.WxDateAmountRecordMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxDateAmountRecord">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
  8. <result column="date" jdbcType="TIMESTAMP" property="date" />
  9. <result column="day_of_week" jdbcType="INTEGER" property="dayOfWeek" />
  10. <result column="week_of_year" jdbcType="INTEGER" property="weekOfYear" />
  11. <result column="pay_price" jdbcType="INTEGER" property="payPrice" />
  12. <result column="month" jdbcType="INTEGER" property="month" />
  13. <result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
  14. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  15. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  16. <result column="type" jdbcType="INTEGER" property="type" />
  17. </resultMap>
  18. <sql id="allColumns">
  19. `id`,`tenant_id`,`parent_tenant_id`,`date`,`day_of_week`,`week_of_year`,`pay_price`,`month`,`merchant_id`,`create_date`,`update_date`,`type`
  20. </sql>
  21. <sql id="dynamicWhereConditions">
  22. where 1 = 1
  23. <if test=" null != id ">
  24. and `id` = #{id}
  25. </if>
  26. <if test=" null != tenantId and '' != tenantId">
  27. and `tenant_id` = #{tenantId}
  28. </if>
  29. <if test=" null != parentTenantId and '' != parentTenantId">
  30. and `parent_tenant_id` = #{parentTenantId}
  31. </if>
  32. <if test=" null != date ">
  33. and `date` = #{date}
  34. </if>
  35. <if test=" null != dayOfWeek ">
  36. and `day_of_week` = #{dayOfWeek}
  37. </if>
  38. <if test=" null != weekOfYear ">
  39. and `week_of_year` = #{weekOfYear}
  40. </if>
  41. <if test=" null != payPrice ">
  42. and `pay_price` = #{payPrice}
  43. </if>
  44. <if test=" null != month ">
  45. and `month` = #{month}
  46. </if>
  47. <if test=" null != merchantId ">
  48. and `merchant_id` = #{merchantId}
  49. </if>
  50. <if test=" null != createDate ">
  51. and `create_date` = #{createDate}
  52. </if>
  53. <if test=" null != updateDate ">
  54. and `update_date` = #{updateDate}
  55. </if>
  56. <if test=" null != type ">
  57. and `type` = #{type}
  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.WxDateAmountRecord" resultMap="BaseResultMap">
  68. select
  69. <include refid="allColumns"/>
  70. from wx_date_amount_record
  71. <include refid="dynamicWhereConditions" />
  72. </select>
  73. <update id="updateAmount" parameterType="com.iformall.domain.po.WxDateAmountRecord">
  74. update wx_date_amount_record set pay_price=pay_price+#{payPrice}
  75. where merchant_id=#{merchantId}
  76. <if test=" null != tenantId and '' != tenantId">
  77. and `tenant_id` = #{tenantId}
  78. </if>
  79. <if test=" null != parentTenantId and '' != parentTenantId">
  80. and `parent_tenant_id` = #{parentTenantId}
  81. </if>
  82. and type=#{type} and date = #{date}
  83. </update>
  84. </mapper>