mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-08 09:38:26 +08:00
feat: add BaseMapper.insertSelectiveWithPk() method
This commit is contained in:
parent
f613be3220
commit
184cc23355
@ -85,10 +85,21 @@ public interface BaseMapper<T> {
|
|||||||
/**
|
/**
|
||||||
* 插入带有主键的实体类。
|
* 插入带有主键的实体类。
|
||||||
*
|
*
|
||||||
* @param entity 实体类
|
* @param entity 实体类,不忽略 {@code null} 值
|
||||||
* @return 受影响的行数
|
* @return 受影响的行数
|
||||||
*/
|
*/
|
||||||
default int insertWithPk(T entity) {
|
default int insertWithPk(T entity) {
|
||||||
|
return insertWithPk(entity, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 插入带有主键的实体类。
|
||||||
|
*
|
||||||
|
* @param entity 实体类,忽略 {@code null} 值
|
||||||
|
* @return 受影响的行数
|
||||||
|
*/
|
||||||
|
default int insertSelectiveWithPk(T entity) {
|
||||||
return insertWithPk(entity, true);
|
return insertWithPk(entity, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user