TSpontaneousCoinMapper.xml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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.TSpontaneousCoinMapper">
  6. <resultMap type="TSpontaneousCoin" id="TSpontaneousCoinResult">
  7. <result property="id" column="id" />
  8. <result property="coin" column="coin" />
  9. <result property="logo" column="logo" />
  10. <result property="referCoin" column="refer_coin" />
  11. <result property="referMarket" column="refer_market" />
  12. <result property="showSymbol" column="show_symbol" />
  13. <result property="price" column="price" />
  14. <result property="proportion" column="proportion" />
  15. <result property="createBy" column="create_by" />
  16. <result property="createTime" column="create_time" />
  17. <result property="updateBy" column="update_by" />
  18. <result property="updateTime" column="update_time" />
  19. <result property="remark" column="remark" />
  20. </resultMap>
  21. <sql id="selectTSpontaneousCoinVo">
  22. select id, coin, logo, refer_coin, refer_market, show_symbol, price, proportion, create_by, create_time, update_by, update_time, remark from t_spontaneous_coin
  23. </sql>
  24. <select id="selectTSpontaneousCoinList" parameterType="TSpontaneousCoin" resultMap="TSpontaneousCoinResult">
  25. <include refid="selectTSpontaneousCoinVo"/>
  26. <where>
  27. <if test="coin != null and coin != ''"> and coin = #{coin}</if>
  28. <if test="logo != null and logo != ''"> and logo = #{logo}</if>
  29. <if test="referCoin != null and referCoin != ''"> and refer_coin = #{referCoin}</if>
  30. <if test="referMarket != null and referMarket != ''"> and refer_market = #{referMarket}</if>
  31. <if test="showSymbol != null and showSymbol != ''"> and show_symbol = #{showSymbol}</if>
  32. <if test="price != null "> and price = #{price}</if>
  33. <if test="proportion != null "> and proportion = #{proportion}</if>
  34. </where>
  35. </select>
  36. <select id="selectTSpontaneousCoinById" parameterType="Long" resultMap="TSpontaneousCoinResult">
  37. <include refid="selectTSpontaneousCoinVo"/>
  38. where id = #{id}
  39. </select>
  40. <insert id="insertTSpontaneousCoin" parameterType="TSpontaneousCoin" useGeneratedKeys="true" keyProperty="id">
  41. insert into t_spontaneous_coin
  42. <trim prefix="(" suffix=")" suffixOverrides=",">
  43. <if test="coin != null">coin,</if>
  44. <if test="logo != null">logo,</if>
  45. <if test="referCoin != null">refer_coin,</if>
  46. <if test="referMarket != null">refer_market,</if>
  47. <if test="showSymbol != null">show_symbol,</if>
  48. <if test="price != null">price,</if>
  49. <if test="proportion != null">proportion,</if>
  50. <if test="createBy != null">create_by,</if>
  51. <if test="createTime != null">create_time,</if>
  52. <if test="updateBy != null">update_by,</if>
  53. <if test="updateTime != null">update_time,</if>
  54. <if test="remark != null">remark,</if>
  55. </trim>
  56. <trim prefix="values (" suffix=")" suffixOverrides=",">
  57. <if test="coin != null">#{coin},</if>
  58. <if test="logo != null">#{logo},</if>
  59. <if test="referCoin != null">#{referCoin},</if>
  60. <if test="referMarket != null">#{referMarket},</if>
  61. <if test="showSymbol != null">#{showSymbol},</if>
  62. <if test="price != null">#{price},</if>
  63. <if test="proportion != null">#{proportion},</if>
  64. <if test="createBy != null">#{createBy},</if>
  65. <if test="createTime != null">#{createTime},</if>
  66. <if test="updateBy != null">#{updateBy},</if>
  67. <if test="updateTime != null">#{updateTime},</if>
  68. <if test="remark != null">#{remark},</if>
  69. </trim>
  70. </insert>
  71. <update id="updateTSpontaneousCoin" parameterType="TSpontaneousCoin">
  72. update t_spontaneous_coin
  73. <trim prefix="SET" suffixOverrides=",">
  74. <if test="coin != null">coin = #{coin},</if>
  75. <if test="logo != null">logo = #{logo},</if>
  76. <if test="referCoin != null">refer_coin = #{referCoin},</if>
  77. <if test="referMarket != null">refer_market = #{referMarket},</if>
  78. <if test="showSymbol != null">show_symbol = #{showSymbol},</if>
  79. <if test="price != null">price = #{price},</if>
  80. <if test="proportion != null">proportion = #{proportion},</if>
  81. <if test="createBy != null">create_by = #{createBy},</if>
  82. <if test="createTime != null">create_time = #{createTime},</if>
  83. <if test="updateBy != null">update_by = #{updateBy},</if>
  84. <if test="updateTime != null">update_time = #{updateTime},</if>
  85. <if test="remark != null">remark = #{remark},</if>
  86. </trim>
  87. where id = #{id}
  88. </update>
  89. <delete id="deleteTSpontaneousCoinById" parameterType="Long">
  90. delete from t_spontaneous_coin where id = #{id}
  91. </delete>
  92. <delete id="deleteTSpontaneousCoinByIds" parameterType="String">
  93. delete from t_spontaneous_coin where id in
  94. <foreach item="id" collection="array" open="(" separator="," close=")">
  95. #{id}
  96. </foreach>
  97. </delete>
  98. </mapper>