mybatis的mapper文件中,sql插入语句

sql语句没有对字段判断

    
		insert into student (
			id, 
			name, 
			age,
			money, 
			cla_code,
			create_time,
			del_flag
		)values (
			#{id,jdbcType=INTEGER},
			#{name,jdbcType=VARCHAR},
			#{age,jdbcType=INTEGER},
			#{money,jdbcType=DECIMAL}, #{cla_code,jdbcType=VARCHAR},
			#{create_time,jdbcType=TIMESTAMP},
			#{del_flag,jdbcType=CHAR}
		)
	

sql语句对字段判断

	
	    insert into student
	    
	      
	        id,
	      
	      
	        name,
	      
	      
	        age,
	      
	      
	        money,
	      
	      
	        cla_code,
	      
	      
	        create_time,
	      
	      
	        del_flag,
	      
	    
	    
	      
	        #{id,jdbcType=INTEGER},
	      
	      
	        #{name,jdbcType=VARCHAR},
	      
	      
	        #{age,jdbcType=INTEGER},
	      
	      
	        #{money,jdbcType=DECIMAL},
	      
	      
	        #{cla_code,jdbcType=VARCHAR},
	      
	      
	        #{create_time,jdbcType=TIMESTAMP},
	      
	      
	        #{del_flag,jdbcType=CHAR},
	      
	    
  

 

你可能感兴趣的:(mybatis)