Aaron Wang
2 years ago
committed by
GitHub
10 changed files with 4 additions and 507 deletions
@ -1,56 +0,0 @@
|
||||
/* |
||||
* 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. |
||||
* |
||||
*/ |
||||
|
||||
package org.apache.dolphinscheduler.dao.entity; |
||||
|
||||
import org.apache.dolphinscheduler.spi.enums.ResourceType; |
||||
|
||||
import lombok.Data; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
||||
@Data |
||||
@TableName("t_ds_relation_resources_task") |
||||
public class ResourcesTask { |
||||
|
||||
@TableId(value = "id", type = IdType.AUTO) |
||||
private Integer id; |
||||
|
||||
private String fullName; |
||||
|
||||
private int taskId; |
||||
|
||||
private ResourceType type; |
||||
|
||||
public ResourcesTask(int id, String fullName, int taskId, ResourceType type) { |
||||
this.id = id; |
||||
this.fullName = fullName; |
||||
this.taskId = taskId; |
||||
this.type = type; |
||||
} |
||||
|
||||
public ResourcesTask(int taskId, String fullName, ResourceType type) { |
||||
this.taskId = taskId; |
||||
this.fullName = fullName; |
||||
this.type = type; |
||||
} |
||||
} |
@ -1,45 +0,0 @@
|
||||
/* |
||||
* 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. |
||||
* |
||||
*/ |
||||
|
||||
package org.apache.dolphinscheduler.dao.mapper; |
||||
|
||||
import org.apache.dolphinscheduler.dao.entity.ResourcesTask; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* resource task relation mapper interface
|
||||
*/ |
||||
public interface ResourceTaskMapper extends BaseMapper<ResourcesTask> { |
||||
|
||||
Integer existResourceByTaskIdNFullName(@Param("taskId") int task_id, @Param("fullName") String fullName); |
||||
|
||||
int deleteIds(@Param("resIds") Integer[] resIds); |
||||
|
||||
int updateResource(@Param("id") int id, @Param("fullName") String fullName); |
||||
|
||||
List<ResourcesTask> selectBatchFullNames(@Param("fullNameArr") String[] fullNameArr); |
||||
|
||||
List<ResourcesTask> selectSubfoldersFullNames(@Param("folderPath") String folderPath); |
||||
} |
@ -1,58 +0,0 @@
|
||||
<?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.ResourceTaskMapper"> |
||||
<sql id="baseSqlV2"> |
||||
${alias}.id, ${alias}.full_name, ${alias}.task_id, ${alias}.type |
||||
</sql> |
||||
<select id="existResourceByTaskIdNFullName" resultType="java.lang.Integer"> |
||||
select |
||||
id |
||||
from t_ds_relation_resources_task |
||||
where full_name = #{fullName} and task_id = #{taskId} |
||||
</select> |
||||
|
||||
<select id="selectBatchFullNames" resultType="org.apache.dolphinscheduler.dao.entity.ResourcesTask"> |
||||
select |
||||
id, full_name, task_id, type |
||||
from t_ds_relation_resources_task |
||||
where full_name in |
||||
<foreach collection="fullNameArr" item="i" open="(" close=")" separator=","> |
||||
#{i} |
||||
</foreach> |
||||
</select> |
||||
|
||||
<update id="updateResource" > |
||||
UPDATE t_ds_relation_resources_task SET full_name=#{fullName} WHERE id=#{id} |
||||
</update> |
||||
|
||||
<delete id="deleteIds" parameterType="java.lang.Integer"> |
||||
delete from t_ds_relation_resources_task where id in |
||||
<foreach collection="resIds" item="i" open="(" close=")" separator=","> |
||||
#{i} |
||||
</foreach> |
||||
</delete> |
||||
|
||||
<select id="selectSubfoldersFullNames" resultType="org.apache.dolphinscheduler.dao.entity.ResourcesTask"> |
||||
select |
||||
id, full_name, task_id, type |
||||
from t_ds_relation_resources_task |
||||
where full_name like concat(#{folderPath}, '%') |
||||
</select> |
||||
</mapper> |
Loading…
Reference in new issue