<?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="cn.com.countrygarden.bi.main.dao.performance.PerformanceTypeMapper">

    <resultMap id="BaseResultMap" type="cn.com.countrygarden.bi.main.model.performance.PerformanceType">
        <id column="type_no" jdbcType="VARCHAR" property="typeNo"/>
        <result column="type_name" jdbcType="VARCHAR" property="typeName"/>
    </resultMap>

    <!--通用查询结果-->
    <sql id="Base_Column_List">
       type_no,type_name
    </sql>

    <insert id="insertSelective" parameterType="PerformanceType">
        insert into performance_type
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="typeNo != null">
                type_no,
            </if>
            <if test="typeName != null">
                type_name,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                <if test="typeNo != null">
                    #{typeNo,jdbcType=VARCHAR},
                </if>
                <if test="typeName != null">
                    #{typeName,jdbcType=VARCHAR},
                </if>
        </trim>
    </insert>

    <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
        delete from performance_type
        where type_no = #{typeNo,jdbcType=VARCHAR}
    </delete>

    <update id="updateByPrimaryKeySelective" parameterType="PerformanceType">
        update performance_type
        <set>
            <if test="typeName != null">
                type_name = #{typeName,jdbcType=VARCHAR},
            </if>
        </set>
        where type_no = #{typeNo,jdbcType=VARCHAR}
    </update>

    <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from performance_type
        where type_no = #{typeNo,jdbcType=VARCHAR}
    </select>
    
</mapper>