黄磊的项目,分享文件
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

86 lines
3.8 KiB

<?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.BVideosMapper">
<resultMap type="BVideos" id="BVideosResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="path" column="path" />
<result property="type" column="type" />
<result property="gmtModified" column="gmt_modified" />
<result property="gmtCreate" column="gmt_create" />
<result property="parentId" column="parent_id" />
<result property="fileId" column="file_id" />
</resultMap>
<sql id="selectBVideosVo">
select id, name, path, type, gmt_modified, gmt_create, parent_id, file_id from b_videos
</sql>
<select id="selectBVideosList" parameterType="BVideos" resultMap="BVideosResult">
<include refid="selectBVideosVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="path != null and path != ''"> and path = #{path}</if>
<if test="type != null "> and type = #{type}</if>
<if test="gmtModified != null "> and gmt_modified = #{gmtModified}</if>
<if test="gmtCreate != null "> and gmt_create = #{gmtCreate}</if>
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="fileId != null "> and file_id = #{fileId}</if>
</where>
</select>
<select id="selectBVideosById" parameterType="Long" resultMap="BVideosResult">
<include refid="selectBVideosVo"/>
where id = #{id}
</select>
<insert id="insertBVideos" parameterType="BVideos" useGeneratedKeys="true" keyProperty="id">
insert into b_videos
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
<if test="path != null">path,</if>
<if test="type != null">type,</if>
<if test="gmtModified != null">gmt_modified,</if>
<if test="gmtCreate != null">gmt_create,</if>
<if test="parentId != null">parent_id,</if>
<if test="fileId != null">file_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
<if test="path != null">#{path},</if>
<if test="type != null">#{type},</if>
<if test="gmtModified != null">#{gmtModified},</if>
<if test="gmtCreate != null">#{gmtCreate},</if>
<if test="parentId != null">#{parentId},</if>
<if test="fileId != null">#{fileId},</if>
</trim>
</insert>
<update id="updateBVideos" parameterType="BVideos">
update b_videos
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="path != null">path = #{path},</if>
<if test="type != null">type = #{type},</if>
<if test="gmtModified != null">gmt_modified = #{gmtModified},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="fileId != null">file_id = #{fileId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBVideosById" parameterType="Long">
delete from b_videos where id = #{id}
</delete>
<delete id="deleteBVideosByIds" parameterType="String">
delete from b_videos where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>