mybatis批量插入需要注意的细节
1.value的后面不应该再加小括号(),在foreach里面加小括号,不然会发生语法错误;
<insert id="addGoodsList" parameterType="list"> insert into wms_goods(GOOD_NAME,GOOD_TYPE,GOOD_SIZE,GOOD_VALUE)values <foreach collection="list" item="s" separator=","> ( #{s.goodName}, #{s.goodType}, #{s.goodSize}, #{s.goodValue} ) </foreach> </insert>
相关推荐
xiuyangsong 2020-11-16
Nishinoshou 2020-11-09
jimgreatly 2020-09-01
dongxurr 2020-08-18
Dullonjiang 2020-08-15
Dullonjiang 2020-08-11
Dullonjiang 2020-08-09
dongxurr 2020-08-08
yunzhonmghe 2020-08-07
jimgreatly 2020-08-03
Dullonjiang 2020-07-30
jimgreatly 2020-07-27
liqiancao 2020-07-26
xiuyangsong 2020-07-26
dongxurr 2020-07-26
mcvsyy 2020-07-26
helloxusir 2020-07-25
牧场SZShepherd 2020-07-20
Dullonjiang 2020-07-19