<?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.ycl.jxkg.mapper.MeetMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.ycl.jxkg.domain.entity.Meet">
|
<result column="meet_name" property="meetName" />
|
<result column="meet_cover" property="meetCover" />
|
<result column="classes_id" property="classesId" />
|
<result column="create_user" property="createUser" />
|
<result column="start_time" property="startTime" />
|
<result column="end_time" property="endTime" />
|
<result column="status" property="status" />
|
</resultMap>
|
|
|
<select id="getById" resultMap="BaseResultMap">
|
SELECT
|
TM.meet_name,
|
TM.meet_cover,
|
TM.classes_id,
|
TM.create_user,
|
TM.start_time,
|
TM.end_time,
|
TM.status,
|
TM.id
|
FROM
|
t_meet TM
|
WHERE
|
TM.id = #{id} AND TM.deleted = 0
|
</select>
|
|
|
<select id="getPage" resultType="com.ycl.jxkg.domain.vo.MeetVO">
|
SELECT
|
TM.meet_name,
|
TM.meet_cover,
|
TM.classes_id,
|
TM.create_user,
|
TU.user_name as teacherName,
|
TM.start_time,
|
TM.end_time,
|
TM.status,
|
TM.id
|
FROM
|
t_meet TM left join t_user TU on TM.create_user = TU.id
|
<where>
|
TM.deleted = 0
|
<if test="query.classesIds !=null">
|
and classes_id in
|
<foreach collection="query.classesIds" item="classesId" open="(" close=")" separator=",">
|
#{classesId}
|
</foreach>
|
</if>
|
<if test="query.teacherId!=null">
|
and TM.create_user = #{query.teacherId}
|
</if>
|
<if test="query.status!=null">
|
and TM.status = #{query.status}
|
</if>
|
<if test="query.meetName !=null and query.meetName!='' ">
|
and TM.meet_name like concat ('%',#{query.meetName},'%')
|
</if>
|
</where>
|
</select>
|
|
<select id="getStudentList" resultType="com.ycl.jxkg.domain.vo.StudentSimpleVO">
|
SELECT
|
s.real_name, s.id
|
FROM
|
t_meet m
|
INNER JOIN t_classes c ON m.classes_id = c.id AND m.id = #{meetId} AND c.deleted = 0 AND m.deleted = 0
|
INNER JOIN t_classes_user cu ON cu.classes_id = c.id AND cu.deleted = 0
|
INNER JOIN t_user s ON s.id = cu.user_id AND s.deleted = 0
|
<if test="keyword != null and keyword != ''">AND s.real_name like concat('%', #{keyword}, '%')</if>
|
</select>
|
|
</mapper>
|