AppVersionMapper.xml 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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.system.mapper.AppVersionMapper">
  6. <resultMap type="AppVersion" id="AppVersionResult">
  7. <result property="id" column="id" />
  8. <result property="name" column="name" />
  9. <result property="versionName" column="version_name" />
  10. <result property="version" column="version" />
  11. <result property="platform" column="platform" />
  12. <result property="downloadUrl" column="download_url" />
  13. <result property="introduce" column="introduce" />
  14. <result property="renew" column="renew" />
  15. </resultMap>
  16. <sql id="selectAppVersionVo">
  17. select id, name, version_name, version, platform, download_url, introduce, renew from app_version
  18. </sql>
  19. <select id="selectAppVersionList" parameterType="AppVersion" resultMap="AppVersionResult">
  20. <include refid="selectAppVersionVo"/>
  21. <where>
  22. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  23. <if test="versionName != null and versionName != ''"> and version_name like concat('%', #{versionName}, '%')</if>
  24. <if test="version != null and version != ''"> and version = #{version}</if>
  25. <if test="platform != null "> and platform = #{platform}</if>
  26. <if test="downloadUrl != null and downloadUrl != ''"> and download_url = #{downloadUrl}</if>
  27. <if test="introduce != null and introduce != ''"> and introduce = #{introduce}</if>
  28. <if test="renew != null "> and renew = #{renew}</if>
  29. </where>
  30. order by id desc
  31. </select>
  32. <select id="selectAppVersionById" parameterType="Long" resultMap="AppVersionResult">
  33. <include refid="selectAppVersionVo"/>
  34. where id = #{id}
  35. </select>
  36. <insert id="insertAppVersion" parameterType="AppVersion">
  37. insert into app_version
  38. <trim prefix="(" suffix=")" suffixOverrides=",">
  39. <if test="id != null">id,</if>
  40. <if test="name != null and name != ''">name,</if>
  41. <if test="versionName != null and versionName != ''">version_name,</if>
  42. <if test="version != null and version != ''">version,</if>
  43. <if test="platform != null">platform,</if>
  44. <if test="downloadUrl != null and downloadUrl != ''">download_url,</if>
  45. <if test="introduce != null">introduce,</if>
  46. <if test="renew != null">renew,</if>
  47. </trim>
  48. <trim prefix="values (" suffix=")" suffixOverrides=",">
  49. <if test="id != null">#{id},</if>
  50. <if test="name != null and name != ''">#{name},</if>
  51. <if test="versionName != null and versionName != ''">#{versionName},</if>
  52. <if test="version != null and version != ''">#{version},</if>
  53. <if test="platform != null">#{platform},</if>
  54. <if test="downloadUrl != null and downloadUrl != ''">#{downloadUrl},</if>
  55. <if test="introduce != null">#{introduce},</if>
  56. <if test="renew != null">#{renew},</if>
  57. </trim>
  58. </insert>
  59. <update id="updateAppVersion" parameterType="AppVersion">
  60. update app_version
  61. <trim prefix="SET" suffixOverrides=",">
  62. <if test="name != null and name != ''">name = #{name},</if>
  63. <if test="versionName != null and versionName != ''">version_name = #{versionName},</if>
  64. <if test="version != null and version != ''">version = #{version},</if>
  65. <if test="platform != null">platform = #{platform},</if>
  66. <if test="downloadUrl != null and downloadUrl != ''">download_url = #{downloadUrl},</if>
  67. <if test="introduce != null">introduce = #{introduce},</if>
  68. <if test="renew != null">renew = #{renew},</if>
  69. </trim>
  70. where id = #{id}
  71. </update>
  72. <delete id="deleteAppVersionById" parameterType="Long">
  73. delete from app_version where id = #{id}
  74. </delete>
  75. <delete id="deleteAppVersionByIds" parameterType="String">
  76. delete from app_version where id in
  77. <foreach item="id" collection="array" open="(" separator="," close=")">
  78. #{id}
  79. </foreach>
  80. </delete>
  81. </mapper>