TExchangeCoinRecordMapper.xml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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.TExchangeCoinRecordMapper">
  6. <resultMap type="com.ruoyi.bussiness.domain.TExchangeCoinRecord" id="TExchangeCoinRecordResult">
  7. <result property="id" column="id" />
  8. <result property="fromCoin" column="from_coin" />
  9. <result property="toCoin" column="to_coin" />
  10. <result property="userId" column="user_id" />
  11. <result property="username" column="username" />
  12. <result property="address" column="address" />
  13. <result property="status" column="status" />
  14. <result property="amount" column="amount" />
  15. <result property="thirdRate" column="third_rate" />
  16. <result property="systemRate" column="system_rate" />
  17. <result property="createBy" column="create_by" />
  18. <result property="createTime" column="create_time" />
  19. <result property="updateBy" column="update_by" />
  20. <result property="updateTime" column="update_time" />
  21. <result property="remark" column="remark" />
  22. <result property="searchValue" column="search_value" />
  23. </resultMap>
  24. <sql id="selectTExchangeCoinRecordVo">
  25. select id, from_coin, to_coin, user_id, username, address, status, amount, third_rate, system_rate, create_by, create_time, update_by, update_time, remark, search_value from t_exchange_coin_record
  26. </sql>
  27. <select id="selectTExchangeCoinRecordList" parameterType="TExchangeCoinRecord" resultMap="TExchangeCoinRecordResult">
  28. <include refid="selectTExchangeCoinRecordVo"/>
  29. <where>
  30. <if test="fromCoin != null and fromCoin != ''"> and from_coin = #{fromCoin}</if>
  31. <if test="toCoin != null and toCoin != ''"> and to_coin = #{toCoin}</if>
  32. <if test="userId != null "> and user_id = #{userId}</if>
  33. <if test="username != null and username != ''"> and username like concat('%', #{username}, '%')</if>
  34. <if test="address != null and address != ''"> and address = #{address}</if>
  35. <if test="status != null "> and status = #{status}</if>
  36. <if test="amount != null "> and amount = #{amount}</if>
  37. <if test="thirdRate != null "> and third_rate = #{thirdRate}</if>
  38. <if test="systemRate != null "> and system_rate = #{systemRate}</if>
  39. <if test="searchValue != null and searchValue != ''"> and search_value = #{searchValue}</if>
  40. <if test="adminParentIds != null and adminParentIds!=''">
  41. AND find_in_set(#{adminParentIds},admin_parent_ids)
  42. </if>
  43. </where>
  44. order by create_time desc
  45. </select>
  46. <select id="selectTExchangeCoinRecordById" parameterType="Long" resultMap="TExchangeCoinRecordResult">
  47. <include refid="selectTExchangeCoinRecordVo"/>
  48. where id = #{id}
  49. </select>
  50. <select id="getListByLimit" resultType="com.ruoyi.bussiness.domain.TExchangeCoinRecord"
  51. parameterType="int">
  52. SELECT
  53. *
  54. FROM
  55. t_exchange_coin_record
  56. WHERE
  57. status = 0
  58. ORDER BY create_time limit #{size}
  59. </select>
  60. <select id="countByExchangeCoinRecord" resultType="java.lang.Integer"
  61. parameterType="com.ruoyi.bussiness.domain.TExchangeCoinRecord">
  62. SELECT
  63. COUNT(1)
  64. FROM
  65. t_exchange_coin_record
  66. <where>
  67. <if test="userId != null">
  68. AND user_id = #{userId}
  69. </if>
  70. <if test="address != null and address !=''">
  71. AND address = #{address}
  72. </if>
  73. <if test="status != null">
  74. AND status = #{status}
  75. </if>
  76. <if test="fromCoin != null and fromCoin != ''">
  77. AND from_coin = #{fromCoin}
  78. </if>
  79. <if test="toCoin != null and toCoin != ''">
  80. AND to_coin = #{toCoin}
  81. </if>
  82. </where>
  83. </select>
  84. <insert id="insertTExchangeCoinRecord" parameterType="TExchangeCoinRecord" useGeneratedKeys="true" keyProperty="id">
  85. insert into t_exchange_coin_record
  86. <trim prefix="(" suffix=")" suffixOverrides=",">
  87. <if test="fromCoin != null and fromCoin != ''">from_coin,</if>
  88. <if test="toCoin != null and toCoin != ''">to_coin,</if>
  89. <if test="userId != null">user_id,</if>
  90. <if test="username != null">username,</if>
  91. <if test="address != null">address,</if>
  92. <if test="status != null">status,</if>
  93. <if test="amount != null">amount,</if>
  94. <if test="thirdRate != null">third_rate,</if>
  95. <if test="systemRate != null">system_rate,</if>
  96. <if test="createBy != null">create_by,</if>
  97. <if test="createTime != null">create_time,</if>
  98. <if test="updateBy != null">update_by,</if>
  99. <if test="updateTime != null">update_time,</if>
  100. <if test="remark != null">remark,</if>
  101. <if test="searchValue != null">search_value,</if>
  102. </trim>
  103. <trim prefix="values (" suffix=")" suffixOverrides=",">
  104. <if test="fromCoin != null and fromCoin != ''">#{fromCoin},</if>
  105. <if test="toCoin != null and toCoin != ''">#{toCoin},</if>
  106. <if test="userId != null">#{userId},</if>
  107. <if test="username != null">#{username},</if>
  108. <if test="address != null">#{address},</if>
  109. <if test="status != null">#{status},</if>
  110. <if test="amount != null">#{amount},</if>
  111. <if test="thirdRate != null">#{thirdRate},</if>
  112. <if test="systemRate != null">#{systemRate},</if>
  113. <if test="createBy != null">#{createBy},</if>
  114. <if test="createTime != null">#{createTime},</if>
  115. <if test="updateBy != null">#{updateBy},</if>
  116. <if test="updateTime != null">#{updateTime},</if>
  117. <if test="remark != null">#{remark},</if>
  118. <if test="searchValue != null">#{searchValue},</if>
  119. </trim>
  120. </insert>
  121. <update id="updateTExchangeCoinRecord" parameterType="TExchangeCoinRecord">
  122. update t_exchange_coin_record
  123. <trim prefix="SET" suffixOverrides=",">
  124. <if test="fromCoin != null and fromCoin != ''">from_coin = #{fromCoin},</if>
  125. <if test="toCoin != null and toCoin != ''">to_coin = #{toCoin},</if>
  126. <if test="userId != null">user_id = #{userId},</if>
  127. <if test="username != null">username = #{username},</if>
  128. <if test="address != null">address = #{address},</if>
  129. <if test="status != null">status = #{status},</if>
  130. <if test="amount != null">amount = #{amount},</if>
  131. <if test="thirdRate != null">third_rate = #{thirdRate},</if>
  132. <if test="systemRate != null">system_rate = #{systemRate},</if>
  133. <if test="createBy != null">create_by = #{createBy},</if>
  134. <if test="createTime != null">create_time = #{createTime},</if>
  135. <if test="updateBy != null">update_by = #{updateBy},</if>
  136. <if test="updateTime != null">update_time = #{updateTime},</if>
  137. <if test="remark != null">remark = #{remark},</if>
  138. <if test="searchValue != null">search_value = #{searchValue},</if>
  139. </trim>
  140. where id = #{id}
  141. </update>
  142. <delete id="deleteTExchangeCoinRecordById" parameterType="Long">
  143. delete from t_exchange_coin_record where id = #{id}
  144. </delete>
  145. <delete id="deleteTExchangeCoinRecordByIds" parameterType="String">
  146. delete from t_exchange_coin_record where id in
  147. <foreach item="id" collection="array" open="(" separator="," close=")">
  148. #{id}
  149. </foreach>
  150. </delete>
  151. </mapper>