/**
* 批量插入或修改
* @param cos
* @return
*/
@Insert("<script>"+
"<foreach collection='cos' item='co' separator=';'>"+
"insert into bloc_allocation_ratio (post_id, post_name, "+
"bazaar, technique, "+
"synthesis_cost, manage_labour, "+
"profit_share, upload_time, "+
"upload_user_id, upload_user_name)values "+
"(#{co.postId,jdbcType=VARCHAR}, #{co.postName,jdbcType=VARCHAR}, "+
"#{co.bazaar,jdbcType=VARCHAR}, #{co.technique,jdbcType=VARCHAR}, "+
"#{co.synthesisCost,jdbcType=VARCHAR}, #{co.manageLabour,jdbcType=VARCHAR}, "+
"#{co.profitShare,jdbcType=VARCHAR}, NOW(), "+
"#{co.uploadUser
mybatis新增,主键不存在插入,主键存在则更新,如果更新,更新的字段如果为空则不更新该字段
最新推荐文章于 2023-02-15 10:40:17 发布