ArchivesUnboundMapper.xml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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.project.VRdemo.mapper.ArchivesUnboundMapper">
  6. <resultMap type="ArchivesUnbound" id="ArchivesUnboundResult">
  7. <result property="id" column="id" />
  8. <result property="englishName" column="english_name" />
  9. <result property="chineseName" column="chinese_name" />
  10. <result property="introduce" column="introduce" />
  11. <result property="link" column="link" />
  12. <result property="createTime" column="create_time" />
  13. <result property="createBy" column="create_by" />
  14. <result property="updateTime" column="update_time" />
  15. <result property="updateBy" column="update_by" />
  16. </resultMap>
  17. <sql id="selectArchivesUnboundVo">
  18. select id, english_name, chinese_name, introduce, link, create_time, create_by, update_time, update_by from vr_archives_unbound
  19. </sql>
  20. <select id="selectArchivesUnboundList" parameterType="ArchivesUnbound" resultMap="ArchivesUnboundResult">
  21. <include refid="selectArchivesUnboundVo"/>
  22. <where>
  23. <if test="englishName != null and englishName != ''"> and english_name like concat('%', #{englishName}, '%')</if>
  24. <if test="chineseName != null and chineseName != ''"> and chinese_name like concat('%', #{chineseName}, '%')</if>
  25. <if test="introduce != null and introduce != ''"> and introduce = #{introduce}</if>
  26. <if test="link != null and link != ''"> and link = #{link}</if>
  27. </where>
  28. </select>
  29. <select id="selectArchivesUnboundById" parameterType="Long" resultMap="ArchivesUnboundResult">
  30. <include refid="selectArchivesUnboundVo"/>
  31. where id = #{id}
  32. </select>
  33. <select id="selectArchivesUnboundByTitle" parameterType="Long" resultMap="ArchivesUnboundResult">
  34. <include refid="selectArchivesUnboundVo"/>
  35. where title = #{title}
  36. </select>
  37. <insert id="insertArchivesUnbound" parameterType="ArchivesUnbound" useGeneratedKeys="true" keyProperty="id">
  38. insert into vr_archives_unbound
  39. <trim prefix="(" suffix=")" suffixOverrides=",">
  40. <if test="englishName != null">english_name,</if>
  41. <if test="chineseName != null">chinese_name,</if>
  42. <if test="introduce != null">introduce,</if>
  43. <if test="link != null">link,</if>
  44. <if test="createTime != null">create_time,</if>
  45. <if test="createBy != null">create_by,</if>
  46. <if test="updateTime != null">update_time,</if>
  47. <if test="updateBy != null">update_by,</if>
  48. </trim>
  49. <trim prefix="values (" suffix=")" suffixOverrides=",">
  50. <if test="englishName != null">#{englishName},</if>
  51. <if test="chineseName != null">#{chineseName},</if>
  52. <if test="introduce != null">#{introduce},</if>
  53. <if test="link != null">#{link},</if>
  54. <if test="createTime != null">#{createTime},</if>
  55. <if test="createBy != null">#{createBy},</if>
  56. <if test="updateTime != null">#{updateTime},</if>
  57. <if test="updateBy != null">#{updateBy},</if>
  58. </trim>
  59. </insert>
  60. <insert id="insertArchivesUnboundDataList" parameterType="java.util.List">
  61. insert into vr_archives_unbound(english_name, chinese_name, introduce, link, create_time, create_by)
  62. values
  63. <foreach collection="list" item="item" separator=",">
  64. (#{item.englishName}, #{item.chineseName}, #{item.introduce}, #{item.link}, #{item.createTime}, #{item.createBy})
  65. </foreach>
  66. </insert>
  67. <update id="updateArchivesUnbound" parameterType="ArchivesUnbound">
  68. update vr_archives_unbound
  69. <trim prefix="SET" suffixOverrides=",">
  70. <if test="englishName != null">english_name = #{englishName},</if>
  71. <if test="chineseName != null">chinese_name = #{chineseName},</if>
  72. <if test="introduce != null">introduce = #{introduce},</if>
  73. <if test="link != null">link = #{link},</if>
  74. <if test="createTime != null">create_time = #{createTime},</if>
  75. <if test="createBy != null">create_by = #{createBy},</if>
  76. <if test="updateTime != null">update_time = #{updateTime},</if>
  77. <if test="updateBy != null">update_by = #{updateBy},</if>
  78. </trim>
  79. where id = #{id}
  80. </update>
  81. <delete id="deleteArchivesUnboundById" parameterType="Long">
  82. delete from vr_archives_unbound where id = #{id}
  83. </delete>
  84. <delete id="deleteArchivesUnboundByIds" parameterType="String">
  85. delete from vr_archives_unbound where id in
  86. <foreach item="id" collection="array" open="(" separator="," close=")">
  87. #{id}
  88. </foreach>
  89. </delete>
  90. </mapper>