|
@@ -0,0 +1,135 @@
|
|
|
|
+<?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.ym.mec.biz.dal.dao.CourseScheduleSwDao">
|
|
|
|
+
|
|
|
|
+ <resultMap type="com.ym.mec.biz.dal.entity.CourseScheduleSw"
|
|
|
|
+ id="CourseScheduleSw">
|
|
|
|
+ <result column="id_" property="id" />
|
|
|
|
+ <result column="teacher_id_" property="teacherId" />
|
|
|
|
+ <result column="teacher_name_" property="teacherName" />
|
|
|
|
+ <result column="course_type_" property="courseType" />
|
|
|
|
+ <result column="course_name_" property="courseName" />
|
|
|
|
+ <result column="teach_mode_" property="teachMode" />
|
|
|
|
+ <result column="course_status_" property="courseStatus" />
|
|
|
|
+ <result column="class_date_" property="classDate" />
|
|
|
|
+ <result column="class_time_" property="classTime" />
|
|
|
|
+ <result column="salary_" property="salary" />
|
|
|
|
+ <result column="create_time_" property="createTime" />
|
|
|
|
+ <result column="update_time_" property="updateTime" />
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <!-- 根据主键查询一条记录 -->
|
|
|
|
+ <select id="get" resultMap="CourseScheduleSw">
|
|
|
|
+ SELECT * FROM course_schedule_sw WHERE id_ = #{id}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <!-- 全查询 -->
|
|
|
|
+ <select id="findAll" resultMap="CourseScheduleSw">
|
|
|
|
+ SELECT * FROM course_schedule_sw ORDER BY id_
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <!-- 向数据库增加一条记录 -->
|
|
|
|
+ <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleSw"
|
|
|
|
+ useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
|
|
|
+ <!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval
|
|
|
|
+ AS ID FROM DUAL </selectKey> -->
|
|
|
|
+ INSERT INTO course_schedule_sw
|
|
|
|
+ (id_,teacher_id_,course_type_,course_name_,teach_mode_,class_date_,class_time_,salary_,create_time_,update_time_,course_status_)
|
|
|
|
+ VALUES(#{id},#{teacherId},#{courseType},#{courseName},#{teachMode},#{classDate},#{classTime},#{salary},#{createTime},#{updateTime},#{courseStatus})
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <!-- 根据主键查询一条记录 -->
|
|
|
|
+ <update id="update" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleSw">
|
|
|
|
+ UPDATE course_schedule_sw
|
|
|
|
+ <set>
|
|
|
|
+ <if test="classDate != null">
|
|
|
|
+ class_date_ = #{classDate},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="classTime != null">
|
|
|
|
+ class_time_ = #{classTime},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="id != null">
|
|
|
|
+ id_ = #{id},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="teacherId != null">
|
|
|
|
+ teacher_id_ = #{teacherId},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="teachMode != null">
|
|
|
|
+ teach_mode_ = #{teachMode},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="courseStatus != null">
|
|
|
|
+ course_status_ = #{courseStatus},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="salary != null">
|
|
|
|
+ salary_ = #{salary},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="updateTime != null">
|
|
|
|
+ update_time_ = #{updateTime},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="courseType != null">
|
|
|
|
+ course_type_ = #{courseType},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="courseName != null">
|
|
|
|
+ course_name_ = #{courseName},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createTime != null">
|
|
|
|
+ create_time_ = #{createTime},
|
|
|
|
+ </if>
|
|
|
|
+ </set>
|
|
|
|
+ WHERE id_ = #{id}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <!-- 根据主键删除一条记录 -->
|
|
|
|
+ <delete id="delete">
|
|
|
|
+ DELETE FROM course_schedule_sw WHERE id_ =
|
|
|
|
+ #{id}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+ <!-- 分页查询 -->
|
|
|
|
+ <select id="queryPage" resultMap="CourseScheduleSw"
|
|
|
|
+ parameterType="map">
|
|
|
|
+ SELECT cs.*,ifnull(u.real_name_,u.username_) teacher_name_ FROM course_schedule_sw cs left join sys_user u on cs.teacher_id_ = u.id_
|
|
|
|
+ <where>
|
|
|
|
+ <if test="teacherIdList != null">
|
|
|
|
+ and cs.teacher_id_ = #{teacherIdList}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="courseStatus != null">
|
|
|
|
+ and cs.course_status_ = #{courseStatus}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="teachMode != null">
|
|
|
|
+ and cs.teach_mode_ = #{teachMode}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createStartDate != null">
|
|
|
|
+ and class_date_ >= #{createStartDate}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createEndDate != null">
|
|
|
|
+ and class_date_ <= #{createEndDate}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ ORDER BY cs.class_date_ desc
|
|
|
|
+ <include refid="global.limit" />
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <!-- 查询当前表的总记录数 -->
|
|
|
|
+ <select id="queryCount" resultType="int">
|
|
|
|
+ SELECT COUNT(*) FROM course_schedule_sw cs left join sys_user u on cs.teacher_id_ = u.id_
|
|
|
|
+ <where>
|
|
|
|
+ <if test="teacherIdList != null">
|
|
|
|
+ and cs.teacher_id_ = #{teacherIdList}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="courseStatus != null">
|
|
|
|
+ and cs.course_status_ = #{courseStatus}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="teachMode != null">
|
|
|
|
+ and cs.teach_mode_ = #{teachMode}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createStartDate != null">
|
|
|
|
+ and class_date_ >= #{createStartDate}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createEndDate != null">
|
|
|
|
+ and class_date_ <= #{createEndDate}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+</mapper>
|