|
<insert id="insertUser" useGeneratedKeys="true" keyProperty="id">
INSERT user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="username != null and username != ''">username, </if>
<if test="name != null and name != ''">name, </if>
<if test="age != null and age != ''">age, </if>
</trim>
VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="username != null and username != ''">#{username}, </if>
<if test="name != null and name != ''">#{name}, </if>
<if test="age != null and age != ''">#{age}, </if>
</trim>
</insert>
|
|