后台服务
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

2 роки тому
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.iformall.mapper.WxCardTransferInfoMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCardTransferInfo">
  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="coupon_order_id" jdbcType="BIGINT" property="couponOrderId" />
  9. <result column="title" jdbcType="VARCHAR" property="title" />
  10. <result column="amount" jdbcType="INTEGER" property="amount" />
  11. <result column="remain_amount" jdbcType="INTEGER" property="remainAmount" />
  12. <result column="from_user" jdbcType="BIGINT" property="fromUser" />
  13. <result column="to_user" jdbcType="BIGINT" property="toUser" />
  14. <result column="status" jdbcType="INTEGER" property="status" />
  15. <result column="expired_time" jdbcType="TIMESTAMP" property="expiredTime" />
  16. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  17. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  18. </resultMap>
  19. <sql id="allColumns">
  20. `id`,`tenant_id`,`parent_tenant_id`,`coupon_order_id`,`title`,`amount`,`remain_amount`,`from_user`,`to_user`,`status`,`expired_time`,
  21. `create_date`,`update_date`
  22. </sql>
  23. <sql id="dynamicWhereConditions">
  24. where 1 = 1
  25. <if test=" null != id ">
  26. and `id` = #{id}
  27. </if>
  28. <if test=" null != tenantId and '' != tenantId">
  29. and `tenant_id` = #{tenantId}
  30. </if>
  31. <if test=" null != parentTenantId and '' != parentTenantId">
  32. and `parent_tenant_id` = #{parentTenantId}
  33. </if>
  34. <if test=" null != couponOrderId ">
  35. and `coupon_order_id` = #{couponOrderId}
  36. </if>
  37. <if test=" null != fromUser ">
  38. and `from_user` = #{fromUser}
  39. </if>
  40. <if test=" null != toUser ">
  41. and `to_user` = #{toUser}
  42. </if>
  43. <if test=" null != status ">
  44. and `status` = #{status}
  45. </if>
  46. <if test=" null != ids ">
  47. and id in
  48. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  49. #{idItem}
  50. </foreach>
  51. </if>
  52. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  53. </sql>
  54. <select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap">
  55. select <include refid="allColumns" /> from wx_card_transfer_info where id = #{id} and tenant_id=#{tenantId}
  56. </select>
  57. <select id="findList" parameterType="com.iformall.domain.po.WxCardTransferInfo" resultMap="BaseResultMap">
  58. select <include refid="allColumns" /> from wx_card_transfer_info
  59. <include refid="dynamicWhereConditions" />
  60. </select>
  61. <resultMap id="CCardVoResultMap" type="com.iformall.domain.vo.WxCardCVo">
  62. <id column="id" jdbcType="BIGINT" property="id" />
  63. <result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
  64. <result column="parent_tenant_id" jdbcType="BIGINT" property="parentTenantId" />
  65. <result column="coupon_id" jdbcType="BIGINT" property="couponId" />
  66. <result column="coupon_type" jdbcType="INTEGER" property="couponType" />
  67. <result column="expired_time" jdbcType="TIMESTAMP" property="expiredTime" />
  68. <result column="coupon_order_status" jdbcType="INTEGER" property="couponOrderStatus" />
  69. <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  70. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
  71. <result column="cover_img" jdbcType="VARCHAR" property="coverImg" />
  72. <result column="title" jdbcType="VARCHAR" property="title" />
  73. <result column="sub_title" jdbcType="VARCHAR" property="subTitle" />
  74. <result column="detail" jdbcType="VARCHAR" property="detail" />
  75. <result column="unit" jdbcType="INTEGER" property="unit" />
  76. <result column="remark" jdbcType="VARCHAR" property="remark" />
  77. <result column="amount" jdbcType="INTEGER" property="amount" />
  78. <result column="remaining_amount" jdbcType="INTEGER" property="remainingAmount" />
  79. <result column="support_transfer" jdbcType="INTEGER" property="supportTransfer"/>
  80. </resultMap>
  81. <select id="findCardListOfCUser" parameterType="com.iformall.domain.vo.WxCardCVo" resultMap="CCardVoResultMap">
  82. select id,tenant_id,parent_tenant_id,0 coupon_id,0 coupon_type,expired_time,`status`as coupon_order_status,create_date,update_date,
  83. '' cover_img,title,'' sub_title,'' detail,0 unit,'' remark,amount,remain_amount as remaining_amount,0 support_transfer
  84. from wx_card_transfer_info where from_user = #{ownerId} and `tenant_id` = #{tenantId}
  85. <if test=" null != parentTenantId and '' != parentTenantId">
  86. and `parent_tenant_id` = #{parentTenantId}
  87. </if>
  88. <choose>
  89. <when test="couponOrderStatus != null">
  90. and status = #{couponOrderStatus}
  91. </when>
  92. <otherwise>
  93. and status=8
  94. </otherwise>
  95. </choose>
  96. </select>
  97. <update id="cardDefer" parameterType="map">
  98. update wx_card_transfer_info set expired_time = #{expiredTime},update_date=now() where coupon_order_id in
  99. <foreach collection="couponOrderIds" index="index" item="sItem" open="(" separator="," close=")">
  100. #{sItem}
  101. </foreach>
  102. </update>
  103. </mapper>