<?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.CoursesGroupModifyLogDao">

    <resultMap type="com.ym.mec.biz.dal.entity.CoursesGroupModifyLog" id="CoursesGroupModifyLog">
        <result column="id_" property="id"/>
        <result column="group_id_" property="groupId"/>
        <result column="group_type_" property="groupType"/>
        <result column="operator_id_" property="operatorId"/>
        <result column="previous_group_" property="previousGroup"/>
        <result column="current_group_" property="currentGroup"/>
        <result column="create_time_" property="createTime"/>
    </resultMap>

    <!-- 根据主键查询一条记录 -->
    <select id="get" resultMap="CoursesGroupModifyLog">
		SELECT * FROM courses_group_modify_log WHERE id_ = #{id}
	</select>

    <!-- 全查询 -->
    <select id="findAll" resultMap="CoursesGroupModifyLog">
		SELECT * FROM courses_group_modify_log ORDER BY id_
	</select>

    <!-- 向数据库增加一条记录 -->
    <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CoursesGroupModifyLog" useGeneratedKeys="true" keyColumn="id"
            keyProperty="id">
        INSERT INTO courses_group_modify_log (group_id_,group_type_,operator_id_,previous_group_,current_group_,create_time_)
        VALUES(#{groupId},#{groupType},#{operatorId},#{previousGroup},#{currentGroup},now())
    </insert>

    <!-- 根据主键查询一条记录 -->
    <update id="update" parameterType="com.ym.mec.biz.dal.entity.CoursesGroupModifyLog">
        UPDATE courses_group_modify_log
        <set>
            <if test="groupId != null">
                group_id_ = #{groupId},
            </if>
            <if test="groupType != null">
                group_type_ = #{groupType},
            </if>
            <if test="operatorId != null">
                operator_id_ = #{operatorId},
            </if>
            <if test="previousGroup != null">
                previous_group_ = #{previousGroup},
            </if>
            <if test="currentGroup != null">
                current_group_ = #{currentGroup},
            </if>
        </set>
        WHERE id_ = #{id}
    </update>

    <!-- 根据主键删除一条记录 -->
    <delete id="delete">
	</delete>

    <!-- 分页查询 -->
    <select id="queryPage" resultMap="CoursesGroupModifyLog" parameterType="map">
    </select>

    <!-- 查询当前表的总记录数 -->
    <select id="queryCount" resultType="int">
	</select>
</mapper>
