From b22ed8f6af17d72dd2826af52885833b29ab921f Mon Sep 17 00:00:00 2001 From: "zangch@mesnac.com" Date: Wed, 4 Mar 2026 14:16:30 +0800 Subject: [PATCH] =?UTF-8?q?fix(sql):=20=E4=BF=AE=E5=A4=8D=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E6=9F=A5=E8=AF=A2=E4=B8=AD=E7=9A=84FIND=5FIN?= =?UTF-8?q?=5FSET=E5=87=BD=E6=95=B0=E5=85=BC=E5=AE=B9=E6=80=A7=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将BaseBomInfoMapper.xml中的FIND_IN_SET替换为INSTR函数以提高数据库兼容性 - 更新DataScopeAspect.java中部门数据权限查询的FIND_IN_SET为INSTR函数 - 修改OrderBomInfoMapper.xml中子级BOM查询的FIND_IN_SET函数 - 替换SysDeptMapper.xml中部门层级查询的FIND_IN_SET为INSTR函数 - 更新SysUserMapper.xml中用户查询的部门层级条件为INSTR函数 - 移除所有XML映射文件末尾多余的空行以保持代码整洁 --- .../src/main/resources/mapper/base/OrderBomInfoMapper.xml | 4 ++-- .../java/com/aucma/framework/aspectj/DataScopeAspect.java | 2 +- .../main/resources/mapper/production/BaseBomInfoMapper.xml | 4 ++-- .../src/main/resources/mapper/system/SysDeptMapper.xml | 6 +++--- .../src/main/resources/mapper/system/SysUserMapper.xml | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/aucma-base/src/main/resources/mapper/base/OrderBomInfoMapper.xml b/aucma-base/src/main/resources/mapper/base/OrderBomInfoMapper.xml index 430ca6f..ac3ce47 100644 --- a/aucma-base/src/main/resources/mapper/base/OrderBomInfoMapper.xml +++ b/aucma-base/src/main/resources/mapper/base/OrderBomInfoMapper.xml @@ -169,7 +169,7 @@ @@ -199,4 +199,4 @@ #{item.materialCode} - \ No newline at end of file + diff --git a/aucma-framework/src/main/java/com/aucma/framework/aspectj/DataScopeAspect.java b/aucma-framework/src/main/java/com/aucma/framework/aspectj/DataScopeAspect.java index c024ae7..e6c6ec6 100644 --- a/aucma-framework/src/main/java/com/aucma/framework/aspectj/DataScopeAspect.java +++ b/aucma-framework/src/main/java/com/aucma/framework/aspectj/DataScopeAspect.java @@ -124,7 +124,7 @@ public class DataScopeAspect else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) { sqlString.append(StringUtils.format( - " OR {}.dept_id IN ( SELECT dept_id from Z_sys_dept WHERE dept_id = {} or 0 < find_in_set( {} , ancestors ) )", + " OR {}.dept_id IN ( SELECT dept_id from Z_sys_dept WHERE dept_id = {} or INSTR(',' || ancestors || ',', ',' || {} || ',') > 0 )", deptAlias, user.getDeptId(), user.getDeptId())); } else if (DATA_SCOPE_SELF.equals(dataScope)) diff --git a/aucma-production/src/main/resources/mapper/production/BaseBomInfoMapper.xml b/aucma-production/src/main/resources/mapper/production/BaseBomInfoMapper.xml index 8ec4444..6512458 100644 --- a/aucma-production/src/main/resources/mapper/production/BaseBomInfoMapper.xml +++ b/aucma-production/src/main/resources/mapper/production/BaseBomInfoMapper.xml @@ -101,7 +101,7 @@ @@ -190,4 +190,4 @@ #{objId} - \ No newline at end of file + diff --git a/aucma-system/src/main/resources/mapper/system/SysDeptMapper.xml b/aucma-system/src/main/resources/mapper/system/SysDeptMapper.xml index eace0fb..abf4c3a 100644 --- a/aucma-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/aucma-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -73,11 +73,11 @@