【数据库】insert语句

来源:互联网 发布:sql 月份 分类合计 编辑:程序博客网 时间:2024/05/18 03:28
<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>
原创粉丝点击