From 78cdded6671c7a1e7437d3df0e5b06bd446a6906 Mon Sep 17 00:00:00 2001 From: ZhouXY108 Date: Fri, 17 Mar 2023 18:42:43 +0800 Subject: [PATCH] =?UTF-8?q?int=20=E6=95=B0=E7=BB=84=E7=9A=84=E5=80=BC?= =?UTF-8?q?=E6=80=BB=E5=92=8C=E5=8F=AF=E8=83=BD=E5=A4=A7=E4=BA=8E=20int=20?= =?UTF-8?q?=E7=9A=84=E6=9C=80=E5=A4=A7=E5=80=BC=EF=BC=8C=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=20long=20=E7=B1=BB=E5=9E=8B=E7=9A=84=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E5=AD=98=E5=82=A8=E5=85=B6=E7=BB=93=E6=9E=9C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/xyz/zhouxy/plusone/jdbc/PlusoneJdbcDaoSupport.java | 6 +++--- .../system/domain/model/account/AccountRoleRefDAO.java | 2 +- .../plusone/system/domain/model/dict/DictValueDAO.java | 4 ++-- .../plusone/system/domain/model/role/RoleMenuRefDAO.java | 2 +- .../system/domain/model/role/RolePermissionRefDAO.java | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/plusone-basic/plusone-basic-infrastructure/src/main/java/xyz/zhouxy/plusone/jdbc/PlusoneJdbcDaoSupport.java b/plusone-basic/plusone-basic-infrastructure/src/main/java/xyz/zhouxy/plusone/jdbc/PlusoneJdbcDaoSupport.java index b8f0cd6..c190e7d 100644 --- a/plusone-basic/plusone-basic-infrastructure/src/main/java/xyz/zhouxy/plusone/jdbc/PlusoneJdbcDaoSupport.java +++ b/plusone-basic/plusone-basic-infrastructure/src/main/java/xyz/zhouxy/plusone/jdbc/PlusoneJdbcDaoSupport.java @@ -86,18 +86,18 @@ public abstract class PlusoneJdbcDaoSupport { return update(sql, new MapSqlParameterSource(paramName, value)); } - protected final int batchUpdate(String sql, SqlParameterSource[] batchArgs) { + protected final long batchUpdate(String sql, SqlParameterSource[] batchArgs) { int[] i = this.jdbc.batchUpdate(sql, batchArgs); return NumberUtil.sum(i); } - protected final int batchUpdate(String sql, Stream c, + protected final long batchUpdate(String sql, Stream c, @Nonnull Function paramSourceBuilder) { int[] i = this.jdbc.batchUpdate(sql, buildSqlParameterSourceArray(c, paramSourceBuilder)); return NumberUtil.sum(i); } - protected final int batchUpdate(String sql, Collection c, + protected final long batchUpdate(String sql, Collection c, @Nonnull Function paramSourceBuilder) { int[] i = this.jdbc.batchUpdate(sql, buildSqlParameterSourceArray(c, paramSourceBuilder)); return NumberUtil.sum(i); diff --git a/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/account/AccountRoleRefDAO.java b/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/account/AccountRoleRefDAO.java index 3e28167..f9aea5c 100644 --- a/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/account/AccountRoleRefDAO.java +++ b/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/account/AccountRoleRefDAO.java @@ -31,7 +31,7 @@ class AccountRoleRefDAO extends PlusoneJdbcDaoSupport { } void insertAccountRoleRefs(Long accountId, Set roleRefs) { - int i = batchUpdate( + long i = batchUpdate( "INSERT INTO sys_account_role (account_id, role_id) VALUES (:accountId, :roleId)", roleRefs, (Long roleId) -> new MapSqlParameterSource() diff --git a/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/dict/DictValueDAO.java b/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/dict/DictValueDAO.java index 19133c3..f1d981b 100644 --- a/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/dict/DictValueDAO.java +++ b/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/dict/DictValueDAO.java @@ -21,11 +21,11 @@ class DictValueDAO extends PlusoneJdbcDaoSupport { void updateDictValues(Dict entity) { update("DELETE FROM sys_dict_value WHERE dict_type = :dictType", "dictType", entity.getId().orElseThrow()); - int i = insertDictValues(entity.getId().orElseThrow(), entity); + long i = insertDictValues(entity.getId().orElseThrow(), entity); assertResultEquals(i, entity.count()); } - int insertDictValues(Long dictId, Dict entity) { + long insertDictValues(Long dictId, Dict entity) { if (Objects.isNull(dictId) || Objects.isNull(entity) || CollectionUtils.isEmpty(entity.getValues())) { return 0; } diff --git a/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/role/RoleMenuRefDAO.java b/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/role/RoleMenuRefDAO.java index 248ef97..9a0276f 100644 --- a/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/role/RoleMenuRefDAO.java +++ b/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/role/RoleMenuRefDAO.java @@ -29,7 +29,7 @@ class RoleMenuRefDAO extends PlusoneJdbcDaoSupport { } void saveRoleMenuRefs(Long roleId, Role entity) { - int i = batchUpdate( + long i = batchUpdate( "INSERT INTO sys_role_menu(role_id, menu_id) VALUES (:roleId, :menuId)", entity.getMenus(), menuRef -> new MapSqlParameterSource() diff --git a/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/role/RolePermissionRefDAO.java b/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/role/RolePermissionRefDAO.java index bbdd44a..2b69980 100644 --- a/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/role/RolePermissionRefDAO.java +++ b/plusone-system/plusone-system-infrastructure/src/main/java/xyz/zhouxy/plusone/system/domain/model/role/RolePermissionRefDAO.java @@ -30,7 +30,7 @@ class RolePermissionRefDAO extends PlusoneJdbcDaoSupport { } void saveRolePermissionRefs(Long roleId, Role entity) { - int i = batchUpdate( + long i = batchUpdate( "INSERT INTO sys_role_permission(role_id, permission_id) VALUES (:roleId, :permissionId)", entity.getPermissions(), actionRef -> new MapSqlParameterSource()