| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?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.yonge.cooleshow.biz.dal.dao.CourseGroupDao">
- <resultMap id="BaseResultMap" type="com.yonge.cooleshow.biz.dal.entity.CourseGroup">
- <id column="id_" jdbcType="BIGINT" property="id"/>
- <result column="type_" jdbcType="VARCHAR" property="type"/>
- <result column="teacher_id_" jdbcType="INTEGER" property="teacherId"/>
- <result column="name_" jdbcType="VARCHAR" property="name"/>
- <result column="subject_id_" jdbcType="INTEGER" property="subjectId"/>
- <result column="single_course_minutes_" jdbcType="INTEGER" property="singleCourseMinutes"/>
- <result column="course_num_" jdbcType="INTEGER" property="courseNum"/>
- <result column="course_introduce_" jdbcType="VARCHAR" property="courseIntroduce"/>
- <result column="course_price_" jdbcType="VARCHAR" property="coursePrice"/>
- <result column="status_" jdbcType="VARCHAR" property="status"/>
- <result column="sales_start_date_" jdbcType="TIMESTAMP" property="salesStartDate"/>
- <result column="sales_end_date_" jdbcType="TIMESTAMP" property="salesEndDate"/>
- <result column="background_pic_" jdbcType="VARCHAR" property="backgroundPic"/>
- <result column="mix_student_num_" jdbcType="INTEGER" property="mixStudentNum"/>
- <result column="course_start_time_" jdbcType="TIMESTAMP" property="courseStartTime"/>
- <result column="created_by_" jdbcType="INTEGER" property="createdBy"/>
- <result column="created_time_" jdbcType="TIMESTAMP" property="createdTime"/>
- <result column="updated_by_" jdbcType="INTEGER" property="updatedBy"/>
- <result column="updated_time_" jdbcType="TIMESTAMP" property="updatedTime"/>
- </resultMap>
- <sql id="Base_Column_List">
- id_
- , type_, teacher_id_, name_, subject_id_, single_course_minutes_, course_num_, course_introduce_, course_price_, status_, sales_start_date_, sales_end_date_, background_pic_, mix_student_num_, course_start_time_, created_by_, created_time_, updated_by_, updated_time_
- </sql>
- <insert id="insertBatch" keyColumn="id_" keyProperty="id" useGeneratedKeys="true"
- parameterType="com.yonge.cooleshow.biz.dal.entity.CourseGroup">
- insert into course_group(type_, teacher_id_, name_, subject_id_, single_course_minutes_, course_num_,
- course_introduce_, course_price_, status_, sales_start_date_, sales_end_date_, background_pic_,
- mix_student_num_, course_start_time_, created_by_, created_time_, updated_by_, updated_time_)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.type}, #{entity.teacherId}, #{entity.name}, #{entity.subjectId}, #{entity.singleCourseMinutes},
- #{entity.courseNum}, #{entity.courseIntroduce}, #{entity.coursePrice}, #{entity.status},
- #{entity.salesStartDate}, #{entity.salesEndDate}, #{entity.backgroundPic}, #{entity.mixStudentNum},
- #{entity.courseStartTime}, #{entity.createdBy}, #{entity.createdTime}, #{entity.updatedBy},
- #{entity.updatedTime})
- </foreach>
- </insert>
- <select id="queryTeacherCourseGroup" resultType="com.yonge.cooleshow.biz.dal.vo.TeacherCourseGroupVo">
- select
- b.id_ as courseGroupId,
- b.name_ as courseGroupName,
- s.name_ as subjectName,
- a.teacher_id_ as teacherId,
- u.real_name_ as teacherName,
- a.start_time_ as startTime,
- a.end_time_ as endTime,
- a.status_ as `status`,
- ifnull(a.pre_student_num_, 0) as studentCount,
- b.background_pic_ as backgroundPic,
- b.course_price_ as coursePrice,
- b.course_num_ as courseNum
- from course_group as b
- left join course_schedule as a on a.course_group_id_ = b.id_
- left join subject as s on b.subject_id_ = s.id_
- left join sys_user as u on a.teacher_id_ = u.id_
- <where>
- a.lock_ = 0
- <if test="param.teacherId != null">
- and b.teacher_id_ = #{param.teacherId}
- </if>
- <if test="param.status != null">
- and a.status_ = #{param.status}
- </if>
- <if test="param.groupStatus != null">
- and b.status_ = #{param.groupStatus}
- </if>
- <if test="param.type_ != null">
- and a.type_ = #{param.type}
- </if>
- <if test="param.startDate != null">
- AND <![CDATA[ a.class_date_ >= #{param.startDate} ]]>
- </if>
- <if test="param.endDate != null">
- AND <![CDATA[ a.class_date_ <= #{param.endDate} ]]>
- </if>
- <if test="param.subjectId != null">
- AND b.subject_id_ = #{param.subjectId}
- </if>
- </where>
- </select>
- </mapper>
|