2025-05-08 20:42:58 +08:00
|
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
|
|
<!DOCTYPE mapper
|
|
|
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
|
<mapper namespace="com.ruoyi.oa.mapper.OaProjectScheduleStepMapper">
|
|
|
|
|
|
|
|
|
|
|
|
<resultMap id="OaProjectScheduleStepResult"
|
|
|
|
|
|
type="com.ruoyi.oa.domain.vo.OaProjectScheduleStepVo" >
|
|
|
|
|
|
<!-- 主键最好用 <id/>,以便 MyBatis 去重 -->
|
|
|
|
|
|
<id property="trackId" column="track_id"/>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ========== 原有字段 ========= -->
|
|
|
|
|
|
<result property="accessory" column="accessory"/>
|
|
|
|
|
|
<result property="scheduleId" column="schedule_id"/>
|
|
|
|
|
|
<result property="stepOrder" column="step_order"/>
|
|
|
|
|
|
<result property="stepName" column="step_name"/>
|
|
|
|
|
|
<result property="planStart" column="plan_start"/>
|
|
|
|
|
|
<result property="planEnd" column="plan_end"/>
|
|
|
|
|
|
<result property="actualStart" column="actual_start"/>
|
|
|
|
|
|
<result property="actualEnd" column="actual_end"/>
|
|
|
|
|
|
<result property="status" column="status"/>
|
|
|
|
|
|
<result property="expectedDays" column="expected_days"/>
|
2025-05-10 22:17:04 +08:00
|
|
|
|
<result property="useFlag" column="use_flag"/>
|
2025-05-20 09:11:45 +08:00
|
|
|
|
<result property="header" column="header"/>
|
2025-10-21 16:56:13 +08:00
|
|
|
|
<result property="tabNode" column="tab_node"/>
|
|
|
|
|
|
<result property="firstLevelNode" column="first_level_node"/>
|
|
|
|
|
|
<result property="secondLevelNode" column="second_level_node"/>
|
|
|
|
|
|
<result property="startTime" column="start_time"/>
|
|
|
|
|
|
<result property="originalEndTime" column="original_end_time"/>
|
|
|
|
|
|
<result property="endTime" column="end_time"/>
|
|
|
|
|
|
<result property="nodeHeader" column="node_header"/>
|
|
|
|
|
|
<result property="relatedDocs" column="related_docs"/>
|
|
|
|
|
|
<result property="relatedImages" column="related_images"/>
|
|
|
|
|
|
<result property="specification" column="specification"/>
|
2025-05-08 20:42:58 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- ========== 附件列表:多对一 折叠 ========= -->
|
|
|
|
|
|
<collection property="fileList"
|
|
|
|
|
|
ofType="com.ruoyi.system.domain.SysOss"
|
|
|
|
|
|
javaType="java.util.ArrayList">
|
2025-05-10 22:17:04 +08:00
|
|
|
|
<result property="ossId" column="oss_id"/>
|
2025-05-08 20:42:58 +08:00
|
|
|
|
<result property="url" column="attach_url"/>
|
|
|
|
|
|
<result property="fileName" column="attach_file_name"/>
|
|
|
|
|
|
<result property="createBy" column="create_by"/>
|
2025-05-10 22:17:04 +08:00
|
|
|
|
<result property="isPublic" column="is_public"/>
|
|
|
|
|
|
<result property="ownerId" column="owner_id"/>
|
2025-05-08 20:42:58 +08:00
|
|
|
|
</collection>
|
|
|
|
|
|
</resultMap>
|
2025-05-10 22:17:04 +08:00
|
|
|
|
|
|
|
|
|
|
<sql id="OssVisibleCondition">
|
|
|
|
|
|
( so.is_public = 1
|
|
|
|
|
|
OR so.owner_id = #{userId}
|
|
|
|
|
|
OR EXISTS (SELECT 1 FROM sys_oss_acl a
|
|
|
|
|
|
WHERE a.oss_id = so.oss_id
|
|
|
|
|
|
AND a.user_id = #{userId}) )
|
|
|
|
|
|
</sql>
|
2025-10-21 16:56:13 +08:00
|
|
|
|
<insert id="saveBatch">
|
|
|
|
|
|
INSERT INTO oa_project_schedule_step (
|
|
|
|
|
|
schedule_id,
|
|
|
|
|
|
step_order,
|
|
|
|
|
|
step_name,
|
|
|
|
|
|
tab_node,
|
|
|
|
|
|
first_level_node,
|
|
|
|
|
|
second_level_node,
|
2025-10-24 09:44:35 +08:00
|
|
|
|
specification,
|
|
|
|
|
|
sort_num
|
2025-10-21 16:56:13 +08:00
|
|
|
|
) VALUES
|
|
|
|
|
|
<foreach item="item" index="index" collection="list" separator=",">
|
|
|
|
|
|
(
|
|
|
|
|
|
#{item.scheduleId},
|
|
|
|
|
|
#{item.stepOrder},
|
|
|
|
|
|
#{item.stepName},
|
|
|
|
|
|
#{item.tabNode},
|
|
|
|
|
|
#{item.firstLevelNode},
|
|
|
|
|
|
#{item.secondLevelNode},
|
2025-10-24 09:44:35 +08:00
|
|
|
|
#{item.specification},
|
|
|
|
|
|
#{item.sortNum}
|
2025-10-21 16:56:13 +08:00
|
|
|
|
)
|
|
|
|
|
|
</foreach>
|
|
|
|
|
|
</insert>
|
2025-05-10 22:17:04 +08:00
|
|
|
|
|
2025-05-08 20:42:58 +08:00
|
|
|
|
<update id="updateByStepAndScheduleId">
|
|
|
|
|
|
UPDATE oa_project_schedule_step
|
|
|
|
|
|
SET
|
|
|
|
|
|
status = 1,
|
|
|
|
|
|
actual_end = NOW()
|
|
|
|
|
|
WHERE
|
|
|
|
|
|
schedule_id = #{scheduleId}
|
|
|
|
|
|
AND step_order = #{currentStep}
|
|
|
|
|
|
AND del_flag = '0'
|
2025-05-10 22:17:04 +08:00
|
|
|
|
and use_flag = '1'
|
2025-05-08 20:42:58 +08:00
|
|
|
|
</update>
|
2025-11-11 13:33:26 +08:00
|
|
|
|
<delete id="deleteByScheduleIds">
|
|
|
|
|
|
DELETE FROM oa_project_schedule_step
|
|
|
|
|
|
WHERE schedule_id IN
|
|
|
|
|
|
<foreach collection="scheduleIds" item="id" open="(" separator="," close=")">
|
|
|
|
|
|
#{id}
|
|
|
|
|
|
</foreach>
|
|
|
|
|
|
</delete>
|
2025-05-08 20:42:58 +08:00
|
|
|
|
<select id="maxStepByScheduleId" resultMap="OaProjectScheduleStepResult">
|
|
|
|
|
|
SELECT opss.track_id,
|
|
|
|
|
|
opss.accessory,
|
|
|
|
|
|
opss.schedule_id,
|
|
|
|
|
|
opss.step_order,
|
|
|
|
|
|
opss.step_name,
|
|
|
|
|
|
opss.plan_start,
|
|
|
|
|
|
opss.plan_end,
|
|
|
|
|
|
opss.actual_start,
|
|
|
|
|
|
opss.actual_end,
|
|
|
|
|
|
opss.status,
|
|
|
|
|
|
opss.del_flag,
|
|
|
|
|
|
opss.header,
|
2025-05-10 22:17:04 +08:00
|
|
|
|
opss.use_flag,
|
2025-05-08 20:42:58 +08:00
|
|
|
|
osts.expected_days,
|
|
|
|
|
|
osts.description
|
|
|
|
|
|
FROM oa_project_schedule_step opss
|
|
|
|
|
|
LEFT JOIN fad_oa.oa_project_schedule ops ON ops.schedule_id = opss.schedule_id
|
|
|
|
|
|
LEFT JOIN fad_oa.oa_schedule_template_step osts ON osts.template_id = ops.template_id AND osts.step_order = opss.step_order
|
|
|
|
|
|
WHERE opss.schedule_id = #{scheduleId}
|
|
|
|
|
|
AND opss.del_flag = '0'
|
2025-05-10 22:17:04 +08:00
|
|
|
|
and opss.use_flag = '1'
|
2025-05-08 20:42:58 +08:00
|
|
|
|
AND opss.step_order = (
|
|
|
|
|
|
SELECT MAX(step_order)
|
|
|
|
|
|
FROM oa_project_schedule_step
|
|
|
|
|
|
WHERE schedule_id = #{scheduleId}
|
|
|
|
|
|
AND del_flag = '0'
|
2025-05-10 22:17:04 +08:00
|
|
|
|
and use_flag = '1'
|
2025-05-08 20:42:58 +08:00
|
|
|
|
)
|
2025-05-10 22:17:04 +08:00
|
|
|
|
|
2025-05-08 20:42:58 +08:00
|
|
|
|
</select>
|
|
|
|
|
|
<select id="selectVoPagePlus" resultMap="OaProjectScheduleStepResult">
|
|
|
|
|
|
select opss.track_id,
|
|
|
|
|
|
opss.accessory,
|
|
|
|
|
|
opss.schedule_id,
|
|
|
|
|
|
opss.step_order,
|
|
|
|
|
|
opss.step_name,
|
|
|
|
|
|
opss.plan_start,
|
|
|
|
|
|
opss.plan_end,
|
|
|
|
|
|
opss.actual_start,
|
|
|
|
|
|
opss.actual_end,
|
|
|
|
|
|
opss.status,
|
|
|
|
|
|
opss.del_flag,
|
|
|
|
|
|
opss.header,
|
2025-05-10 22:17:04 +08:00
|
|
|
|
opss.use_flag,
|
2025-05-08 20:42:58 +08:00
|
|
|
|
osts.expected_days,
|
|
|
|
|
|
osts.description,
|
|
|
|
|
|
so.oss_id AS oss_id,
|
|
|
|
|
|
so.url AS attach_url,
|
|
|
|
|
|
so.original_name AS attach_file_name, -- 如有需要
|
2025-05-10 22:17:04 +08:00
|
|
|
|
so.create_by,
|
|
|
|
|
|
so.is_public,
|
|
|
|
|
|
so.owner_id,
|
|
|
|
|
|
batch_id
|
2025-05-08 20:42:58 +08:00
|
|
|
|
from oa_project_schedule_step opss
|
|
|
|
|
|
left join fad_oa.oa_project_schedule ops on ops.schedule_id = opss.schedule_id
|
|
|
|
|
|
left join fad_oa.oa_schedule_template_step osts on osts.template_id = ops.template_id and osts.step_order = opss.step_order
|
2025-05-10 22:17:04 +08:00
|
|
|
|
LEFT JOIN sys_oss so ON FIND_IN_SET(so.oss_id, opss.accessory)
|
|
|
|
|
|
AND <include refid="OssVisibleCondition"/>
|
2025-05-08 20:42:58 +08:00
|
|
|
|
${ew.getCustomSqlSegment}
|
|
|
|
|
|
</select>
|
|
|
|
|
|
<select id="selectVoPlusById" resultMap="OaProjectScheduleStepResult">
|
|
|
|
|
|
select opss.track_id,
|
2025-05-10 22:17:04 +08:00
|
|
|
|
opss.accessory,
|
|
|
|
|
|
opss.schedule_id,
|
|
|
|
|
|
opss.step_order,
|
|
|
|
|
|
opss.step_name,
|
|
|
|
|
|
opss.plan_start,
|
|
|
|
|
|
opss.plan_end,
|
|
|
|
|
|
opss.actual_start,
|
|
|
|
|
|
opss.actual_end,
|
|
|
|
|
|
opss.status,
|
|
|
|
|
|
opss.use_flag,
|
|
|
|
|
|
opss.del_flag,
|
|
|
|
|
|
opss.header,
|
|
|
|
|
|
osts.expected_days,
|
|
|
|
|
|
osts.description,
|
|
|
|
|
|
so.oss_id AS oss_id,
|
|
|
|
|
|
so.url AS attach_url,
|
|
|
|
|
|
so.original_name AS attach_file_name, -- 如有需要
|
|
|
|
|
|
so.create_by,
|
|
|
|
|
|
so.owner_id,
|
|
|
|
|
|
so.is_public
|
2025-05-08 20:42:58 +08:00
|
|
|
|
from oa_project_schedule_step opss
|
2025-05-10 22:17:04 +08:00
|
|
|
|
left join fad_oa.oa_project_schedule ops on ops.schedule_id = opss.schedule_id
|
|
|
|
|
|
left join fad_oa.oa_schedule_template_step osts on osts.template_id = ops.template_id and osts.step_order =
|
|
|
|
|
|
opss.step_order
|
|
|
|
|
|
LEFT JOIN sys_oss so ON FIND_IN_SET(so.oss_id, opss.accessory)
|
|
|
|
|
|
AND
|
|
|
|
|
|
<include refid="OssVisibleCondition"/>
|
|
|
|
|
|
where opss.track_id = #{trackId} and opss.del_flag='0' and opss.use_flag = '1'
|
2025-05-08 20:42:58 +08:00
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectByCurrentStepAndScheduleId" resultType="com.ruoyi.oa.domain.vo.OaProjectScheduleStepVo">
|
|
|
|
|
|
select opss.track_id,
|
|
|
|
|
|
accessory,
|
|
|
|
|
|
schedule_id,
|
|
|
|
|
|
step_order,
|
|
|
|
|
|
step_name,
|
|
|
|
|
|
plan_start,
|
|
|
|
|
|
plan_end,
|
|
|
|
|
|
actual_start,
|
|
|
|
|
|
actual_end,
|
2025-05-10 22:17:04 +08:00
|
|
|
|
opss.use_flag,
|
2025-05-08 20:42:58 +08:00
|
|
|
|
status,
|
|
|
|
|
|
header
|
|
|
|
|
|
from oa_project_schedule_step opss
|
2026-04-15 17:19:56 +08:00
|
|
|
|
WHERE opss.schedule_id = #{scheduleId}
|
|
|
|
|
|
AND opss.step_order = #{currentStep}
|
2025-05-10 22:17:04 +08:00
|
|
|
|
and use_flag = '1'
|
2025-05-08 20:42:58 +08:00
|
|
|
|
AND del_flag = '0'
|
|
|
|
|
|
</select>
|
2025-11-11 14:01:45 +08:00
|
|
|
|
<select id="selectVoPageNew" resultType="com.ruoyi.oa.domain.vo.OaProjectScheduleStepVo">
|
|
|
|
|
|
SELECT
|
|
|
|
|
|
opss.track_id,
|
|
|
|
|
|
opss.accessory,
|
|
|
|
|
|
opss.schedule_id,
|
|
|
|
|
|
opss.step_order,
|
|
|
|
|
|
opss.step_name,
|
|
|
|
|
|
opss.plan_start,
|
|
|
|
|
|
opss.plan_end,
|
|
|
|
|
|
opss.actual_start,
|
|
|
|
|
|
opss.actual_end,
|
|
|
|
|
|
opss.status,
|
|
|
|
|
|
opss.create_by,
|
|
|
|
|
|
opss.create_time,
|
|
|
|
|
|
opss.update_by,
|
|
|
|
|
|
opss.update_time,
|
|
|
|
|
|
opss.del_flag,
|
|
|
|
|
|
opss.header,
|
|
|
|
|
|
opss.use_flag,
|
|
|
|
|
|
opss.batch_id,
|
|
|
|
|
|
opss.tab_node,
|
|
|
|
|
|
opss.first_level_node,
|
|
|
|
|
|
opss.second_level_node,
|
|
|
|
|
|
opss.start_time,
|
|
|
|
|
|
opss.original_end_time,
|
|
|
|
|
|
opss.end_time,
|
|
|
|
|
|
opss.node_header,
|
|
|
|
|
|
opss.related_docs,
|
|
|
|
|
|
opss.related_images,
|
|
|
|
|
|
opss.supplier_id,
|
|
|
|
|
|
opss.requirement_file,
|
|
|
|
|
|
opss.other,
|
|
|
|
|
|
opss.specification,
|
|
|
|
|
|
opss.sort_num,
|
|
|
|
|
|
schedule.project_id AS projectId,
|
|
|
|
|
|
project.project_name AS projectName,
|
|
|
|
|
|
supplier.supplier_name AS supplierName
|
|
|
|
|
|
FROM
|
|
|
|
|
|
oa_project_schedule_step opss
|
|
|
|
|
|
INNER JOIN oa_project_schedule schedule
|
|
|
|
|
|
ON opss.schedule_id = schedule.schedule_id
|
|
|
|
|
|
INNER JOIN sys_oa_project project
|
|
|
|
|
|
ON schedule.project_id = project.project_id
|
|
|
|
|
|
-- 根据供应商id拿供应商名字
|
|
|
|
|
|
LEFT JOIN oa_supplier supplier
|
|
|
|
|
|
ON opss.supplier_id = supplier.supplier_id
|
2025-11-11 14:09:05 +08:00
|
|
|
|
${ew.customSqlSegment}
|
2025-11-11 14:01:45 +08:00
|
|
|
|
</select>
|
2025-05-08 20:42:58 +08:00
|
|
|
|
|
2026-04-15 17:19:56 +08:00
|
|
|
|
<!--
|
|
|
|
|
|
综合看板:按 schedule_id 查询步骤列表
|
|
|
|
|
|
要求:
|
|
|
|
|
|
- 删除 del_flag(表无该字段)
|
|
|
|
|
|
- 不使用 opss.* 前缀(不定义别名)
|
|
|
|
|
|
- 仅保留 WHERE schedule_id = #{scheduleId}
|
|
|
|
|
|
-->
|
|
|
|
|
|
<select id="selectProjectScheduleStepList"
|
|
|
|
|
|
parameterType="com.ruoyi.oa.domain.OaProjectScheduleStep"
|
|
|
|
|
|
resultMap="OaProjectScheduleStepResult">
|
|
|
|
|
|
SELECT
|
|
|
|
|
|
track_id, accessory, schedule_id, step_order, step_name,
|
|
|
|
|
|
plan_start, plan_end, actual_start, actual_end, status,
|
|
|
|
|
|
header, use_flag, batch_id, tab_node,
|
|
|
|
|
|
first_level_node, second_level_node,
|
|
|
|
|
|
start_time, original_end_time, end_time,
|
|
|
|
|
|
node_header, related_docs, related_images,
|
|
|
|
|
|
specification, sort_num, supplier_id,
|
|
|
|
|
|
requirement_file, other,
|
|
|
|
|
|
create_by, create_time, update_by, update_time
|
|
|
|
|
|
FROM oa_project_schedule_step
|
|
|
|
|
|
WHERE schedule_id = #{scheduleId}
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
2025-05-08 20:42:58 +08:00
|
|
|
|
|
|
|
|
|
|
</mapper>
|