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