|
@@ -0,0 +1,194 @@
|
|
|
|
|
+<?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.goafanti.common.dao.LectureMapper" >
|
|
|
|
|
+ <resultMap id="BaseResultMap" type="com.goafanti.common.model.Lecture" >
|
|
|
|
|
+ <id column="id" property="id" jdbcType="VARCHAR" />
|
|
|
|
|
+ <result column="uid" property="uid" jdbcType="VARCHAR" />
|
|
|
|
|
+ <result column="lecture_time" property="lectureTime" jdbcType="TIMESTAMP" />
|
|
|
|
|
+ <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
|
|
|
|
+ <result column="last_update_time" property="lastUpdateTime" jdbcType="TIMESTAMP" />
|
|
|
|
|
+ <result column="name" property="name" jdbcType="VARCHAR" />
|
|
|
|
|
+ <result column="summary" property="summary" jdbcType="VARCHAR" />
|
|
|
|
|
+ <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+ <sql id="Base_Column_List" >
|
|
|
|
|
+ id, uid, lecture_time, create_time, last_update_time, name, summary, deleted_sign
|
|
|
|
|
+ </sql>
|
|
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
|
|
|
|
+ select
|
|
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
|
|
+ from lecture
|
|
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
|
|
|
|
|
+ delete from lecture
|
|
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
|
|
+ </delete>
|
|
|
|
|
+ <insert id="insert" parameterType="com.goafanti.common.model.Lecture" >
|
|
|
|
|
+ insert into lecture (id, uid, lecture_time,
|
|
|
|
|
+ create_time, last_update_time, name,
|
|
|
|
|
+ summary, deleted_sign)
|
|
|
|
|
+ values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{lectureTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ #{createTime,jdbcType=TIMESTAMP}, #{lastUpdateTime,jdbcType=TIMESTAMP}, #{name,jdbcType=VARCHAR},
|
|
|
|
|
+ #{summary,jdbcType=VARCHAR}, #{deletedSign,jdbcType=INTEGER})
|
|
|
|
|
+ </insert>
|
|
|
|
|
+ <insert id="insertSelective" parameterType="com.goafanti.common.model.Lecture" >
|
|
|
|
|
+ insert into lecture
|
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
|
|
+ <if test="id != null" >
|
|
|
|
|
+ id,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="uid != null" >
|
|
|
|
|
+ uid,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="lectureTime != null" >
|
|
|
|
|
+ lecture_time,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="createTime != null" >
|
|
|
|
|
+ create_time,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="lastUpdateTime != null" >
|
|
|
|
|
+ last_update_time,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="name != null" >
|
|
|
|
|
+ name,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="summary != null" >
|
|
|
|
|
+ summary,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="deletedSign != null" >
|
|
|
|
|
+ deleted_sign,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
|
|
+ <if test="id != null" >
|
|
|
|
|
+ #{id,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="uid != null" >
|
|
|
|
|
+ #{uid,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="lectureTime != null" >
|
|
|
|
|
+ #{lectureTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="createTime != null" >
|
|
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="lastUpdateTime != null" >
|
|
|
|
|
+ #{lastUpdateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="name != null" >
|
|
|
|
|
+ #{name,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="summary != null" >
|
|
|
|
|
+ #{summary,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="deletedSign != null" >
|
|
|
|
|
+ #{deletedSign,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ </insert>
|
|
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Lecture" >
|
|
|
|
|
+ update lecture
|
|
|
|
|
+ <set >
|
|
|
|
|
+ <if test="uid != null" >
|
|
|
|
|
+ uid = #{uid,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="lectureTime != null" >
|
|
|
|
|
+ lecture_time = #{lectureTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="createTime != null" >
|
|
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="lastUpdateTime != null" >
|
|
|
|
|
+ last_update_time = #{lastUpdateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="name != null" >
|
|
|
|
|
+ name = #{name,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="summary != null" >
|
|
|
|
|
+ summary = #{summary,jdbcType=VARCHAR},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="deletedSign != null" >
|
|
|
|
|
+ deleted_sign = #{deletedSign,jdbcType=INTEGER},
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </set>
|
|
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
|
|
+ </update>
|
|
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.Lecture" >
|
|
|
|
|
+ update lecture
|
|
|
|
|
+ set uid = #{uid,jdbcType=VARCHAR},
|
|
|
|
|
+ lecture_time = #{lectureTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ last_update_time = #{lastUpdateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ name = #{name,jdbcType=VARCHAR},
|
|
|
|
|
+ summary = #{summary,jdbcType=VARCHAR},
|
|
|
|
|
+ deleted_sign = #{deletedSign,jdbcType=INTEGER}
|
|
|
|
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
|
|
+ <update id="batchDeleteByPrimaryKey" parameterType="java.util.List">
|
|
|
|
|
+ update lecture set deleted_sign = 1
|
|
|
|
|
+ where id in
|
|
|
|
|
+ <foreach item="item" index="index" collection="list" open="("
|
|
|
|
|
+ separator="," close=")">
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="findLectureListByPage" parameterType="String" resultType="com.goafanti.lecture.bo.LectureListBo">
|
|
|
|
|
+ select
|
|
|
|
|
+ l.id,
|
|
|
|
|
+ l.uid,
|
|
|
|
|
+ l.name,
|
|
|
|
|
+ l.lecture_time as lectureTime,
|
|
|
|
|
+ l.summary,
|
|
|
|
|
+ ui.username
|
|
|
|
|
+ from lecture l
|
|
|
|
|
+ left join user_identity ui on ui.uid = l.uid
|
|
|
|
|
+ where
|
|
|
|
|
+ l.deleted_sign = 0
|
|
|
|
|
+ <if test="uid != null">
|
|
|
|
|
+ and l.uid = #{uid,jdbcType=VARCHAR}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="name != null">
|
|
|
|
|
+ and l.name like CONCAT('%', #{name,jdbcType=VARCHAR}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="username != null">
|
|
|
|
|
+ and ui.username like CONCAT('%', #{username,jdbcType=VARCHAR}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="startL != null">
|
|
|
|
|
+ and l.lecture_time <![CDATA[ >= ]]> #{startL,jdbcType=TIMESTAPM}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="endL != null">
|
|
|
|
|
+ and l.lecture_time <![CDATA[ < ]]> #{endL,jdbcType=TIMESTAPM}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ order by l.lecture_time desc
|
|
|
|
|
+ <if test="page_sql!=null">
|
|
|
|
|
+ ${page_sql}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="findLectureCount" parameterType="String" resultType="java.lang.Integer">
|
|
|
|
|
+ select
|
|
|
|
|
+ count(1)
|
|
|
|
|
+ from lecture l
|
|
|
|
|
+ left join user_identity ui on ui.uid = l.uid
|
|
|
|
|
+ where
|
|
|
|
|
+ l.deleted_sign = 0
|
|
|
|
|
+ <if test="uid != null">
|
|
|
|
|
+ and l.uid = #{uid,jdbcType=VARCHAR}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="name != null">
|
|
|
|
|
+ and l.name like CONCAT('%', #{name,jdbcType=VARCHAR}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="username != null">
|
|
|
|
|
+ and ui.username like CONCAT('%', #{username,jdbcType=VARCHAR}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="startL != null">
|
|
|
|
|
+ and l.lecture_time <![CDATA[ >= ]]> #{startL,jdbcType=TIMESTAMP}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="endL != null">
|
|
|
|
|
+ and l.lecture_time <![CDATA[ < ]]> #{endL,jdbcType=TIMESTAMP}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </select>
|
|
|
|
|
+</mapper>
|