insert语句,插入数据时报错
源代码:
@Insert("INSERT INTO changetable (" +
"chan_id,chan_userid,chan_affiliate,chan_application,chan_modelnum,chan_modelbath,chan_property,chan_xzqh,chan_application_time,chan_filesid)" +
"VALUES" +
"((SELECT NEXTVAL('chan_seq')),#{chanUserid jdbcType=INTEGER},#{chanAffiliate jabcType=String},#{chanApplication jabcType=String},#{chanModelnum jabcType=String}," +
"#{chanModelbath jabcType=String},#{chanProperty jabcType=String},#{chanXzqh jabcType=String},NOW(),#{chanFilesid jabcType=String})")
int addChange(Change chan);
修改:#{chanUserid,jdbcType=INTEGER}
在jabcType前加 " , "
修改后重启服务报错:
Valid properties are javaType,jdbcType,mode,numericScale,resultMap,typeHandler,jdbcTypeName
修改:
jdbcType=VARCHAR
修改后成功运行
最终修改完代码:
@Insert("INSERT INTO changetable (" +
"chan_id,chan_userid,chan_affiliate,chan_application,chan_modelnum,chan_modelbath,chan_property,chan_xzqh,chan_application_time,chan_filesid)" +
"VALUES" +
"((SELECT NEXTVAL('chan_seq')),#{chanUserid,jdbcType=INTEGER},#{chanAffiliate,jdbcType=VARCHAR},#{chanApplication,jdbcType=VARCHAR},#{chanModelnum,jdbcType=VARCHAR}," +
"#{chanModelbath,jdbcType=VARCHAR},#{chanProperty,jdbcType=VARCHAR},#{chanXzqh,jdbcType=VARCHAR},NOW(),#{chanFilesid,jdbcType=VARCHAR})")
int addChange(Change chan);