DataBase - Insert into 優化

優化一

<insert>
  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>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章