sql语句没有对字段判断
<insert id="insert">
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}
)
</insert>
sql语句对字段判断
<insert id="insertSelective" parameterType="com.itunion.Student">
insert into student
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="age != null">
age,
</if>
<if test="money != null">
money,
</if>
<if test="cla_code != null">
cla_code,
</if>
<if test="create_time != null">
create_time,
</if>
<if test="del_flag != null">
del_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="age != null">
#{age,jdbcType=INTEGER},
</if>
<if test="money != null">
#{money,jdbcType=DECIMAL},
</if>
<if test="cla_code != null">
#{cla_code,jdbcType=VARCHAR},
</if>
<if test="create_time != null">
#{create_time,jdbcType=TIMESTAMP},
</if>
<if test="del_flag != null">
#{del_flag,jdbcType=CHAR},
</if>
</trim>
</insert>