mybatis set逗号
时间: 2023-11-30 21:46:12 浏览: 81
回答: 在MyBatis中,使用set标签时,如果有逗号的话,会直接去掉逗号。这是因为set标签会自动处理逗号的问题,避免出现多余的逗号导致语法错误。当set标签中的条件成立时,会附加set关键字,并更新相应的字段。而当字段为null时,该列不会被更新。因此,set标签可以忽略与SQL无关的逗号。\[1\]\[2\]
#### 引用[.reference_title]
- *1* [mybatis set标签用法](https://blog.csdn.net/xinyuebaihe/article/details/85379540)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [Mybatis的set标签](https://blog.csdn.net/qq_43223307/article/details/121408191)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [mybatis自动去除多余的逗号,AND , OR](https://blog.csdn.net/weixin_33755554/article/details/92611359)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文