字典类型加上组织字段

This commit is contained in:
秦鸿展
2026-05-14 14:18:51 +08:00
parent c7c536782f
commit f8c6be9db8
11 changed files with 289 additions and 35 deletions
@@ -58,6 +58,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="topOrganizationId != null">
and (top_organization_id = #{topOrganizationId} OR is_default = 'Y')
</if>
<if test="organizationId != null">
and (IFNULL(organization_id, 0) = #{organizationId} OR is_default = 'Y')
</if>
</where>
order by dict_sort asc
</select>
@@ -73,7 +76,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="countDictDataByType" resultType="Integer">
select count(1) from sys_dict_data where dict_type=#{dictType}
select count(1) from sys_dict_data
where dict_type = #{dictType}
and IFNULL(organization_id, 0) = IFNULL(#{organizationId}, 0)
</select>
<delete id="deleteDictDataById" parameterType="Long">
@@ -108,8 +113,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where dict_code = #{dictCode}
</update>
<update id="updateDictDataType" parameterType="String">
update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType}
<update id="updateDictDataType">
update sys_dict_data set dict_type = #{newDictType}
where dict_type = #{oldDictType}
and IFNULL(organization_id, 0) = IFNULL(#{organizationId}, 0)
</update>
<update id="updateDictDataOrganizationByDictType">
update sys_dict_data
set organization_id = #{organizationId},
organization_name = #{organizationName},
top_organization_id = #{topOrganizationId},
update_time = sysdate()
where dict_type = #{dictType}
and IFNULL(organization_id, 0) = IFNULL(#{scopeOrganizationId}, 0)
</update>
<insert id="insertDictData" parameterType="SysDictData">