mysql 实现批量添加和更新功能

//mapper.xml文件配置

单独添加
 
 
insert into company_address
(branchName,address,phone,telephone,companyId,contact,
qz,isDel,longitude,dimensions,branchprovince,branchcity,brancharea,
branchrelation,intro,culture

)
values
(#{branchName},#{address},#{phone},#{telephone},#{companyId},#{contact},
#{qz},#{isDel},#{longitude},#{dimensions},#{branchprovince},#{branchcity},#{brancharea},
#{branchrelation},#{intro},#{culture}
)

实现批量添加


  insert into line
  (sta,end,wl_id,qz,del_flag,type,tui,direct

)
  values
   
       (
       #{Pather.sta}, #{Pather.end},
       #{Pather.wlId},
       #{Pather.qz},
       #{Pather.delFlag}, #{Pather.type}
       , #{Pather.tui}, #{Pather.direct}
       
       )
    

批量更新


UPDATE 
	line
SET
	del_flag= #{del_flag}
WHERE id in
	 
    #{Pather.id}


 

你可能感兴趣的:(mysql 实现批量添加和更新功能)