<?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.djhk.uav.equ.mapper.EquModelParamMapper">

    <insert id="insertEquModelParam" parameterType="com.djhk.uav.equ.domain.EquModelParam" useGeneratedKeys="true" keyProperty="paramSeq">
        insert into equ_model_param
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="modelId != null and modelId != ''">model_id,</if>
            <if test="paramCode != null and paramCode != ''">param_code,</if>
            <if test="paramValue != null">param_value</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="modelId != null and modelId != ''">#{modelId},</if>
            <if test="paramCode != null and paramCode != ''">#{paramCode},</if>
            <if test="paramValue != null and paramValue != ''">#{paramValue}</if>
        </trim>
    </insert>


    <update id="updateEquModelParam" parameterType="com.djhk.uav.equ.domain.EquModelParam">
        update equ_model_param
        <set>
            <if test="modelId != null and modelId != ''">model_id = #{modelId},</if>
            <if test="paramCode != null and paramCode != ''">param_code = #{paramCode},</if>
            <if test="paramValue != null and paramValue != ''">param_value = #{paramValue}</if>
        </set>
        where param_seq = #{paramSeq}
    </update>
</mapper>