TSecondContractOrderMapper.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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.TSecondContractOrderMapper">
  6. <resultMap type="TSecondContractOrder" id="TSecondContractOrderResult">
  7. <result property="id" column="id" />
  8. <result property="orderNo" column="order_no" />
  9. <result property="symbol" column="symbol" />
  10. <result property="type" column="type" />
  11. <result property="userId" column="user_id" />
  12. <result property="userAddress" column="user_address" />
  13. <result property="betContent" column="bet_content" />
  14. <result property="openResult" column="open_result" />
  15. <result property="status" column="status" />
  16. <result property="betAmount" column="bet_amount" />
  17. <result property="rewardAmount" column="reward_amount" />
  18. <result property="compensationAmount" column="compensation_amount" />
  19. <result property="createTime" column="create_time" />
  20. <result property="openPrice" column="open_price" />
  21. <result property="closePrice" column="close_price" />
  22. <result property="openTime" column="open_time" />
  23. <result property="closeTime" column="close_time" />
  24. <result property="coinSymbol" column="coin_symbol" />
  25. <result property="baseSymbol" column="base_symbol" />
  26. <result property="sign" column="sign" />
  27. <result property="manualIntervention" column="manual_intervention" />
  28. <result property="rate" column="rate" />
  29. <result property="rateFlag" column="rate_flag" />
  30. </resultMap>
  31. <sql id="selectTSecondContractOrderVo">
  32. select id, order_no, symbol, type, user_id, user_address, bet_content, open_result, status, bet_amount, reward_amount, compensation_amount, create_time, open_price, close_price, open_time, close_time, coin_symbol, base_symbol, sign, manual_intervention, rate ,admin_parent_ids ,rate_flag from t_second_contract_order
  33. </sql>
  34. <select id="selectTSecondContractOrderList" parameterType="TSecondContractOrder" resultMap="TSecondContractOrderResult">
  35. <include refid="selectTSecondContractOrderVo"/>
  36. <where>
  37. <if test="id != null "> and id = #{id}</if>
  38. <if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
  39. <if test="symbol != null and symbol != ''"> and symbol = #{symbol}</if>
  40. <if test="type != null and type != ''"> and type = #{type}</if>
  41. <if test="userId != null "> and user_id = #{userId}</if>
  42. <if test="userAddress != null and userAddress != ''"> and user_address = #{userAddress}</if>
  43. <if test="betContent != null and betContent != ''"> and bet_content = #{betContent}</if>
  44. <if test="openResult != null and openResult != ''"> and open_result = #{openResult}</if>
  45. <if test="status != null "> and status = #{status}</if>
  46. <if test="betAmount != null "> and bet_amount = #{betAmount}</if>
  47. <if test="rewardAmount != null "> and reward_amount = #{rewardAmount}</if>
  48. <if test="compensationAmount != null "> and compensation_amount = #{compensationAmount}</if>
  49. <if test="openPrice != null "> and open_price = #{openPrice}</if>
  50. <if test="closePrice != null "> and close_price = #{closePrice}</if>
  51. <if test="openTime != null "> and open_time = #{openTime}</if>
  52. <if test="closeTime != null "> and close_time = #{closeTime}</if>
  53. <if test="coinSymbol != null and coinSymbol != ''"> and coin_symbol = #{coinSymbol}</if>
  54. <if test="baseSymbol != null and baseSymbol != ''"> and base_symbol = #{baseSymbol}</if>
  55. <if test="sign != null "> and sign = #{sign}</if>
  56. <if test="manualIntervention != null "> and manual_intervention = #{manualIntervention}</if>
  57. <if test="rate != null "> and rate = #{rate}</if>
  58. <if test="rateFlag != null "> and rate_flag = #{rateFlag}</if>
  59. <if test="adminParentIds != null and adminParentIds!=''">
  60. AND find_in_set(#{adminParentIds},admin_parent_ids)
  61. </if>
  62. </where>
  63. order by create_time desc
  64. </select>
  65. <select id="selectTSecondContractOrderById" parameterType="Long" resultMap="TSecondContractOrderResult">
  66. <include refid="selectTSecondContractOrderVo"/>
  67. where id = #{id}
  68. </select>
  69. <insert id="insertTSecondContractOrder" parameterType="TSecondContractOrder" useGeneratedKeys="true" keyProperty="id">
  70. insert into t_second_contract_order
  71. <trim prefix="(" suffix=")" suffixOverrides=",">
  72. <if test="orderNo != null and orderNo != ''">order_no,</if>
  73. <if test="symbol != null and symbol != ''">symbol,</if>
  74. <if test="type != null and type != ''">type,</if>
  75. <if test="userId != null">user_id,</if>
  76. <if test="userAddress != null and userAddress != ''">user_address,</if>
  77. <if test="betContent != null and betContent != ''">bet_content,</if>
  78. <if test="openResult != null">open_result,</if>
  79. <if test="status != null">status,</if>
  80. <if test="betAmount != null">bet_amount,</if>
  81. <if test="rewardAmount != null">reward_amount,</if>
  82. <if test="compensationAmount != null">compensation_amount,</if>
  83. <if test="createTime != null">create_time,</if>
  84. <if test="openPrice != null">open_price,</if>
  85. <if test="closePrice != null">close_price,</if>
  86. <if test="openTime != null">open_time,</if>
  87. <if test="closeTime != null">close_time,</if>
  88. <if test="coinSymbol != null">coin_symbol,</if>
  89. <if test="baseSymbol != null">base_symbol,</if>
  90. <if test="sign != null">sign,</if>
  91. <if test="manualIntervention != null">manual_intervention,</if>
  92. <if test="adminParentIds != null">admin_parent_ids,</if>
  93. <if test="rate != null">rate,</if>
  94. <if test="rateFlag != null">rate_flag,</if>
  95. </trim>
  96. <trim prefix="values (" suffix=")" suffixOverrides=",">
  97. <if test="orderNo != null and orderNo != ''">#{orderNo},</if>
  98. <if test="symbol != null and symbol != ''">#{symbol},</if>
  99. <if test="type != null and type != ''">#{type},</if>
  100. <if test="userId != null">#{userId},</if>
  101. <if test="userAddress != null and userAddress != ''">#{userAddress},</if>
  102. <if test="betContent != null and betContent != ''">#{betContent},</if>
  103. <if test="openResult != null">#{openResult},</if>
  104. <if test="status != null">#{status},</if>
  105. <if test="betAmount != null">#{betAmount},</if>
  106. <if test="rewardAmount != null">#{rewardAmount},</if>
  107. <if test="compensationAmount != null">#{compensationAmount},</if>
  108. <if test="createTime != null">#{createTime},</if>
  109. <if test="openPrice != null">#{openPrice},</if>
  110. <if test="closePrice != null">#{closePrice},</if>
  111. <if test="openTime != null">#{openTime},</if>
  112. <if test="closeTime != null">#{closeTime},</if>
  113. <if test="coinSymbol != null">#{coinSymbol},</if>
  114. <if test="baseSymbol != null">#{baseSymbol},</if>
  115. <if test="sign != null">#{sign},</if>
  116. <if test="manualIntervention != null">#{manualIntervention},</if>
  117. <if test="adminParentIds != null">#{adminParentIds},</if>
  118. <if test="rate != null">#{rate},</if>
  119. <if test="rateFlag != null">#{rateFlag},</if>
  120. </trim>
  121. </insert>
  122. <update id="updateTSecondContractOrder" parameterType="TSecondContractOrder">
  123. update t_second_contract_order
  124. <trim prefix="SET" suffixOverrides=",">
  125. <if test="orderNo != null and orderNo != ''">order_no = #{orderNo},</if>
  126. <if test="symbol != null and symbol != ''">symbol = #{symbol},</if>
  127. <if test="type != null and type != ''">type = #{type},</if>
  128. <if test="userId != null">user_id = #{userId},</if>
  129. <if test="userAddress != null and userAddress != ''">user_address = #{userAddress},</if>
  130. <if test="betContent != null and betContent != ''">bet_content = #{betContent},</if>
  131. <if test="openResult != null">open_result = #{openResult},</if>
  132. <if test="status != null">status = #{status},</if>
  133. <if test="betAmount != null">bet_amount = #{betAmount},</if>
  134. <if test="rewardAmount != null">reward_amount = #{rewardAmount},</if>
  135. <if test="compensationAmount != null">compensation_amount = #{compensationAmount},</if>
  136. <if test="createTime != null">create_time = #{createTime},</if>
  137. <if test="openPrice != null">open_price = #{openPrice},</if>
  138. <if test="closePrice != null">close_price = #{closePrice},</if>
  139. <if test="openTime != null">open_time = #{openTime},</if>
  140. <if test="closeTime != null">close_time = #{closeTime},</if>
  141. <if test="coinSymbol != null">coin_symbol = #{coinSymbol},</if>
  142. <if test="baseSymbol != null">base_symbol = #{baseSymbol},</if>
  143. <if test="sign != null">sign = #{sign},</if>
  144. <if test="manualIntervention != null">manual_intervention = #{manualIntervention},</if>
  145. <if test="rate != null">rate = #{rate},</if>
  146. <if test="rateFlag != null">rate_flag = #{rateFlag},</if>
  147. </trim>
  148. where id = #{id}
  149. </update>
  150. <delete id="deleteTSecondContractOrderById" parameterType="Long">
  151. delete from t_second_contract_order where id = #{id}
  152. </delete>
  153. <delete id="deleteTSecondContractOrderByIds" parameterType="String">
  154. delete from t_second_contract_order where id in
  155. <foreach item="id" collection="array" open="(" separator="," close=")">
  156. #{id}
  157. </foreach>
  158. </delete>
  159. </mapper>