<?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.sckw.slope.detection.dao.KwsMountainCompanyMapper">
    <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.mysql.KwsMountainCompany">
        <!--@mbg.generated-->
        <!--@Table kws_mountain_company-->
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="mountain_id" jdbcType="VARCHAR" property="mountainId"/>
        <result column="company_id" jdbcType="VARCHAR" property="companyId"/>
        <result column="del_flag" jdbcType="TINYINT" property="delFlag"/>
    </resultMap>
    <sql id="Base_Column_List">
        <!--@mbg.generated-->
        id,
        mountain_id,
        company_id,
        del_flag
    </sql>
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        <!--@mbg.generated-->
        select
        <include refid="Base_Column_List"/>
        from kws_mountain_company
        where id = #{id,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
        <!--@mbg.generated-->
        delete
        from kws_mountain_company
        where id = #{id,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsMountainCompany">
        <!--@mbg.generated-->
        insert into kws_mountain_company (id, mountain_id, company_id,
                                          del_flag)
        values (#{id,jdbcType=BIGINT}, #{mountainId,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR},
                #{delFlag,jdbcType=TINYINT})
    </insert>
    <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsMountainCompany">
        <!--@mbg.generated-->
        insert into kws_mountain_company
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">
                id,
            </if>
            <if test="mountainId != null">
                mountain_id,
            </if>
            <if test="companyId != null">
                company_id,
            </if>
            <if test="delFlag != null">
                del_flag,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
                #{id,jdbcType=BIGINT},
            </if>
            <if test="mountainId != null">
                #{mountainId,jdbcType=VARCHAR},
            </if>
            <if test="companyId != null">
                #{companyId,jdbcType=VARCHAR},
            </if>
            <if test="delFlag != null">
                #{delFlag,jdbcType=TINYINT},
            </if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective"
            parameterType="com.sckw.slope.detection.model.dos.mysql.KwsMountainCompany">
        <!--@mbg.generated-->
        update kws_mountain_company
        <set>
            <if test="mountainId != null">
                mountain_id = #{mountainId,jdbcType=VARCHAR},
            </if>
            <if test="companyId != null">
                company_id = #{companyId,jdbcType=VARCHAR},
            </if>
            <if test="delFlag != null">
                del_flag = #{delFlag,jdbcType=TINYINT},
            </if>
        </set>
        where id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKey" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsMountainCompany">
        <!--@mbg.generated-->
        update kws_mountain_company
        set mountain_id = #{mountainId,jdbcType=VARCHAR},
            company_id  = #{companyId,jdbcType=VARCHAR},
            del_flag    = #{delFlag,jdbcType=TINYINT}
        where id = #{id,jdbcType=BIGINT}
    </update>
</mapper>