使用mybatis updateByPrimaryKeySelective方法来更新语句,但是null值也传过去了。
Mapper.xml
update zzbizorder_#{tableIndex}
clickid = #{record.clickid,jdbcType=BIGINT},
clickid = #{record.xxxx,jdbcType=BIGINT},
clickid = #{record.xxxx,jdbcType=BIGINT},
clickid = #{record.xxxx,jdbcType=BIGINT},
clickid = #{record.xxxx,jdbcType=BIGINT},
Mapper.class
public interface OrderEntityMapper {
int insertSelective(@Param("tableIndex") Integer tableIndex, @Param("record") OrderEntity record);
int updateByPrimaryKeySelective(@Param("tableIndex") Integer tableIndex, @Param("record") OrderEntity record);
}
程序打印的SQL语句:
JDBC Connection [com.mysql.jdbc.JDBC4Connection@377008df] will not be managed by Spring
==> Preparing: update order_? SET clickid = ?, xxxx = ?, xxxx = ?, xxxx = ?, xxxx = ?, where id = ?
==> Parameters: 0(Integer), null, null, null, null
<== Updates: 1
clickid为null,但是也set了,请问这是什么原因呢。