123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.ruoyi.project.VRdemo.mapper.ArchivesUnboundMapper">
-
- <resultMap type="ArchivesUnbound" id="ArchivesUnboundResult">
- <result property="id" column="id" />
- <result property="englishName" column="english_name" />
- <result property="chineseName" column="chinese_name" />
- <result property="introduce" column="introduce" />
- <result property="link" column="link" />
- <result property="sort" column="sort" />
- <result property="createTime" column="create_time" />
- <result property="createBy" column="create_by" />
- <result property="updateTime" column="update_time" />
- <result property="updateBy" column="update_by" />
- </resultMap>
- <sql id="selectArchivesUnboundVo">
- select id, english_name, chinese_name, introduce, link, sort, create_time, create_by, update_time, update_by from vr_archives_unbound
- </sql>
- <select id="selectArchivesUnboundList" parameterType="ArchivesUnbound" resultMap="ArchivesUnboundResult">
- <include refid="selectArchivesUnboundVo"/>
- <where>
- <if test="englishName != null and englishName != ''"> and english_name like concat('%', #{englishName}, '%')</if>
- <if test="chineseName != null and chineseName != ''"> and chinese_name like concat('%', #{chineseName}, '%')</if>
- <if test="introduce != null and introduce != ''"> and introduce like concat('%', #{introduce}, '%')</if>
- <if test="link != null and link != ''"> and link like concat('%', #{link}, '%')</if>
- <if test="sort != null and sort != ''"> and sort = #{sort}</if>
- </where>
- ORDER BY sort
- </select>
-
- <select id="selectArchivesUnboundById" parameterType="Long" resultMap="ArchivesUnboundResult">
- <include refid="selectArchivesUnboundVo"/>
- where id = #{id}
- </select>
- <select id="selectArchivesUnboundByTitle" parameterType="Long" resultMap="ArchivesUnboundResult">
- <include refid="selectArchivesUnboundVo"/>
- where title = #{title}
- </select>
-
- <insert id="insertArchivesUnbound" parameterType="ArchivesUnbound" useGeneratedKeys="true" keyProperty="id">
- insert into vr_archives_unbound
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="englishName != null and englishName != ''">english_name,</if>
- <if test="chineseName != null and chineseName != ''">chinese_name,</if>
- <if test="introduce != null and introduce != ''">introduce,</if>
- <if test="link != null and link != ''">link,</if>
- <if test="sort != null and sort != ''">sort,</if>
- <if test="createBy != null and createBy != ''">create_by,</if>
- <if test="createTime != null ">create_time,</if>
- <if test="updateBy != null and updateBy != ''">update_by,</if>
- <if test="updateTime != null ">update_time,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="englishName != null and englishName != ''">#{englishName},</if>
- <if test="chineseName != null and chineseName != ''">#{chineseName},</if>
- <if test="introduce != null and introduce != ''">#{introduce},</if>
- <if test="link != null and link != ''">#{link},</if>
- <if test="sort != null and sort != ''">#{sort},</if>
- <if test="createBy != null and createBy != ''">#{createBy},</if>
- <if test="createTime != null ">#{createTime},</if>
- <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
- <if test="updateTime != null ">#{updateTime},</if>
- </trim>
- </insert>
- <insert id="insertArchivesUnboundDataList" parameterType="java.util.List">
- insert into vr_archives_unbound(english_name, chinese_name, introduce, link, sort, create_time, create_by)
- values
- <foreach collection="list" item="item" separator=",">
- (#{item.englishName}, #{item.chineseName}, #{item.introduce}, #{item.link}, #{item.sort}, #{item.createTime}, #{item.createBy})
- </foreach>
- </insert>
- <update id="updateArchivesUnbound" parameterType="ArchivesUnbound">
- update vr_archives_unbound
- <trim prefix="SET" suffixOverrides=",">
- <if test="englishName != null and englishName != ''">english_name = #{englishName},</if>
- <if test="chineseName != null and chineseName != ''">chinese_name = #{chineseName},</if>
- <if test="introduce != null and introduce != ''">introduce = #{introduce},</if>
- <if test="link != null and link != ''">link = #{link},</if>
- <if test="sort != null and sort != ''">sort = #{sort},</if>
- <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
- <if test="createTime != null ">create_time = #{createTime},</if>
- <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- <if test="updateTime != null ">update_time = #{updateTime},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteArchivesUnboundById" parameterType="Long">
- delete from vr_archives_unbound where id = #{id}
- </delete>
- <delete id="deleteArchivesUnboundByIds" parameterType="String">
- delete from vr_archives_unbound where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|