12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?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.mapper.TopicLibraryMapper">
-
- <resultMap type="TopicLibrary" id="TopicLibraryResult">
- <result property="topicId" column="topic_id" />
- <result property="topicName" column="topic_name" />
- <result property="topicPassword" column="topic_password" />
- <result property="topicText" column="topic_text" />
- <result property="filePath" column="file_path" />
- <result property="fileName" column="file_name" />
- <result property="uplpadUser" column="uplpad_user" />
- <result property="uploadTime" column="upload_time" />
- <result property="upDept" column="up_dept" />
- <result property="report" column="report" />
- <result property="delFlag" column="del_flag" />
- <result property="topicState" column="topic_state" />
- </resultMap>
- <sql id="selectTopicLibraryVo">
- select topic_id, topic_name, topic_password, topic_text, file_path, file_name, uplpad_user, upload_time, up_dept, report, del_flag, topic_state from topic_library
- </sql>
- <select id="selectTopicLibraryList" parameterType="TopicLibrary" resultMap="TopicLibraryResult">
- <include refid="selectTopicLibraryVo"/>
- <where>
- <if test="topicName != null and topicName != ''"> and topic_name like concat('%', #{topicName}, '%')</if>
- <if test="topicState != null "> and topic_state = #{topicState}</if>
- </where>
- </select>
-
- <select id="selectTopicLibraryByTopicId" parameterType="Long" resultMap="TopicLibraryResult">
- <include refid="selectTopicLibraryVo"/>
- where topic_id = #{topicId}
- </select>
- <insert id="insertTopicLibrary" parameterType="TopicLibrary" useGeneratedKeys="true" keyProperty="topicId">
- insert into topic_library
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="topicName != null and topicName != ''">topic_name,</if>
- <if test="topicPassword != null">topic_password,</if>
- <if test="topicText != null">topic_text,</if>
- <if test="filePath != null">file_path,</if>
- <if test="fileName != null">file_name,</if>
- <if test="uplpadUser != null">uplpad_user,</if>
- <if test="uploadTime != null">upload_time,</if>
- <if test="upDept != null">up_dept,</if>
- <if test="report != null">report,</if>
- <if test="delFlag != null">del_flag,</if>
- <if test="topicState != null">topic_state,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="topicName != null and topicName != ''">#{topicName},</if>
- <if test="topicPassword != null">#{topicPassword},</if>
- <if test="topicText != null">#{topicText},</if>
- <if test="filePath != null">#{filePath},</if>
- <if test="fileName != null">#{fileName},</if>
- <if test="uplpadUser != null">#{uplpadUser},</if>
- <if test="uploadTime != null">#{uploadTime},</if>
- <if test="upDept != null">#{upDept},</if>
- <if test="report != null">#{report},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="topicState != null">#{topicState},</if>
- </trim>
- </insert>
- <update id="updateTopicLibrary" parameterType="TopicLibrary">
- update topic_library
- <trim prefix="SET" suffixOverrides=",">
- <if test="topicName != null and topicName != ''">topic_name = #{topicName},</if>
- <if test="topicPassword != null">topic_password = #{topicPassword},</if>
- <if test="topicText != null">topic_text = #{topicText},</if>
- <if test="filePath != null">file_path = #{filePath},</if>
- <if test="fileName != null">file_name = #{fileName},</if>
- <if test="uplpadUser != null">uplpad_user = #{uplpadUser},</if>
- <if test="uploadTime != null">upload_time = #{uploadTime},</if>
- <if test="upDept != null">up_dept = #{upDept},</if>
- <if test="report != null">report = #{report},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="topicState != null">topic_state = #{topicState},</if>
- </trim>
- where topic_id = #{topicId}
- </update>
- <delete id="deleteTopicLibraryByTopicId" parameterType="Long">
- delete from topic_library where topic_id = #{topicId}
- </delete>
- <delete id="deleteTopicLibraryByTopicIds" parameterType="String">
- delete from topic_library where topic_id in
- <foreach item="topicId" collection="array" open="(" separator="," close=")">
- #{topicId}
- </foreach>
- </delete>
- </mapper>
|