修改字典同步修改数据

dep_wangsr
RuoYi 6 years ago committed by Limy
parent c1ff27a13c
commit 8c0de4aa22

@ -87,4 +87,13 @@ public interface DictDataMapper
*/ */
public int updateDictData(DictData dictData); public int updateDictData(DictData dictData);
/**
*
*
* @param oldDictType
* @param newDictType
* @return
*/
public int updateDictDataType(@Param("oldDictType") String oldDictType, @Param("newDictType") String newDictType);
} }

@ -117,6 +117,8 @@ public class DictTypeServiceImpl implements IDictTypeService
public int updateDictType(DictType dictType) public int updateDictType(DictType dictType)
{ {
dictType.setUpdateBy(ShiroUtils.getLoginName()); dictType.setUpdateBy(ShiroUtils.getLoginName());
DictType oldDict = dictTypeMapper.selectDictTypeById(dictType.getDictId());
dictDataMapper.updateDictDataType(oldDict.getDictType(), dictType.getDictType());
return dictTypeMapper.updateDictType(dictType); return dictTypeMapper.updateDictType(dictType);
} }

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save