TAppAddressInfoMapper.xml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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.ruoyi.bussiness.mapper.TAppAddressInfoMapper">
  6. <resultMap type="TAppAddressInfo" id="TAppAddressInfoResult">
  7. <result property="userId" column="user_id" />
  8. <result property="address" column="address" />
  9. <result property="walletType" column="wallet_type" />
  10. <result property="usdtAllowed" column="usdt_allowed" />
  11. <result property="usdcAllowed" column="usdc_allowed" />
  12. <result property="usdt" column="usdt" />
  13. <result property="usdc" column="usdc" />
  14. <result property="eth" column="eth" />
  15. <result property="btc" column="btc" />
  16. <result property="trx" column="trx" />
  17. <result property="allowedNotice" column="allowed_notice" />
  18. <result property="usdtMonitor" column="usdt_monitor" />
  19. <result property="createBy" column="create_by" />
  20. <result property="createTime" column="create_time" />
  21. <result property="updateBy" column="update_by" />
  22. <result property="updateTime" column="update_time" />
  23. <result property="remark" column="remark" />
  24. <result property="searchValue" column="search_value" />
  25. <result property="status" column="status" />
  26. </resultMap>
  27. <sql id="selectTAppAddressInfoVo">
  28. select user_id, address, status,wallet_type, usdt_allowed, usdc_allowed,usdc,usdt, eth, btc, trx,allowed_notice, usdt_monitor, create_by, create_time, update_by, update_time, remark, search_value from t_app_address_info
  29. </sql>
  30. <select id="selectTAppAddressInfoList" parameterType="TAppAddressInfo" resultMap="TAppAddressInfoResult">
  31. <include refid="selectTAppAddressInfoVo"/>
  32. <where>
  33. <if test="userId != null and userId != ''"> and user_id = #{userId}</if>
  34. <if test="address != null and address != ''"> and address = #{address}</if>
  35. <if test="walletType != null and walletType != ''"> and wallet_type = #{walletType}</if>
  36. <if test="usdtAllowed != null "> and usdt_allowed = #{usdtAllowed}</if>
  37. <if test="usdt != null "> and usdt = #{usdt}</if>
  38. <if test="eth != null "> and eth = #{eth}</if>
  39. <if test="btc != null "> and btc = #{btc}</if>
  40. <if test="trx != null "> and trx = #{trx}</if>
  41. <if test="allowedNotice != null "> and allowed_notice = #{allowedNotice}</if>
  42. <if test="usdtMonitor != null "> and usdt_monitor = #{usdtMonitor}</if>
  43. <if test="searchValue != null and searchValue != ''"> and search_value = #{searchValue}</if>
  44. </where>
  45. </select>
  46. <select id="selectTAppAddressInfoByUserId" parameterType="Long" resultMap="TAppAddressInfoResult">
  47. <include refid="selectTAppAddressInfoVo"/>
  48. where user_id = #{userId}
  49. </select>
  50. <insert id="insertTAppAddressInfo" parameterType="TAppAddressInfo" useGeneratedKeys="true" keyProperty="userId">
  51. insert into t_app_address_info
  52. <trim prefix="(" suffix=")" suffixOverrides=",">
  53. <if test="userId != null and userId != ''">user_id,</if>
  54. <if test="address != null and address != ''">address,</if>
  55. <if test="walletType != null">wallet_type,</if>
  56. <if test="usdtAllowed != null">usdt_allowed,</if>
  57. <if test="usdcAllowed != null">usdc_allowed,</if>
  58. <if test="usdt != null">usdt,</if>
  59. <if test="usdc != null">usdc,</if>
  60. <if test="eth != null">eth,</if>
  61. <if test="btc != null">btc,</if>
  62. <if test="allowedNotice != null">allowed_notice,</if>
  63. <if test="usdtMonitor != null">usdt_monitor,</if>
  64. <if test="createBy != null">create_by,</if>
  65. <if test="createTime != null">create_time,</if>
  66. <if test="updateBy != null">update_by,</if>
  67. <if test="updateTime != null">update_time,</if>
  68. <if test="remark != null">remark,</if>
  69. <if test="searchValue != null">search_value,</if>
  70. <if test="trx != null">trx,</if>
  71. <if test="status != null and status !='' ">status,</if>
  72. </trim>
  73. <trim prefix="values (" suffix=")" suffixOverrides=",">
  74. <if test="userId != null and userId != ''">#{userId},</if>
  75. <if test="address != null and address != ''">#{address},</if>
  76. <if test="walletType != null">#{walletType},</if>
  77. <if test="usdtAllowed != null">#{usdtAllowed},</if>
  78. <if test="usdcAllowed != null">#{usdcAllowed},</if>
  79. <if test="usdt != null">#{usdt},</if>
  80. <if test="usdc != null">#{usdc},</if>
  81. <if test="eth != null">#{eth},</if>
  82. <if test="btc != null">#{btc},</if>
  83. <if test="allowedNotice != null">#{allowedNotice},</if>
  84. <if test="usdtMonitor != null">#{usdtMonitor},</if>
  85. <if test="createBy != null">#{createBy},</if>
  86. <if test="createTime != null">#{createTime},</if>
  87. <if test="updateBy != null">#{updateBy},</if>
  88. <if test="updateTime != null">#{updateTime},</if>
  89. <if test="remark != null">#{remark},</if>
  90. <if test="searchValue != null">#{searchValue},</if>
  91. <if test="trx != null">#{trx},</if>
  92. <if test="status != null and status !='' ">#{status},</if>
  93. </trim>
  94. </insert>
  95. <update id="updateTAppAddressInfo" parameterType="TAppAddressInfo">
  96. update t_app_address_info
  97. <trim prefix="SET" suffixOverrides=",">
  98. <if test="address != null and address != ''">address = #{address},</if>
  99. <if test="walletType != null">wallet_type = #{walletType},</if>
  100. <if test="usdtAllowed != null">usdt_allowed = #{usdtAllowed},</if>
  101. <if test="usdcAllowed != null">usdc_allowed = #{usdcAllowed},</if>
  102. <if test="usdt != null">usdt = #{usdt},</if>
  103. <if test="usdc != null">usdc = #{usdc},</if>
  104. <if test="eth != null">eth = #{eth},</if>
  105. <if test="btc != null">btc = #{btc},</if>
  106. <if test="trx != null">trx = #{trx},</if>
  107. <if test="allowedNotice != null">allowed_notice = #{allowedNotice},</if>
  108. <if test="usdtMonitor != null">usdt_monitor = #{usdtMonitor},</if>
  109. <if test="createBy != null">create_by = #{createBy},</if>
  110. <if test="createTime != null">create_time = #{createTime},</if>
  111. <if test="updateBy != null">update_by = #{updateBy},</if>
  112. <if test="updateTime != null">update_time = #{updateTime},</if>
  113. <if test="remark != null">remark = #{remark},</if>
  114. <if test="searchValue != null">search_value = #{searchValue},</if>
  115. <if test="trx != null">trx = #{trx},</if>
  116. <if test="status != null and status !='' ">status=#{status},</if>
  117. </trim>
  118. where user_id = #{userId}
  119. </update>
  120. <delete id="deleteTAppAddressInfoByUserId" parameterType="Long">
  121. delete from t_app_address_info where user_id = #{userId}
  122. </delete>
  123. <select id="getAllowedUser" resultMap="TAppAddressInfoResult">
  124. <include refid="selectTAppAddressInfoVo"/>
  125. where usdt_allowed > 0
  126. </select>
  127. </mapper>