SbloodyS commented on code in PR #16288: URL: https://github.com/apache/dolphinscheduler/pull/16288#discussion_r1671714940
########## dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessLineageMapper.xml: ########## @@ -0,0 +1,137 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one or more + ~ contributor license agreements. See the NOTICE file distributed with + ~ this work for additional information regarding copyright ownership. + ~ The ASF licenses this file to You under the Apache License, Version 2.0 + ~ (the "License"); you may not use this file except in compliance with + ~ the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > +<mapper namespace="org.apache.dolphinscheduler.dao.mapper.ProcessLineageMapper"> + <sql id="baseSql"> + id + , process_definition_code + , process_definition_version + , task_definition_code + , task_definition_version + , dept_project_code + , dept_process_definition_code + , dept_task_definition_code + , create_time + , update_time + </sql> + + <delete id="batchDeleteByProcessDefinitionCode"> + delete from t_ds_process_lineage + where process_definition_code in + <foreach collection="processDefinitionCodes" index="index" item="i" open="(" separator="," close=")"> + #{i} + </foreach> + </delete> + + <insert id="batchInsert"> + insert into t_ds_process_lineage (process_definition_code, process_definition_version, task_definition_code, + task_definition_version, dept_project_code, dept_process_definition_code, dept_task_definition_code) + values + <foreach collection="processLineages" item="processLineage" separator=","> + (#{processLineage.processDefinitionCode},#{processLineage.processDefinitionVersion}, + #{processLineage.taskDefinitionCode},#{processLineage.taskDefinitionVersion}, + #{processLineage.deptProjectCode},#{processLineage.deptProcessDefinitionCode}, + #{processLineage.deptTaskDefinitionCode}) + </foreach> + </insert> + + <select id="queryByProjectCode" resultType="org.apache.dolphinscheduler.dao.entity.ProcessLineage"> + select + <include refid="baseSql"/> + from + t_ds_process_lineage + where process_definition_code in (select code from t_ds_process_definition where project_code = #{projectCode}) + </select> + + <select id="queryWorkFlowLineageByCode" resultType="org.apache.dolphinscheduler.dao.entity.WorkFlowRelationDetail"> + select + tepd.code as work_flow_code + ,tepd.name as work_flow_name + ,tepd.release_state as work_flow_publish_status + ,tes.start_time as schedule_start_time + ,tes.end_time as schedule_end_time + ,tes.crontab as crontab + ,tes.release_state as schedule_publish_status + from t_ds_process_definition tepd + left join t_ds_schedules tes on tepd.code = tes.process_definition_code + where tepd.code = #{processDefinitionCode} + </select> + + <select id="queryWorkFlowLineageByName" resultType="org.apache.dolphinscheduler.dao.entity.WorkFlowRelationDetail"> + select + tepd.code as work_flow_code + ,tepd.name as work_flow_name + ,tepd.release_state as work_flow_publish_status + ,tes.start_time as schedule_start_time + ,tes.end_time as schedule_end_time + ,tes.crontab as crontab + ,tes.release_state as schedule_publish_status + from t_ds_process_definition tepd + left join t_ds_schedules tes on tepd.code = tes.process_definition_code + where 1=1 + <if test="processDefinitionName != null and processDefinitionName != ''"> + and tepd.name = #{processDefinitionName} + </if> + and tepd.project_code = #{projectCode} + </select> + + <select id="queryWorkFlowLineageByCode" resultType="org.apache.dolphinscheduler.dao.entity.WorkFlowRelationDetail"> + select + tepd.code as work_flow_code + ,tepd.name as work_flow_name + ,tepd.release_state as work_flow_publish_status + ,tes.start_time as schedule_start_time + ,tes.end_time as schedule_end_time + ,tes.crontab as crontab + ,tes.release_state as schedule_publish_status + from t_ds_process_definition tepd Review Comment: Fixed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
