TSymbolsMapper.xml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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.TSymbolsMapper">
  6. <resultMap type="TSymbols" id="TSymbolsResult">
  7. <result property="slug" column="slug" />
  8. <result property="symbol" column="symbol" />
  9. <result property="fullname" column="fullname" />
  10. <result property="logoUrl" column="logo_Url" />
  11. <result property="fiat" column="fiat" />
  12. </resultMap>
  13. <sql id="selectTSymbolsVo">
  14. select slug, symbol, fullname, logo_Url, fiat from t_symbols
  15. </sql>
  16. <select id="selectTSymbolsList" parameterType="TSymbols" resultMap="TSymbolsResult">
  17. <include refid="selectTSymbolsVo"/>
  18. <where>
  19. <if test="symbol != null and symbol != ''"> and symbol = #{symbol}</if>
  20. <if test="fullname != null and fullname != ''"> and fullname like concat('%', #{fullname}, '%')</if>
  21. <if test="logoUrl != null and logoUrl != ''"> and logo_Url = #{logoUrl}</if>
  22. <if test="fiat != null "> and fiat = #{fiat}</if>
  23. </where>
  24. </select>
  25. <select id="selectTSymbolsBySlug" parameterType="String" resultMap="TSymbolsResult">
  26. <include refid="selectTSymbolsVo"/>
  27. where slug = #{slug}
  28. </select>
  29. <insert id="insertTSymbols" parameterType="TSymbols">
  30. insert into t_symbols
  31. <trim prefix="(" suffix=")" suffixOverrides=",">
  32. <if test="slug != null">slug,</if>
  33. <if test="symbol != null">symbol,</if>
  34. <if test="fullname != null">fullname,</if>
  35. <if test="logoUrl != null">logo_Url,</if>
  36. <if test="fiat != null">fiat,</if>
  37. </trim>
  38. <trim prefix="values (" suffix=")" suffixOverrides=",">
  39. <if test="slug != null">#{slug},</if>
  40. <if test="symbol != null">#{symbol},</if>
  41. <if test="fullname != null">#{fullname},</if>
  42. <if test="logoUrl != null">#{logoUrl},</if>
  43. <if test="fiat != null">#{fiat},</if>
  44. </trim>
  45. </insert>
  46. <update id="updateTSymbols" parameterType="TSymbols">
  47. update t_symbols
  48. <trim prefix="SET" suffixOverrides=",">
  49. <if test="symbol != null">symbol = #{symbol},</if>
  50. <if test="fullname != null">fullname = #{fullname},</if>
  51. <if test="logoUrl != null">logo_Url = #{logoUrl},</if>
  52. <if test="fiat != null">fiat = #{fiat},</if>
  53. </trim>
  54. where slug = #{slug}
  55. </update>
  56. <delete id="deleteTSymbolsBySlug" parameterType="String">
  57. delete from t_symbols where slug = #{slug}
  58. </delete>
  59. <delete id="deleteTSymbolsBySlugs" parameterType="String">
  60. delete from t_symbols where slug in
  61. <foreach item="slug" collection="array" open="(" separator="," close=")">
  62. #{slug}
  63. </foreach>
  64. </delete>
  65. </mapper>