123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?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.dtb.portal.mapper.VideoMapper">
- <select id="page" resultType="com.dtb.portal.entity.Video">
- select *
- from users where 1=1
- <if test="keyWord!=null and keyWord!=''">
- and title like CONCAT('%',#{keyWord,jdbcType=VARCHAR},'%')
- OR subtitle like CONCAT('%',#{keyWord,jdbcType=VARCHAR},'%')
- OR content like CONCAT('%',#{keyWord,jdbcType=VARCHAR},'%')
- </if>
- order by create_time desc
- </select>
- <select id="selectOne" resultType="com.dtb.portal.entity.Video">
- select *
- from t_video_user
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <update id="updateEnable">
- update t_video_user
- <set>
- <if test="title!=null and title!=''">
- title=#{title,jdbcType=VARCHAR},
- </if>
- <if test="subtitle!=null and subtitle!=''">
- subtitle=#{subtitle,jdbcType=VARCHAR},
- </if>
- <if test="num!=null and num!=''">
- num=#{num,jdbcType=VARCHAR},
- </if>
- <if test="video_path!=null and video_path!=''">
- video_path=#{video_path,jdbcType=VARCHAR},
- </if>
- <if test="video_img!=null and video_img!=''">
- video_img=#{video_img,jdbcType=VARCHAR},
- </if>
- <if test="content!=null and content!=''">
- content=#{content,jdbcType=VARCHAR},
- </if>
- <if test="updateTime!=null">
- update_time =#{updateTime,jdbcType=TIMESTAMP},
- </if>
- </set>
- where id=#{id,jdbcType=VARCHAR}
- </update>
- <insert id="save" useGeneratedKeys="true" keyProperty="id">
- insert into t_video_user (title, subtitle, num, video_path, video_img, password, content, create_time, update_time)
- values (
- #{title,jdbcType=VARCHAR},
- #{subtitle,jdbcType=VARCHAR},
- #{num,jdbcType=VARCHAR},
- #{video_path,jdbcType=VARCHAR},
- #{nickname,jdbcType=VARCHAR},
- #{video_img,jdbcType=VARCHAR},
- #{content,jdbcType=VARCHAR},
- #{createTime,jdbcType=TIMESTAMP},
- #{updateTime,jdbcType=TIMESTAMP})
- </insert>
- <delete id="delete">
- delete
- from t_video_user
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- </mapper>
|