This commit is contained in:
2025-09-11 14:12:22 +08:00
parent 35ebacc326
commit 36bd470611
3 changed files with 60 additions and 55 deletions

View File

@@ -6,7 +6,7 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://127.0.0.1:3306/managersystem?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://127.0.0.1:n3306/managersystem?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: Wxit11335577
# 从库数据源

View File

@@ -34,8 +34,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
p.project_name
from biz_module m
left join biz_project p on m.project_id = p.project_id
left join sys_user u1 on u1.user_id = CAST(m.assignee AS UNSIGNED)
left join sys_user u2 on u2.user_name = m.assignee
left join sys_user u1 on (m.assignee REGEXP '^[0-9]+$') and u1.user_id = CAST(m.assignee AS UNSIGNED)
left join sys_user u2 on (NOT (m.assignee REGEXP '^[0-9]+$')) and u2.user_name = m.assignee
</sql>
<select id="selectBizModuleList" parameterType="BizModule" resultMap="BizModuleResult">
@@ -44,7 +44,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="projectId != null "> and m.project_id = #{projectId}</if>
<if test="moduleName != null and moduleName != ''"> and m.module_name like concat('%', #{moduleName}, '%')</if>
<if test="status != null and status != ''"> and m.status = #{status}</if>
<if test="assignee != null and assignee != ''"> and m.assignee = #{assignee}</if>
<if test="assignee != null and assignee != ''">
and (
m.assignee = #{assignee}
or exists (
select 1 from sys_user su
where (
(#{assignee} REGEXP '^[0-9]+$' and su.user_id = CAST(#{assignee} AS UNSIGNED))
or su.user_name = #{assignee}
)
and (su.user_name = m.assignee or CAST(m.assignee AS CHAR) = CAST(su.user_id AS CHAR))
)
)
</if>
<if test="assignTime != null "> and m.assign_time = #{assignTime}</if>
<if test="finishTime != null "> and m.finish_time = #{finishTime}</if>
and m.del_flag = '0'
@@ -75,7 +87,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBizModuleByModuleId" parameterType="Long" resultMap="BizModuleResult">
<include refid="selectBizModuleVo"/>
where module_id = #{moduleId}
where m.module_id = #{moduleId}
limit 1
</select>
<insert id="insertBizModule" parameterType="BizModule" useGeneratedKeys="true" keyProperty="moduleId">
@@ -157,8 +170,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
p.project_name
from biz_module m
left join biz_project p on m.project_id = p.project_id
left join sys_user u1 on u1.user_id = CAST(m.assignee AS UNSIGNED)
left join sys_user u2 on u2.user_name = m.assignee
left join sys_user u1 on (m.assignee REGEXP '^[0-9]+$') and u1.user_id = CAST(m.assignee AS UNSIGNED)
left join sys_user u2 on (NOT (m.assignee REGEXP '^[0-9]+$')) and u2.user_name = m.assignee
where m.designated_user = #{userId} and m.del_flag = '0'
order by m.create_time desc
</select>