feat:修改

new-exam
wangxy 5 months ago
parent aa2b1d94bd
commit cac97361bc

@ -8,13 +8,13 @@ spring:
# 主库数据源 # 主库数据源
master: master:
# url: jdbc:mysql://192.168.254.123:3306/zhky?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # url: jdbc:mysql://192.168.254.123:3306/zhky?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:kingbase8://192.168.254.197:54321/test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&clientEncoding=UTF8 url: jdbc:kingbase8://61.178.84.89:54321/test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&clientEncoding=UTF8
#username: root #username: root
#password: qwer1234 #password: 123456
username: ENC(ElFzIjuV3codlxGotvqqyA==) username: ENC(Q+yfell1zQ6sxQ0Safq/Wg==)
# password: ENC(aM81j4MP4WJC4ZQBNlDntx0jKsP3wwQZ) # password: ENC(aM81j4MP4WJC4ZQBNlDntx0jKsP3wwQZ)
password: ENC(YgAg6bUSgw1uc1H17kDw0g==) password: ENC(zAEOw2QzRe7UXMKfeIkWWg==)
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭

@ -7,12 +7,12 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:kingbase8://192.168.110.55:54321/test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&clientEncoding=UTF8 url: jdbc:kingbase8://222.92.109.36:54321/zhky?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&clientEncoding=UTF8
#username: root #username: system
#password: qwer1234 #password: Gsqy@#!2023
username: ENC(ElFzIjuV3codlxGotvqqyA==) username: ENC(pLDKT5USjfjI8YjvRGAvAQ==)
# password: ENC(aM81j4MP4WJC4ZQBNlDntx0jKsP3wwQZ) # password: ENC(aM81j4MP4WJC4ZQBNlDntx0jKsP3wwQZ)
password: ENC(1p5e3vtTaq7oHGRDipJo/Q==) password: ENC(mrAPPtlgGuC+PBq8z3xpLi4KpZmTebr0)
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭

@ -9,7 +9,7 @@ ruoyi:
# 实例演示开关 # 实例演示开关
demoEnabled: false demoEnabled: false
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath # 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
profile: D:/ruoyi/uploadPath profile: /home/zhky/uploadPath
# 获取ip地址开关 # 获取ip地址开关
addressEnabled: false addressEnabled: false

@ -122,7 +122,7 @@ public class DataScopeAspect
else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope))
{ {
sqlString.append(StringUtils.format( sqlString.append(StringUtils.format(
" OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )", " OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or CAST({} AS text) = ANY(string_to_array(ancestors, ',')))",
deptAlias, user.getDeptId(), user.getDeptId())); deptAlias, user.getDeptId(), user.getDeptId()));
} }
else if (DATA_SCOPE_SELF.equals(dataScope)) else if (DATA_SCOPE_SELF.equals(dataScope))

@ -87,11 +87,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult"> <select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
select * from ${prefix}sys_dept where find_in_set(#{deptId}, ancestors) select * from ${prefix}sys_dept where CAST(#{deptId} AS text) = ANY(string_to_array(ancestors, ','))
</select> </select>
<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int"> <select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
select count(*) from ${prefix}sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors) select count(*) from ${prefix}sys_dept where status = 0 and del_flag = '0' and CAST(#{deptId} AS text) = ANY(string_to_array(ancestors, ','))
</select> </select>
<insert id="insertDept" parameterType="SysDept"> <insert id="insertDept" parameterType="SysDept">

@ -108,7 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND u.create_time &lt;= #{params.endTime} AND u.create_time &lt;= #{params.endTime}
</if> </if>
<if test="deptId != null and deptId != 0"> <if test="deptId != null and deptId != 0">
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET (#{deptId},ancestors) )) AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE CAST(#{deptId} AS text) = ANY(string_to_array(ancestors, ',')) ))
</if> </if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}

Loading…
Cancel
Save