<?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.DegreeLevelFeeDao">
    <resultMap id="DegreeLevelFee" type="com.ym.mec.biz.dal.entity.DegreeLevelFee">
        <!--@mbg.generated-->
        <!--@Table degree_level_fee-->
        <id column="id_" property="id"/>
        <result column="level_" property="level"/>
        <result column="grade_" property="grade"/>
        <result column="theory_" property="theory"/>
        <result column="create_time_" property="createTime"/>
        <result column="update_time_" property="updateTime"/>
    </resultMap>
    <select id="get" parameterType="java.lang.Integer" resultMap="DegreeLevelFee">
        <!--@mbg.generated-->
        select *
        from degree_level_fee
        where id_ = #{id}
    </select>
    <delete id="delete" parameterType="java.lang.Integer">
        <!--@mbg.generated-->
        delete from degree_level_fee
        where id_ = #{id}
    </delete>
    <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.DegreeLevelFee"
            useGeneratedKeys="true">
        <!--@mbg.generated-->
        insert into degree_level_fee (level_, grade_, theory_, create_time_, update_time_)
        values (#{level}, #{grade}, #{theory}, #{createTime}, #{updateTime})
    </insert>
    <update id="update" parameterType="com.ym.mec.biz.dal.entity.DegreeLevelFee">
        <!--@mbg.generated-->
        update degree_level_fee
        <set>
            <if test="level != null">
                level_ = #{level},
            </if>
            <if test="grade != null">
                grade_ = #{grade},
            </if>
            <if test="theory != null">
                theory_ = #{theory},
            </if>
            <if test="createTime != null">
                create_time_ = #{createTime},
            </if>
            <if test="updateTime != null">
                update_time_ = #{updateTime},
            </if>
        </set>
        where id_ = #{id}
    </update>

    <!-- 全查询 -->
    <select id="getAll" resultMap="DegreeLevelFee">
        SELECT *
        FROM degree_level_fee
        ORDER BY level_ ASC
    </select>
</mapper>
