1. 程式人生 > >【數據庫】insert語句

【數據庫】insert語句

test ins efi ram parameter value scrip ref type

<insert id="insert" parameterType="net.huadong.entity.system.SystemRole">
insert into SYSTEM_ROLE
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">
name,
</if>
<if test="role_code != null">
role_code,
</if>
<if test="description != null">
description,
</if>
<if test="sort_id != null">
sort_id,
</if>
<if test="disabled != null">
disabled,
</if>
<if test="id != null">
id,
</if>
</trim>

<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">
#{name},
</if>
<if test="role_code != null">
#{role_code},
</if>
<if test="description != null">
#{description},
</if>
<if test="sort_id != null">
#{sort_id},
</if>
<if test="disabled != null">
#{disabled},
</if>
<if test="id != null">
#{id},
</if>
</trim>

</insert>

【數據庫】insert語句