【数据库】insert语句

<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>
posted @ 2017-08-19 09:46  Legolas_4  阅读(451)  评论(0编辑  收藏  举报