123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <?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.InstitutionMapper">
-
- <resultMap type="Institution" id="InstitutionResult">
- <result property="id" column="id" />
- <result property="affiliation" column="affiliation"/>
- <result property="location" column="location"/>
- <result property="chineseName" column="chinese_name" />
- <result property="englishName" column="english_name" />
- <result property="link" column="link" />
- <result property="introduce" column="introduce" />
- <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="selectInstitutionVo">
- select id, affiliation, location, chinese_name, english_name, link, introduce, create_time, create_by, update_time, update_by from vr_institution
- </sql>
- <select id="selectInstitutionList" parameterType="Institution" resultMap="InstitutionResult">
- <include refid="selectInstitutionVo"/>
- <where>
- <if test="affiliation != null and affiliation != ''">and affiliation = #{affiliation}</if>
- <if test="location != null and location != ''">and location = #{location}</if>
- <if test="chineseName != null and chineseName != ''"> and chinese_name like concat('%', #{chineseName}, '%')</if>
- <if test="englishName != null and englishName != ''"> and english_name like concat('%', #{englishName}, '%')</if>
- <if test="link != null and link != ''"> and link = #{link}</if>
- <if test="introduce != null and introduce != ''"> and introduce = #{introduce}</if>
- </where>
- </select>
-
- <select id="selectInstitutionById" parameterType="Long" resultMap="InstitutionResult">
- <include refid="selectInstitutionVo"/>
- where id = #{id}
- </select>
- <select id="selectInstitutionByTitle" resultType="com.ruoyi.project.VRdemo.domain.Institution">
- <include refid="selectInstitutionVo"/>
- WHERE chinese_name = #{chineseName} and english_name = #{englishName}
- </select>
-
- <insert id="insertInstitution" parameterType="Institution" useGeneratedKeys="true" keyProperty="id">
- insert into vr_institution
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="affiliation != null">affiliation,</if>
- <if test="location != null">location,</if>
- <if test="chineseName != null">chinese_name,</if>
- <if test="englishName != null">english_name,</if>
- <if test="link != null">link,</if>
- <if test="introduce != null">introduce,</if>
- <if test="createTime != null">create_time,</if>
- <if test="createBy != null">create_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="updateBy != null">update_by,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="affiliation != null">#{affiliation},</if>
- <if test="location != null">#{location},</if>
- <if test="chineseName != null">#{chineseName},</if>
- <if test="englishName != null">#{englishName},</if>
- <if test="link != null">#{link},</if>
- <if test="introduce != null">#{introduce},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- </trim>
- </insert>
- <insert id="insertInstitutionDataList" parameterType="java.util.List">
- INSERT INTO vr_institution (affiliation, location, chinese_name, english_name, link, introduce, create_by,create_time)
- VALUES
- <foreach collection="list" item="item" separator=",">
- (#{item.affiliation}, #{item.location}, #{item.chineseName}, #{item.englishName}, #{item.link}, #{item.introduce}, #{item.createBy}, #{item.createTime})
- </foreach>
- </insert>
- <update id="updateInstitution" parameterType="Institution">
- update vr_institution
- <trim prefix="SET" suffixOverrides=",">
- <if test="affiliation != null">affiliation = #{affiliation},</if>
- <if test="location != null">location = #{location},</if>
- <if test="chineseName != null">chinese_name = #{chineseName},</if>
- <if test="englishName != null">english_name = #{englishName},</if>
- <if test="link != null">link = #{link},</if>
- <if test="introduce != null">introduce = #{introduce},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteInstitutionById" parameterType="Long">
- delete from vr_institution where id = #{id}
- </delete>
- <delete id="deleteInstitutionByIds" parameterType="String">
- delete from vr_institution where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|