|
|
@@ -0,0 +1,206 @@
|
|
|
+<?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.LectureUserMapper" >
|
|
|
+ <resultMap id="BaseResultMap" type="com.goafanti.common.model.LectureUser" >
|
|
|
+ <id column="lid" property="lid" jdbcType="BIGINT" />
|
|
|
+ <id column="uid" property="uid" jdbcType="VARCHAR" />
|
|
|
+ <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="last_update_time" property="lastUpdateTime" jdbcType="TIMESTAMP" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List" >
|
|
|
+ lid, uid, create_time, last_update_time
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="com.goafanti.common.model.LectureUserKey" >
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from lecture_user
|
|
|
+ where lid = #{lid,jdbcType=BIGINT}
|
|
|
+ and uid = #{uid,jdbcType=VARCHAR}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="com.goafanti.common.model.LectureUserKey" >
|
|
|
+ delete from lecture_user
|
|
|
+ where lid = #{lid,jdbcType=BIGINT}
|
|
|
+ and uid = #{uid,jdbcType=VARCHAR}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.goafanti.common.model.LectureUser" >
|
|
|
+ insert into lecture_user (lid, uid, create_time,
|
|
|
+ last_update_time)
|
|
|
+ values (#{lid,jdbcType=BIGINT}, #{uid,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ #{lastUpdateTime,jdbcType=TIMESTAMP})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.goafanti.common.model.LectureUser" >
|
|
|
+ insert into lecture_user
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="lid != null" >
|
|
|
+ lid,
|
|
|
+ </if>
|
|
|
+ <if test="uid != null" >
|
|
|
+ uid,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null" >
|
|
|
+ create_time,
|
|
|
+ </if>
|
|
|
+ <if test="lastUpdateTime != null" >
|
|
|
+ last_update_time,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="lid != null" >
|
|
|
+ #{lid,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="uid != null" >
|
|
|
+ #{uid,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null" >
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="lastUpdateTime != null" >
|
|
|
+ #{lastUpdateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.LectureUser" >
|
|
|
+ update lecture_user
|
|
|
+ <set >
|
|
|
+ <if test="createTime != null" >
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="lastUpdateTime != null" >
|
|
|
+ last_update_time = #{lastUpdateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where lid = #{lid,jdbcType=BIGINT}
|
|
|
+ and uid = #{uid,jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.LectureUser" >
|
|
|
+ update lecture_user
|
|
|
+ set create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ last_update_time = #{lastUpdateTime,jdbcType=TIMESTAMP}
|
|
|
+ where lid = #{lid,jdbcType=BIGINT}
|
|
|
+ and uid = #{uid,jdbcType=VARCHAR}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="batchDeleteByPrimaryKey" parameterType="java.util.List">
|
|
|
+ delete
|
|
|
+ from lecture_user
|
|
|
+ where id in
|
|
|
+ <foreach item="item" index="index" collection="list" open="("
|
|
|
+ separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <select id="findLectureUserListByPage" parameterType="String" resultType="com.goafanti.LectureUser.bo.LectureUserListBo">
|
|
|
+ select
|
|
|
+ lu.lid,
|
|
|
+ lu.uid,
|
|
|
+ lu.create_time as createTime,
|
|
|
+ lu.last_update_time as lastUpdateTime,
|
|
|
+ l.name as lectureName,
|
|
|
+ u.number,
|
|
|
+ u.mobile,
|
|
|
+ ui.username,
|
|
|
+ l.lecture_time as lectureTime,
|
|
|
+ l.end_time as endTime
|
|
|
+ from lecture_user lu
|
|
|
+ left join user u on u.id = lu.uid
|
|
|
+ left join user_identity ui on ui.uid = lu.uid
|
|
|
+ left join lecture l on l.id = lu.lid
|
|
|
+ where u.type = 0
|
|
|
+ <if test="mobile != null">
|
|
|
+ and u.mobile = #{mobile,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="number != null">
|
|
|
+ and u.number = #{number,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="lectureName != null">
|
|
|
+ and l.name like CONCAT('%',#{lectureName,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="username != null">
|
|
|
+ and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ order by lu.last_update_time desc
|
|
|
+ <if test="page_sql!=null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findLectureUserCount" parameterType="String" resultType="java.lang.Integer">
|
|
|
+ select
|
|
|
+ count(1)
|
|
|
+ from lecture_user lu
|
|
|
+ left join user u on u.id = lu.uid
|
|
|
+ left join user_identity ui on ui.uid = lu.uid
|
|
|
+ left join lecture l on l.id = lu.lid
|
|
|
+ where u.type = 0
|
|
|
+ <if test="mobile != null">
|
|
|
+ and u.mobile = #{mobile,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="number != null">
|
|
|
+ and u.number = #{number,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="lectureName != null">
|
|
|
+ and l.name like CONCAT('%',#{lectureName,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="username != null">
|
|
|
+ and ui.username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findLectureOrgListByPage" parameterType="String" resultType="com.goafanti.LectureUser.bo.LectureUserListBo">
|
|
|
+ select
|
|
|
+ lu.lid,
|
|
|
+ lu.uid,
|
|
|
+ lu.create_time as createTime,
|
|
|
+ lu.last_update_time as lastUpdateTime,
|
|
|
+ l.name as lectureName,
|
|
|
+ u.number,
|
|
|
+ u.mobile,
|
|
|
+ oi.unit_name as unitName,
|
|
|
+ l.lecture_time as lectureTime,
|
|
|
+ l.end_time as endTime
|
|
|
+ from lecture_user lu
|
|
|
+ left join user u on u.id = lu.uid
|
|
|
+ left join organization_identity oi on oi.uid = lu.uid
|
|
|
+ left join lecture l on l.id = lu.lid
|
|
|
+ where u.type = 1
|
|
|
+ <if test="mobile != null">
|
|
|
+ and u.mobile = #{mobile,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="number != null">
|
|
|
+ and u.number = #{number,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="lectureName != null">
|
|
|
+ and l.name like CONCAT('%',#{lectureName,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="unitName != null">
|
|
|
+ and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ order by lu.last_update_time desc
|
|
|
+ <if test="page_sql!=null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findLectureOrgCount" parameterType="String" resultType="java.lang.Integer">
|
|
|
+ select
|
|
|
+ count(1)
|
|
|
+ from lecture_user lu
|
|
|
+ left join user u on u.id = lu.uid
|
|
|
+ left join organization_identity oi on oi.uid = lu.uid
|
|
|
+ left join lecture l on l.id = lu.lid
|
|
|
+ where u.type = 1
|
|
|
+ <if test="mobile != null">
|
|
|
+ and u.mobile = #{mobile,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="number != null">
|
|
|
+ and u.number = #{number,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="activityName != null">
|
|
|
+ and l.name like CONCAT('%',#{lectureName,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ <if test="unitName != null">
|
|
|
+ and oi.unit_name like CONCAT('%',#{unitName,jdbcType=VARCHAR},'%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+</mapper>
|