diff --git a/src/main/java/com/ruoyi/project/system/dict/mapper/DictDataMapper.java b/src/main/java/com/ruoyi/project/system/dict/mapper/DictDataMapper.java
index 79fd2b78..2e89d369 100644
--- a/src/main/java/com/ruoyi/project/system/dict/mapper/DictDataMapper.java
+++ b/src/main/java/com/ruoyi/project/system/dict/mapper/DictDataMapper.java
@@ -87,4 +87,13 @@ public interface DictDataMapper
*/
public int updateDictData(DictData dictData);
+ /**
+ * 同步修改字典类型
+ *
+ * @param oldDictType 旧字典类型
+ * @param newDictType 新旧字典类型
+ * @return 结果
+ */
+ public int updateDictDataType(@Param("oldDictType") String oldDictType, @Param("newDictType") String newDictType);
+
}
diff --git a/src/main/java/com/ruoyi/project/system/dict/service/DictTypeServiceImpl.java b/src/main/java/com/ruoyi/project/system/dict/service/DictTypeServiceImpl.java
index 51583e32..dc00edb0 100644
--- a/src/main/java/com/ruoyi/project/system/dict/service/DictTypeServiceImpl.java
+++ b/src/main/java/com/ruoyi/project/system/dict/service/DictTypeServiceImpl.java
@@ -117,6 +117,8 @@ public class DictTypeServiceImpl implements IDictTypeService
public int updateDictType(DictType dictType)
{
dictType.setUpdateBy(ShiroUtils.getLoginName());
+ DictType oldDict = dictTypeMapper.selectDictTypeById(dictType.getDictId());
+ dictDataMapper.updateDictDataType(oldDict.getDictType(), dictType.getDictType());
return dictTypeMapper.updateDictType(dictType);
}
diff --git a/src/main/resources/mybatis/monitor/JobMapper.xml b/src/main/resources/mybatis/monitor/JobMapper.xml
index ea57f0fe..02c27573 100644
--- a/src/main/resources/mybatis/monitor/JobMapper.xml
+++ b/src/main/resources/mybatis/monitor/JobMapper.xml
@@ -73,8 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update_by = #{updateBy},
update_time = sysdate()
- where 1=1
- and job_id = #{jobId}
+ where job_id = #{jobId}
diff --git a/src/main/resources/mybatis/system/DeptMapper.xml b/src/main/resources/mybatis/system/DeptMapper.xml
index e015f61a..193ef2cb 100644
--- a/src/main/resources/mybatis/system/DeptMapper.xml
+++ b/src/main/resources/mybatis/system/DeptMapper.xml
@@ -103,8 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update_by = #{updateBy},
update_time = sysdate()
- where 1=1
- and dept_id = #{deptId}
+ where dept_id = #{deptId}
diff --git a/src/main/resources/mybatis/system/DictDataMapper.xml b/src/main/resources/mybatis/system/DictDataMapper.xml
index d55e3795..e3eee41a 100644
--- a/src/main/resources/mybatis/system/DictDataMapper.xml
+++ b/src/main/resources/mybatis/system/DictDataMapper.xml
@@ -84,8 +84,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update_by = #{updateBy},
update_time = sysdate()
- where 1=1
- and dict_code = #{dictCode}
+ where dict_code = #{dictCode}
+
+
+
+ update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
diff --git a/src/main/resources/mybatis/system/DictTypeMapper.xml b/src/main/resources/mybatis/system/DictTypeMapper.xml
index 30bcb2d8..15862135 100644
--- a/src/main/resources/mybatis/system/DictTypeMapper.xml
+++ b/src/main/resources/mybatis/system/DictTypeMapper.xml
@@ -75,8 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update_by = #{updateBy},
update_time = sysdate()
- where 1=1
- and dict_id = #{dictId}
+ where dict_id = #{dictId}
diff --git a/src/main/resources/mybatis/system/MenuMapper.xml b/src/main/resources/mybatis/system/MenuMapper.xml
index 0f70aa7b..db114124 100644
--- a/src/main/resources/mybatis/system/MenuMapper.xml
+++ b/src/main/resources/mybatis/system/MenuMapper.xml
@@ -102,8 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update_by = #{updateBy},
update_time = sysdate()
- where 1=1
- and menu_id = #{menuId}
+ where menu_id = #{menuId}