<?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.OrganizationDegreeCourseFeeDao">
    <resultMap id="OrganizationDegreeCourseFee" type="com.ym.mec.biz.dal.entity.OrganizationDegreeCourseFee">
        <!--@mbg.generated-->
        <!--@Table organization_degree_course_fee-->
        <id column="id_" property="id"/>
        <result column="organ_id_" property="organId"/>
        <result column="original_vip_1v1_" property="originalVip1v1"/>
        <result column="original_vip_1v2_" property="originalVip1v2"/>
        <result column="vip_1v1_" property="vip1v1"/>
        <result column="vip_1v2_" property="vip1v2"/>
        <result column="original_theory_" property="originalTheory"/>
        <result column="theory_" property="theory"/>
        <result column="create_time_" property="createTime"/>
        <result column="update_time_" property="updateTime"/>
        <result column="tenant_id_" property="tenantId"/>
    </resultMap>
    <select id="get" parameterType="java.lang.Integer" resultMap="OrganizationDegreeCourseFee">
        <!--@mbg.generated-->
        select *
        from organization_degree_course_fee
        where id_ = #{id}
    </select>
    <delete id="delete" parameterType="java.lang.Integer">
        <!--@mbg.generated-->
        delete from organization_degree_course_fee
        where id_ = #{id}
    </delete>
    <insert id="insert" keyColumn="id_" keyProperty="id"
            parameterType="com.ym.mec.biz.dal.entity.OrganizationDegreeCourseFee" useGeneratedKeys="true">
        <!--@mbg.generated-->
        insert into organization_degree_course_fee (organ_id_,original_vip_1v1_,original_vip_1v2_, vip_1v1_,
        vip_1v2_,theory_, create_time_, update_time_, tenant_id_)
        values (#{organId},#{originalVip1v1},#{originalVip1v2}, #{vip1v1},#{vip1v2}, #{theory}, #{createTime},
        #{updateTime},#{tenantId})
    </insert>
    <update id="update" parameterType="com.ym.mec.biz.dal.entity.OrganizationDegreeCourseFee">
        <!--@mbg.generated-->
        update organization_degree_course_fee
        <set>
            <if test="organId != null">
                organ_id_ = #{organId},
            </if>
            <if test="originalVip1v1 != null">
                original_vip_1v1_ = #{originalVip1v1},
            </if>
            <if test="originalVip1v2 != null">
                original_vip_1v2_ = #{originalVip1v2},
            </if>
            <if test="vip1v1 != null">
                vip_1v1_ = #{vip1v1},
            </if>
            <if test="vip1v2 != null">
                vip_1v2_ = #{vip1v2},
            </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} and tenant_id_ = #{tenantId}
    </update>

    <select id="getByOrganId" resultMap="OrganizationDegreeCourseFee">
        SELECT *
        FROM organization_degree_course_fee
        WHERE organ_id_ = #{organId}
    </select>
</mapper>
