Browse Source

修改字典同步修改数据

RuoYi 6 years ago
parent
commit
ef5687b71c

+ 9 - 0
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);
+
 }

+ 2 - 0
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);
     }
 

+ 1 - 2
src/main/resources/mybatis/monitor/JobMapper.xml

@@ -73,8 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  			update_time = sysdate()
  		</set>
- 		where 1=1
- 		<if test="jobId != null">and job_id = #{jobId}</if>
+ 		where job_id = #{jobId}
 	</update>
  	
  	<insert id="insertJob" parameterType="Post" useGeneratedKeys="true" keyProperty="jobId">

+ 1 - 2
src/main/resources/mybatis/system/DeptMapper.xml

@@ -103,8 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  			update_time = sysdate()
  		</set>
- 		where 1=1
- 		<if test="deptId != null and deptId  != ''">and dept_id = #{deptId}</if>
+ 		where dept_id = #{deptId}
 	</update>
 
 	<delete id="deleteDeptById" parameterType="Long">

+ 5 - 2
src/main/resources/mybatis/system/DictDataMapper.xml

@@ -84,8 +84,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  			update_time = sysdate()
  		</set>
- 		where 1=1
- 		<if test="dictCode != null and dictCode  != ''">and dict_code = #{dictCode}</if>
+ 		where dict_code = #{dictCode}
+	</update>
+	
+	<update id="updateDictDataType" parameterType="String">
+ 		update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
 	</update>
  	
  	<insert id="insertDictData" parameterType="DictData">

+ 1 - 2
src/main/resources/mybatis/system/DictTypeMapper.xml

@@ -75,8 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  			update_time = sysdate()
  		</set>
- 		where 1=1
- 		<if test="dictId != null and dictId  != ''">and dict_id = #{dictId}</if>
+ 		where dict_id = #{dictId}
 	</update>
  	
  	<insert id="insertDictType" parameterType="DictType">

+ 1 - 2
src/main/resources/mybatis/system/MenuMapper.xml

@@ -102,8 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  			update_time = sysdate()
  		</set>
- 		where 1=1
- 		<if test="menuId != null and menuId  != ''">and menu_id = #{menuId}</if>
+ 		where menu_id = #{menuId}
 	</update>
  	
  	<insert id="insertMenu" parameterType="Menu">

+ 1 - 2
src/main/resources/mybatis/system/PostMapper.xml

@@ -71,8 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  			update_time = sysdate()
  		</set>
- 		where 1=1
- 		<if test="postId != null">and post_id = #{postId}</if>
+ 		where post_id = #{postId}
 	</update>
  	
  	<insert id="insertPost" parameterType="Post" useGeneratedKeys="true" keyProperty="postId">

+ 1 - 2
src/main/resources/mybatis/system/RoleMapper.xml

@@ -86,8 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  			update_time = sysdate()
  		</set>
- 		where 1=1
- 		<if test="roleId != null">and role_id = #{roleId}</if>
+ 		where role_id = #{roleId}
 	</update>
  	
  	<insert id="insertRole" parameterType="Role" useGeneratedKeys="true" keyProperty="roleId">

+ 1 - 2
src/main/resources/mybatis/system/UserMapper.xml

@@ -129,8 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="remark != null and remark != ''">remark = #{remark},</if>
  			update_time = sysdate()
  		</set>
- 		where 1=1
- 		<if test="userId != null and userId  != ''">and user_id = #{userId}</if>
+ 		where user_id = #{userId}
 	</update>
  	
  	<insert id="insertUser" parameterType="User" useGeneratedKeys="true" keyProperty="userId">

+ 0 - 1
src/main/resources/static/ajax/libs/cropbox/cropbox.css

@@ -125,4 +125,3 @@ a.upload-img:hover{
 }
 
 .tc{text-align:center;}
-/*www.jq22.com*/

+ 0 - 6
src/main/resources/static/ajax/libs/cropbox/cropbox.js

@@ -1,7 +1,3 @@
-/**
- * Created by ezgoing on 14/9/2014.
- */
-
 "use strict";
 (function (factory) {
     if (typeof define === 'function' && define.amd) {
@@ -137,5 +133,3 @@
         return new cropbox(options, this);
     };
 }));
-
-/*www.jq22.com*/