123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- <?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.system.mapper.PersonResourcesMapper">
- <resultMap type="PersonResources" id="PersonResourcesResult">
- <result property="resourcesId" column="resources_id" />
- <result property="resourcesName" column="resources_name" />
- <result property="sourceId" column="source_id" />
- <result property="category" column="category" />
- <result property="chapterId" column="chapter_id" />
- <result property="edition" column="edition" />
- <result property="knowledgeBasicId" column="knowledge_basic_id" />
- <result property="resourcesUrl" column="resources_url" />
- <result property="type" column="type" />
- <result property="linkWay" column="link_way" />
- <result property="bookId" column="book_id" />
- <result property="schoolId" column="school_id" />
- <result property="subjectId" column="subject_id" />
- <result property="delFlag" column="del_flag" />
- <result property="province" column="province" />
- <result property="createId" column="create_id" />
- <result property="city" column="city" />
- <result property="createTime" column="create_time" />
- <result property="county" column="county" />
- <result property="remark" column="remark" />
- <result property="fileSize" column="file_size" />
- <result property="coursewareType" column="courseware_type" />
- <result property="videoId" column="video_id" />
- <result property="updateTime" column="update_time" />
-
- </resultMap>
- <sql id="selectPersonResourcesVo">
- select resources_id, resources_name, source_id, category, courseware_type, chapter_id, edition, knowledge_basic_id, resources_url, type, link_way, book_id, school_id, subject_id, del_flag, province, create_id, city, create_time, county, remark, file_size from test_person_resources
- </sql>
- <select id="selectPersonResourcesList" parameterType="PersonResources" resultMap="PersonResourcesResult">
- <include refid="selectPersonResourcesVo"/>
- where 1=1
- <if test="resourcesName != null and resourcesName != ''"> and resources_name like concat('%', #{resourcesName}, '%')</if>
- <if test="sourceId != null and sourceId != ''"> and source_id = #{sourceId}</if>
- <if test="category != null and category != ''"> and category = #{category}</if>
- <if test="chapterId != null "> and chapter_id = #{chapterId}</if>
- <if test="edition != null "> and edition = #{edition}</if>
- <if test="knowledgeBasicId != null "> and knowledge_basic_id = #{knowledgeBasicId}</if>
- <if test="resourcesUrl != null and resourcesUrl != ''"> and resources_url = #{resourcesUrl}</if>
- <if test="type != null "> and type = #{type}</if>
- <if test="linkWay != null and linkWay != ''"> and link_way = #{linkWay}</if>
- <if test="bookId != null "> and book_id = #{bookId}</if>
- <if test="schoolId != null "> and school_id = #{schoolId}</if>
- <if test="subjectId != null "> and subject_id = #{subjectId}</if>
- <if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag}</if>
- <if test="province != null "> and province = #{province}</if>
- <if test="createId != null "> and create_id = #{createId}</if>
- <if test="city != null "> and city = #{city}</if>
- <if test="county != null "> and county = #{county}</if>
- <if test="fileSize != null "> and file_size = #{fileSize}</if>
- <if test="coursewareType != null and coursewareType != '' "> and courseware_type = #{coursewareType}</if>
- <if test="sourceIds != null and sourceIds.size()>0 ">
- and source_id in <foreach item="id" collection="sourceIds" open="(" separator="," close=")">#{id}</foreach>
- </if>
- order by resources_id desc
- </select>
- <select id="selectPersonResourcesById" parameterType="Long" resultMap="PersonResourcesResult">
- <include refid="selectPersonResourcesVo"/>
- where resources_id = #{resourcesId}
- </select>
- <insert id="insertPersonResources" parameterType="PersonResources" useGeneratedKeys="true" keyProperty="resourcesId">
- insert into test_person_resources
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="resourcesName != null and resourcesName != ''">resources_name,</if>
- <if test="sourceId != null">source_id,</if>
- <if test="category != null and category != ''">category,</if>
- <if test="chapterId != null">chapter_id,</if>
- <if test="edition != null">edition,</if>
- <if test="knowledgeBasicId != null">knowledge_basic_id,</if>
- <if test="resourcesUrl != null">resources_url,</if>
- <if test="type != null">type,</if>
- <if test="linkWay != null">link_way,</if>
- <if test="bookId != null">book_id,</if>
- <if test="schoolId != null">school_id,</if>
- <if test="subjectId != null">subject_id,</if>
- <if test="delFlag != null">del_flag,</if>
- <if test="province != null">province,</if>
- <if test="createId != null">create_id,</if>
- <if test="city != null">city,</if>
- <if test="createTime != null">create_time,</if>
- <if test="county != null">county,</if>
- <if test="remark != null">remark,</if>
- <if test="fileSize != null">file_size,</if>
- <if test= "coursewareType != null and coursewareType != '' ">courseware_type,</if>
- <if test="videoId != null">video_id,</if>
- <if test="updateTime != null">update_time,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="resourcesName != null and resourcesName != ''">#{resourcesName},</if>
- <if test="sourceId != null">#{sourceId},</if>
- <if test="category != null and category != ''">#{category},</if>
- <if test="chapterId != null">#{chapterId},</if>
- <if test="edition != null">#{edition},</if>
- <if test="knowledgeBasicId != null">#{knowledgeBasicId},</if>
- <if test="resourcesUrl != null">#{resourcesUrl},</if>
- <if test="type != null">#{type},</if>
- <if test="linkWay != null">#{linkWay},</if>
- <if test="bookId != null">#{bookId},</if>
- <if test="schoolId != null">#{schoolId},</if>
- <if test="subjectId != null">#{subjectId},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="province != null">#{province},</if>
- <if test="createId != null">#{createId},</if>
- <if test="city != null">#{city},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="county != null">#{county},</if>
- <if test="remark != null">#{remark},</if>
- <if test="fileSize != null">#{fileSize},</if>
- <if test="coursewareType != null and coursewareType != '' ">#{coursewareType},</if>
- <if test="videoId != null">#{videoId},</if>
- <if test="updateTime != null">#{updateTime},</if>
-
- </trim>
- </insert>
- <update id="updatePersonResources" parameterType="PersonResources">
- update test_person_resources
- <trim prefix="SET" suffixOverrides=",">
- <if test="resourcesName != null and resourcesName != ''">resources_name = #{resourcesName},</if>
- <if test="sourceId != null">source_id = #{sourceId},</if>
- <if test="category != null and category != ''">category = #{category},</if>
- <if test="chapterId != null">chapter_id = #{chapterId},</if>
- <if test="edition != null">edition = #{edition},</if>
- <if test="knowledgeBasicId != null">knowledge_basic_id = #{knowledgeBasicId},</if>
- <if test="resourcesUrl != null">resources_url = #{resourcesUrl},</if>
- <if test="type != null">type = #{type},</if>
- <if test="linkWay != null">link_way = #{linkWay},</if>
- <if test="bookId != null">book_id = #{bookId},</if>
- <if test="schoolId != null">school_id = #{schoolId},</if>
- <if test="subjectId != null">subject_id = #{subjectId},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="province != null">province = #{province},</if>
- <if test="createId != null">create_id = #{createId},</if>
- <if test="city != null">city = #{city},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="county != null">county = #{county},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="fileSize != null">file_size = #{fileSize},</if>
- <if test="coursewareType != null and coursewareType != '' ">courseware_type = #{coursewareType},</if>
- <if test="videoId != null">video_id = #{videoId},</if>
- <if test="updateTime != null">update_time=#{updateTime},</if>
-
- </trim>
- where resources_id = #{resourcesId}
- </update>
- <delete id="deletePersonResourcesById" parameterType="Long">
- delete from test_person_resources where resources_id = #{resourcesId}
- </delete>
- <delete id="deletePersonResourcesByIds" parameterType="String">
- delete from test_person_resources where resources_id in
- <foreach item="resourcesId" collection="array" open="(" separator="," close=")">
- #{resourcesId}
- </foreach>
- </delete>
- </mapper>
|