首页 > 其他分享 >DataBase - Insert into 优化

DataBase - Insert into 优化

时间:2022-09-04 17:24:37浏览次数:47  
标签:Insert name DataBase into user id

优化一

<insert id="insertUser">
  insert into sys_user(
    <if test="userId != null and userId != 0">user_id,</if>
    <if test="deptId != null and deptId != 0">dept_id,</if>
    <if test="userName != null and userName != ''">user_name,</if>
    <if test="nickName != null and nickName != ''">nick_name,</if>
    create_time
  )values(
    <if test="userId != null and userId != ''">#{userId},</if>
    <if test="deptId != null and deptId != ''">#{deptId},</if>
    <if test="userName != null and userName != ''">#{userName},</if>
    <if test="nickName != null and nickName != ''">#{nickName},</if>
    sysdate()
  )
</insert>

标签:Insert,name,DataBase,into,user,id
From: https://www.cnblogs.com/feiqiangsheng/p/16655464.html

相关文章