mybatis的mapper文件中,sql更新语句

sql语句中没有对字段判断

   
		update student
		set 
			name = #{record.name,jdbcType=VARCHAR},
			age = #{record.age,jdbcType=INTEGER},
			money = #{record.money,jdbcType=DECIMAL},
			cla_code = #{record.cla_code,jdbcType=VARCHAR},
			create_time = #{record.create_time,jdbcType=TIMESTAMP},
			del_flag = #{record.del_flag,jdbcType=CHAR}
		where id = #{record.id}
  

sql语句中对字段判断

  
    update student
    
      
        name = #{record.name,jdbcType=VARCHAR},
      
      
        age = #{record.age,jdbcType=INTEGER},
      
      
        money = #{record.money,jdbcType=DECIMAL},
      
      
        cla_code = #{record.cla_code,jdbcType=VARCHAR},
      
      
        create_time = #{record.create_time,jdbcType=TIMESTAMP},
      
      
        del_flag = #{record.del_flag,jdbcType=CHAR},
      
    
    where id = #{record.id}
  

 

你可能感兴趣的:(mybatis)