AppDownloadMapper.xml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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.AppDownloadMapper">
  6. <resultMap type="AppDownload" id="AppDownloadResult">
  7. <result property="id" column="id" />
  8. <result property="androidUrl" column="android_url" />
  9. <result property="iosUrl" column="ios_url" />
  10. </resultMap>
  11. <sql id="selectAppDownloadVo">
  12. select id, android_url, ios_url from app_download
  13. </sql>
  14. <select id="selectAppDownloadList" parameterType="AppDownload" resultMap="AppDownloadResult">
  15. <include refid="selectAppDownloadVo"/>
  16. <where>
  17. <if test="androidUrl != null and androidUrl != ''"> and android_url = #{androidUrl}</if>
  18. <if test="iosUrl != null and iosUrl != ''"> and ios_url = #{iosUrl}</if>
  19. </where>
  20. </select>
  21. <select id="selectAppDownloadById" parameterType="Long" resultMap="AppDownloadResult">
  22. <include refid="selectAppDownloadVo"/>
  23. where id = #{id}
  24. </select>
  25. <insert id="insertAppDownload" parameterType="AppDownload" useGeneratedKeys="true" keyProperty="id">
  26. insert into app_download
  27. <trim prefix="(" suffix=")" suffixOverrides=",">
  28. <if test="androidUrl != null">android_url,</if>
  29. <if test="iosUrl != null">ios_url,</if>
  30. </trim>
  31. <trim prefix="values (" suffix=")" suffixOverrides=",">
  32. <if test="androidUrl != null">#{androidUrl},</if>
  33. <if test="iosUrl != null">#{iosUrl},</if>
  34. </trim>
  35. </insert>
  36. <update id="updateAppDownload" parameterType="AppDownload">
  37. update app_download
  38. <trim prefix="SET" suffixOverrides=",">
  39. <if test="androidUrl != null">android_url = #{androidUrl},</if>
  40. <if test="iosUrl != null">ios_url = #{iosUrl},</if>
  41. </trim>
  42. where id = #{id}
  43. </update>
  44. <delete id="deleteAppDownloadById" parameterType="Long">
  45. delete from app_download where id = #{id}
  46. </delete>
  47. <delete id="deleteAppDownloadByIds" parameterType="String">
  48. delete from app_download where id in
  49. <foreach item="id" collection="array" open="(" separator="," close=")">
  50. #{id}
  51. </foreach>
  52. </delete>
  53. </mapper>