Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dolphinscheduler-common/sql/soft_version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
32432423
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore this file

1 change: 1 addition & 0 deletions dolphinscheduler-common/test/testFile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
正正正faffdasfasdfas
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore this file

Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
select t.id, t.user_id, t.token, t.expire_time, t.create_time, t.update_time, u.user_name
from t_ds_access_token t
left join t_ds_user u on t.user_id = u.id
where 1 = 1
<if test="userName != null and userName != ''">
and u.user_name like concat ('%', #{userName}, '%')
</if>
<if test="userId != 0">
and t.user_id = #{userId}
</if>
<where>
<if test="userName != null and userName != ''">
u.user_name like concat ('%', #{userName}, '%')
</if>
<if test="userId != 0">
and t.user_id = #{userId}
</if>
</where>
order by t.update_time desc
</select>
</mapper>
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@
select
<include refid="baseSql"/>
from t_ds_alertgroup
where 1 = 1
<if test="groupName != null and groupName != ''">
and group_name like concat('%', #{groupName}, '%')
</if>
<where>
<if test="groupName != null and groupName != ''">
group_name like concat('%', #{groupName}, '%')
</if>
</where>
order by update_time desc
</select>
<select id="queryByGroupName" resultType="org.apache.dolphinscheduler.dao.entity.AlertGroup">
Expand Down Expand Up @@ -63,4 +64,4 @@
select alert_instance_ids from t_ds_alertgroup
where id = #{alertGroupId}
</select>
</mapper>
</mapper>
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,22 @@
u.user_name as user_name
from t_ds_datasource d
join t_ds_user u on d.user_id = u.id
where 1 =1
<if test="userId != 0">
and d.id in
(select datasource_id
from t_ds_relation_datasource_user
where user_id=#{userId}
union select id as datasource_id
from t_ds_datasource
where user_id=#{userId}
)
</if>
<if test="name != null and name != ''">
and name like concat ('%', #{name}, '%')
</if>
<where>
<if test="userId != 0">
d.id in
(select datasource_id
from t_ds_relation_datasource_user
where user_id=#{userId}
union select id as datasource_id
from t_ds_datasource
where user_id=#{userId}
)
</if>
<if test="name != null and name != ''">
and name like concat ('%', #{name}, '%')
</if>
</where>

order by update_time desc
</select>
<select id="queryDataSourceByName" resultType="org.apache.dolphinscheduler.dao.entity.DataSource">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@
select
<include refid="baseSql"/>
from t_ds_process_instance
where 1=1
<if test="host != null and host != ''">
and host=#{host}
</if>
and state in
<foreach collection="states" item="i" open="(" close=")" separator=",">
#{i}
</foreach>
<where>
<if test="host != null and host != ''">
host=#{host}
</if>
and state in
<foreach collection="states" item="i" open="(" close=")" separator=",">
#{i}
</foreach>
</where>
order by id asc
</select>

Expand Down Expand Up @@ -149,8 +150,7 @@
from t_ds_process_instance t
join t_ds_process_definition d on d.id=t.process_definition_id
join t_ds_project p on p.id=d.project_id
where 1 = 1
and t.is_sub_process = 0
where t.is_sub_process = 0
<if test="startTime != null and endTime != null">
and t.start_time <![CDATA[ >= ]]> #{startTime} and t.start_time <![CDATA[ <= ]]> #{endTime}
</if>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,17 @@
inst.process_definition_id AND def.project_id = p.id AND inst.state=1 ) as inst_running_count
from t_ds_project p
join t_ds_user u on u.id=p.user_id
where 1=1
<if test="userId != 0">
and p.id in
(select project_id from t_ds_relation_project_user where user_id=#{userId}
union select id as project_id from t_ds_project where user_id=#{userId}
)
</if>
<if test="searchName!=null and searchName != ''">
and p.name like concat('%', #{searchName}, '%')
</if>
<where>
<if test="userId != 0">
p.id in
(select project_id from t_ds_relation_project_user where user_id=#{userId}
union select id as project_id from t_ds_project where user_id=#{userId}
)
</if>
<if test="searchName!=null and searchName != ''">
and p.name like concat('%', #{searchName}, '%')
</if>
</where>
order by p.create_time desc
</select>
<select id="queryAuthedProjectListByUserId" resultType="org.apache.dolphinscheduler.dao.entity.Project">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
</sql>
<delete id="deleteProjectRelation">
delete from t_ds_relation_project_user
where 1=1
and user_id = #{userId}
where user_id = #{userId}
<if test="projectId != 0 ">
and project_id = #{projectId}
</if>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,25 @@
select
<include refid="baseSql"/>
from t_ds_queue
where 1= 1
<if test="searchVal != null and searchVal != ''">
and queue_name like concat('%', #{searchVal}, '%')
</if>
<where>
<if test="searchVal != null and searchVal != ''">
queue_name like concat('%', #{searchVal}, '%')
</if>
</where>
order by update_time desc
</select>
<select id="queryAllQueueList" resultType="org.apache.dolphinscheduler.dao.entity.Queue">
select
<include refid="baseSql"/>
from t_ds_queue
where 1=1
<if test="queue != null and queue != ''">
and queue = #{queue}
</if>
<if test="queueName != null and queueName != ''">
and queue_name =#{queueName}
</if>
<where>
<if test="queue != null and queue != ''">
queue = #{queue}
</if>
<if test="queueName != null and queueName != ''">
and queue_name =#{queueName}
</if>
</where>
</select>

</mapper>
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,35 @@
select
<include refid="baseSql"/>
from t_ds_resources
where 1= 1
<if test="fullName != null and fullName != ''">
and full_name = #{fullName}
</if>
<if test="type != -1">
and type = #{type}
</if>
<if test="userId != 0">
and user_id = #{userId}
</if>
<where>
<if test="fullName != null and fullName != ''">
full_name = #{fullName}
</if>
<if test="type != -1">
and type = #{type}
</if>
<if test="userId != 0">
and user_id = #{userId}
</if>
</where>
</select>
<select id="queryResourceListAuthored" resultType="org.apache.dolphinscheduler.dao.entity.Resource">
select
<include refid="baseSql"/>
from t_ds_resources
where 1 = 1
<if test="type != -1">
and type=#{type}
</if>
<if test="userId != 0 and perm != 0">
and id in (select resources_id from t_ds_relation_resources_user where user_id=#{userId} and perm=#{perm}
union select id as resources_id from t_ds_resources where user_id=#{userId})
</if>
<if test="userId != 0 and perm == 0">
and id in (select resources_id from t_ds_relation_resources_user where user_id=#{userId}
union select id as resources_id from t_ds_resources where user_id=#{userId})
</if>
<where>
<if test="type != -1">
type=#{type}
</if>
<if test="userId != 0 and perm != 0">
and id in (select resources_id from t_ds_relation_resources_user where user_id=#{userId} and perm=#{perm}
union select id as resources_id from t_ds_resources where user_id=#{userId})
</if>
<if test="userId != 0 and perm == 0">
and id in (select resources_id from t_ds_relation_resources_user where user_id=#{userId}
union select id as resources_id from t_ds_resources where user_id=#{userId})
</if>
</where>
</select>
<select id="queryResourcePaging" resultType="org.apache.dolphinscheduler.dao.entity.Resource">
select
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,27 @@
<delete id="deleteResourceUser">
delete
from t_ds_relation_resources_user
where 1 = 1
<if test="userId != 0">
and user_id = #{userId}
</if>
<if test="resourceId != 0">
and resources_id = #{resourceId}
</if>
<where>
<if test="userId != 0">
user_id = #{userId}
</if>
<if test="resourceId != 0">
and resources_id = #{resourceId}
</if>
</where>
</delete>

<delete id="deleteResourceUserArray" parameterType="java.lang.Integer">
delete
from t_ds_relation_resources_user
where 1 = 1
<if test="userId != 0">
and user_id = #{userId}
</if>
and resources_id in
<foreach collection="resIds" item="i" open="(" close=")" separator=",">
#{i}
</foreach>
<where>
<if test="userId != 0">
user_id = #{userId}
</if>
and resources_id in
<foreach collection="resIds" item="i" open="(" close=")" separator=",">
#{i}
</foreach>
</where>
</delete>
</mapper>
</mapper>
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@
join t_ds_process_definition p_f on s.process_definition_id = p_f.id
join t_ds_project as p on p_f.project_id = p.id
join t_ds_user as u on s.user_id = u.id
where 1=1
<if test="processDefinitionId!= 0">
and s.process_definition_id = #{processDefinitionId}
</if>
<where>
<if test="processDefinitionId!= 0">
s.process_definition_id = #{processDefinitionId}
</if>
</where>
order by s.update_time desc
</select>
<select id="querySchedulerListByProjectName" resultType="org.apache.dolphinscheduler.dao.entity.Schedule">
Expand All @@ -53,14 +54,13 @@
select
<include refid="baseSql"/>
from t_ds_schedules
where 1= 1
where release_state = 1
<if test="processDefineIds != null and processDefineIds.length != 0 ">
and process_definition_id in
<foreach collection="processDefineIds" index="index" item="i" open="(" separator="," close=")">
#{i}
</foreach>
</if>
and release_state = 1
</select>
<select id="queryByProcessDefinitionId" resultType="org.apache.dolphinscheduler.dao.entity.Schedule">
select
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,17 @@
from t_ds_task_instance t
left join t_ds_process_definition d on d.id=t.process_definition_id
left join t_ds_project p on p.id=d.project_id
where 1=1
<if test="projectIds != null and projectIds.length != 0">
and d.project_id in
<foreach collection="projectIds" index="index" item="i" open="(" separator="," close=")">
#{i}
</foreach>
</if>
<if test="startTime != null and endTime != null">
and t.start_time > #{startTime} and t.start_time <![CDATA[ <= ]]> #{endTime}
</if>
<where>
<if test="projectIds != null and projectIds.length != 0">
d.project_id in
<foreach collection="projectIds" index="index" item="i" open="(" separator="," close=")">
#{i}
</foreach>
</if>
<if test="startTime != null and endTime != null">
and t.start_time > #{startTime} and t.start_time <![CDATA[ <= ]]> #{endTime}
</if>
</where>
group by t.state
</select>
<select id="queryByInstanceIdAndName" resultType="org.apache.dolphinscheduler.dao.entity.TaskInstance">
Expand Down
Loading