TSecondCoinConfigMapper.xml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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.TSecondCoinConfigMapper">
  6. <resultMap type="TSecondCoinConfig" id="TSecondCoinConfigResult">
  7. <result property="id" column="id" />
  8. <result property="symbol" column="symbol" />
  9. <result property="market" column="market" />
  10. <result property="status" column="status" />
  11. <result property="showFlag" column="show_flag" />
  12. <result property="coin" column="coin" />
  13. <result property="sort" column="sort" />
  14. <result property="createBy" column="create_by" />
  15. <result property="createTime" column="create_time" />
  16. <result property="updateBy" column="update_by" />
  17. <result property="updateTime" column="update_time" />
  18. <result property="remark" column="remark" />
  19. <result property="searchValue" column="search_value" />
  20. <result property="logo" column="logo" />
  21. <result property="showSymbol" column="show_symbol" />
  22. <result property="baseCoin" column="base_coin" />
  23. <result property="type" column="type" />
  24. </resultMap>
  25. <sql id="selectTSecondCoinConfigVo">
  26. select id, symbol,market, status,show_flag, coin, sort, create_by, create_time, update_by, update_time, remark, search_value,logo, show_symbol,base_coin,type from t_second_coin_config
  27. </sql>
  28. <select id="selectTSecondCoinConfigList" parameterType="TSecondCoinConfig" resultMap="TSecondCoinConfigResult">
  29. <include refid="selectTSecondCoinConfigVo"/>
  30. <where>
  31. <if test="symbol != null and symbol != ''"> and symbol = #{symbol}</if>
  32. <if test="status != null "> and status = #{status}</if>
  33. <if test="market != null "> and market = #{market}</if>
  34. <if test="showFlag != null "> and show_flag = #{showFlag}</if>
  35. <if test="coin != null and coin != ''"> and coin = #{coin}</if>
  36. <if test="sort != null "> and sort = #{sort}</if>
  37. <if test="type != null "> and type = #{type}</if>
  38. <if test="searchValue != null and searchValue != ''"> and search_value = #{searchValue}</if>
  39. </where>
  40. order by sort
  41. </select>
  42. <select id="selectTSecondCoinConfigById" parameterType="Long" resultMap="TSecondCoinConfigResult">
  43. <include refid="selectTSecondCoinConfigVo"/>
  44. where id = #{id}
  45. </select>
  46. <select id="selectBathCopySecondCoinConfigList" resultType="com.ruoyi.bussiness.domain.TSecondCoinConfig">
  47. SELECT
  48. a.*
  49. FROM
  50. (
  51. SELECT
  52. c.id,
  53. c.symbol,
  54. c.show_symbol,
  55. count( p.id ) AS count
  56. FROM
  57. t_second_coin_config c
  58. LEFT JOIN t_second_period_config p ON c.id = p.second_id
  59. GROUP BY
  60. c.id,
  61. c.symbol,
  62. c.show_symbol
  63. ) a
  64. WHERE
  65. a.count > 0
  66. </select>
  67. <insert id="insertTSecondCoinConfig" parameterType="TSecondCoinConfig" useGeneratedKeys="true" keyProperty="id">
  68. insert into t_second_coin_config
  69. <trim prefix="(" suffix=")" suffixOverrides=",">
  70. <if test="symbol != null">symbol,</if>
  71. <if test="market != null">market,</if>
  72. <if test="status != null">status,</if>
  73. <if test="showFlag != null">show_flag,</if>
  74. <if test="coin != null">coin,</if>
  75. <if test="sort != null">sort,</if>
  76. <if test="type != null">type,</if>
  77. <if test="createBy != null">create_by,</if>
  78. <if test="createTime != null">create_time,</if>
  79. <if test="updateBy != null">update_by,</if>
  80. <if test="updateTime != null">update_time,</if>
  81. <if test="remark != null">remark,</if>
  82. <if test="searchValue != null">search_value,</if>
  83. <if test="logo != null">logo,</if>
  84. <if test="showSymbol != null">show_symbol,</if>
  85. <if test="baseCoin != null">base_coin,</if>
  86. </trim>
  87. <trim prefix="values (" suffix=")" suffixOverrides=",">
  88. <if test="symbol != null">#{symbol},</if>
  89. <if test="market != null">#{market},</if>
  90. <if test="status != null">#{status},</if>
  91. <if test="showFlag != null">#{showFlag},</if>
  92. <if test="coin != null">#{coin},</if>
  93. <if test="sort != null">#{sort},</if>
  94. <if test="type != null">#{type},</if>
  95. <if test="createBy != null">#{createBy},</if>
  96. <if test="createTime != null">#{createTime},</if>
  97. <if test="updateBy != null">#{updateBy},</if>
  98. <if test="updateTime != null">#{updateTime},</if>
  99. <if test="remark != null">#{remark},</if>
  100. <if test="searchValue != null">#{searchValue},</if>
  101. <if test="logo != null">#{logo},</if>
  102. <if test="showSymbol != null">#{showSymbol},</if>
  103. <if test="baseCoin != null">#{baseCoin},</if>
  104. </trim>
  105. </insert>
  106. <update id="updateTSecondCoinConfig" parameterType="TSecondCoinConfig">
  107. update t_second_coin_config
  108. <trim prefix="SET" suffixOverrides=",">
  109. <if test="symbol != null">symbol = #{symbol},</if>
  110. <if test="market != null">market = #{market},</if>
  111. <if test="status != null">status = #{status},</if>
  112. <if test="showFlag != null">show_flag = #{showFlag},</if>
  113. <if test="coin != null">coin = #{coin},</if>
  114. <if test="sort != null">sort = #{sort},</if>
  115. <if test="type != null">type = #{type},</if>
  116. <if test="createBy != null">create_by = #{createBy},</if>
  117. <if test="createTime != null">create_time = #{createTime},</if>
  118. <if test="updateBy != null">update_by = #{updateBy},</if>
  119. <if test="updateTime != null">update_time = #{updateTime},</if>
  120. <if test="remark != null">remark = #{remark},</if>
  121. <if test="searchValue != null">search_value = #{searchValue},</if>
  122. <if test="logo != null">logo = #{logo},</if>
  123. <if test="showSymbol != null">show_symbol = #{showSymbol},</if>
  124. <if test="baseCoin != null">base_coin = #{baseCoin},</if>
  125. </trim>
  126. where id = #{id}
  127. </update>
  128. <delete id="deleteTSecondCoinConfigById" parameterType="Long">
  129. delete from t_second_coin_config where id = #{id}
  130. </delete>
  131. <delete id="deleteTSecondCoinConfigByIds" parameterType="String">
  132. delete from t_second_coin_config where id in
  133. <foreach item="id" collection="array" open="(" separator="," close=")">
  134. #{id}
  135. </foreach>
  136. </delete>
  137. </mapper>