khadgarmage
5 years ago
committed by
qiaozhanwei
60 changed files with 1171 additions and 103 deletions
@ -0,0 +1,11 @@
|
||||
## Build Image |
||||
``` |
||||
cd .. |
||||
docker build -t dolphinscheduler --build-arg version=1.1.0 --build-arg tar_version=1.1.0-SNAPSHOT -f dockerfile/Dockerfile . |
||||
docker run -p 12345:12345 -p 8888:8888 --rm --name dolphinscheduler -d dolphinscheduler |
||||
``` |
||||
* Visit the url: http://127.0.0.1:8888 |
||||
* UserName:admin Password:dolphinscheduler123 |
||||
|
||||
## Note |
||||
* MacOS: The memory of docker needs to be set to 4G, default 2G. Steps: Preferences -> Advanced -> adjust resources -> Apply & Restart |
@ -0,0 +1,91 @@
|
||||
# mysql |
||||
spring: |
||||
|
||||
datasource: |
||||
url: jdbc:mysql://127.0.0.1:3306/dolphinscheduler?useUnicode=true&characterEncoding=UTF-8 |
||||
username: root |
||||
password: root@123 |
||||
# |
||||
type: com.alibaba.druid.pool.DruidDataSource |
||||
driver-class-name: com.mysql.jdbc.Driver |
||||
initialSize: 5 |
||||
minIdle: 5 |
||||
maxActive: 20 |
||||
maxWait: 60000 |
||||
timeBetweenEvictionRunsMillis: 60000 |
||||
minEvictableIdleTimeMillis: 300000 |
||||
validationQuery: SELECT 1 FROM DUAL |
||||
testWhileIdle: true |
||||
testOnBorrow: false |
||||
testOnReturn: false |
||||
poolPreparedStatements: true |
||||
maxPoolPreparedStatementPerConnectionSize: 20 |
||||
spring.datasource.filters: stat,wall,log4j |
||||
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 |
||||
|
||||
# jpa: |
||||
# hibernate: |
||||
# ddl-auto : update |
||||
# datasource: |
||||
# platform: |
||||
# continue-on-error: true |
||||
# druid: |
||||
# driver-class-name: org.postgresql.Driver |
||||
# url: jdbc:postgresql://192.168.220.154:5432/escheduler |
||||
|
||||
|
||||
|
||||
#mybatis |
||||
mybatis-plus: |
||||
mapper-locations: classpath*:/org.apache.dolphinscheduler.dao.mapper/*.xml |
||||
typeEnumsPackage: org.apache.dolphinscheduler.*.enums |
||||
#实体扫描,多个package用逗号或者分号分隔 |
||||
typeAliasesPackage: org.apache.dolphinscheduler.dao.entity |
||||
global-config: |
||||
#数据库相关配置 |
||||
db-config: |
||||
#主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; |
||||
id-type: AUTO |
||||
#字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" |
||||
field-strategy: NOT_NULL |
||||
#驼峰下划线转换 |
||||
column-underline: true |
||||
logic-delete-value: -1 |
||||
logic-not-delete-value: 0 |
||||
banner: false |
||||
#原生配置 |
||||
configuration: |
||||
map-underscore-to-camel-case: true |
||||
cache-enabled: false |
||||
call-setters-on-nulls: true |
||||
jdbc-type-for-null: 'null' |
||||
|
||||
|
||||
# Logger Config |
||||
logging: |
||||
level: |
||||
org.apache.dolphinscheduler.dao: debug |
||||
|
||||
--- |
||||
# master settings |
||||
spring: |
||||
profiles: master |
||||
|
||||
server: |
||||
port: 5566 |
||||
|
||||
--- |
||||
# worker settings |
||||
spring: |
||||
profiles: worker |
||||
|
||||
server: |
||||
port: 7788 |
||||
|
||||
--- |
||||
# alert settings |
||||
spring: |
||||
profiles: alert |
||||
|
||||
server: |
||||
port: 7789 |
@ -0,0 +1,5 @@
|
||||
logging.config=classpath:alert_logback.xml |
||||
|
||||
# server port |
||||
server.port=7789 |
||||
|
@ -1 +1,4 @@
|
||||
logging.config=classpath:master_logback.xml |
||||
|
||||
# server port |
||||
server.port=5566 |
@ -0,0 +1,4 @@
|
||||
logging.config=classpath:worker_logback.xml |
||||
|
||||
# server port |
||||
server.port=7788 |
@ -1,5 +1,5 @@
|
||||
# ha or single namenode,If namenode ha needs to copy core-site.xml and hdfs-site.xml |
||||
# to the conf directory,support s3,for example : s3a://escheduler |
||||
# to the conf directory,support s3,for example : s3a://dolphinscheduler |
||||
fs.defaultFS=hdfs://mycluster:8020 |
||||
|
||||
# s3 need,s3 endpoint |
@ -0,0 +1,3 @@
|
||||
installPath=/data1_1T/dolphinscheduler |
||||
deployUser=dolphinscheduler |
||||
ips=ark0,ark1,ark2,ark3,ark4 |
@ -0,0 +1,3 @@
|
||||
export PYTHON_HOME=/usr/bin/python |
||||
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 |
||||
export PATH=$PYTHON_HOME:$JAVA_HOME/bin:$PATH |
@ -0,0 +1 @@
|
||||
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'><html><head><title> dolphinscheduler</title><meta name='Keywords' content=''><meta name='Description' content=''><style type="text/css">table { margin-top:0px; padding-top:0px; border:1px solid; font-size: 14px; color: #333333; border-width: 1px; border-color: #666666; border-collapse: collapse; } table th { border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #dedede; } table td { border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #ffffff; }</style></head><body style="margin:0;padding:0"><table border="1px" cellpadding="5px" cellspacing="-10px"><thead><#if title??> ${title}</#if></thead><#if content??> ${content}</#if></table></body></html> |
@ -0,0 +1,16 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.AccessTokenMapper"> |
||||
<select id="selectAccessTokenPage" resultType="org.apache.dolphinscheduler.dao.entity.AccessToken"> |
||||
select * 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> |
||||
order by t.update_time desc |
||||
</select> |
||||
</mapper> |
@ -0,0 +1,30 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.AlertGroupMapper"> |
||||
<select id="queryAlertGroupPage" resultType="org.apache.dolphinscheduler.dao.entity.AlertGroup"> |
||||
select * from t_ds_alertgroup |
||||
where 1 = 1 |
||||
<if test="groupName != null and groupName != ''"> |
||||
and group_name like concat('%', #{groupName}, '%') |
||||
</if> |
||||
order by update_time desc |
||||
</select> |
||||
<select id="queryByGroupName" resultType="org.apache.dolphinscheduler.dao.entity.AlertGroup"> |
||||
select * from t_ds_alertgroup |
||||
where group_name=#{groupName} |
||||
</select> |
||||
<select id="queryByUserId" resultType="org.apache.dolphinscheduler.dao.entity.AlertGroup"> |
||||
select * from t_ds_alertgroup t |
||||
left join t_ds_relation_user_alertgroup r on t.id=r.alertgroup_id |
||||
where r.user_id=#{userId} |
||||
</select> |
||||
<select id="queryByAlertType" resultType="org.apache.dolphinscheduler.dao.entity.AlertGroup"> |
||||
select * from t_ds_alertgroup |
||||
where group_type=#{alertType} |
||||
</select> |
||||
<select id="queryAllGroupList" resultType="org.apache.dolphinscheduler.dao.entity.AlertGroup"> |
||||
select * |
||||
from t_ds_alertgroup |
||||
order by update_time desc |
||||
</select> |
||||
</mapper> |
@ -0,0 +1,9 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.AlertMapper"> |
||||
<select id="listAlertByStatus" resultType="org.apache.dolphinscheduler.dao.entity.Alert"> |
||||
select * |
||||
from t_ds_alert |
||||
where alert_status = #{alertStatus} |
||||
</select> |
||||
</mapper> |
@ -0,0 +1,26 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.CommandMapper"> |
||||
<select id="getOneToRun" resultType="org.apache.dolphinscheduler.dao.entity.Command"> |
||||
select command.* from t_ds_command command |
||||
join t_ds_process_definition definition on command.process_definition_id = definition.id |
||||
where definition.release_state = 1 AND definition.flag = 1 |
||||
order by command.update_time asc |
||||
limit 1 |
||||
</select> |
||||
<select id="countCommandState" resultType="org.apache.dolphinscheduler.dao.entity.CommandCount"> |
||||
select cmd.command_type as state, count(1) as count |
||||
from t_ds_command cmd, t_ds_process_definition process |
||||
where cmd.process_definition_id = process.id |
||||
<if test="projectIdArray != null and projectIdArray.length != 0"> |
||||
and process.project_id in |
||||
<foreach collection="projectIdArray" index="index" item="i" open="(" close=")" separator=","> |
||||
#{i} |
||||
</foreach> |
||||
</if> |
||||
<if test="startTime != null and endTime != null"> |
||||
and cmd.start_time <![CDATA[ >= ]]> #{startTime} and cmd.update_time <![CDATA[ <= ]]> #{endTime} |
||||
</if> |
||||
group by cmd.command_type |
||||
</select> |
||||
</mapper> |
@ -0,0 +1,62 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.DataSourceMapper"> |
||||
<select id="queryDataSourceByType" resultType="org.apache.dolphinscheduler.dao.entity.DataSource"> |
||||
select * |
||||
from t_ds_datasource |
||||
where type=#{type} |
||||
<if test="userId != 0"> |
||||
and 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> |
||||
|
||||
</select> |
||||
|
||||
<select id="selectPaging" resultType="org.apache.dolphinscheduler.dao.entity.DataSource"> |
||||
select * |
||||
from t_ds_datasource |
||||
where 1 =1 |
||||
<if test="userId != 0"> |
||||
and 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> |
||||
order by update_time desc |
||||
</select> |
||||
<select id="queryDataSourceByName" resultType="org.apache.dolphinscheduler.dao.entity.DataSource"> |
||||
select * |
||||
from t_ds_datasource |
||||
where name=#{name} |
||||
</select> |
||||
<select id="queryAuthedDatasource" resultType="org.apache.dolphinscheduler.dao.entity.DataSource"> |
||||
select datasource.* |
||||
from t_ds_datasource datasource, t_ds_relation_datasource_user rel |
||||
where datasource.id = rel.datasource_id AND rel.user_id = #{userId} |
||||
</select> |
||||
<select id="queryDatasourceExceptUserId" resultType="org.apache.dolphinscheduler.dao.entity.DataSource"> |
||||
select * |
||||
from t_ds_datasource |
||||
where user_id <![CDATA[ <> ]]> #{userId} |
||||
</select> |
||||
<select id="listAllDataSourceByType" resultType="org.apache.dolphinscheduler.dao.entity.DataSource"> |
||||
select * |
||||
from t_ds_datasource |
||||
where type = #{type} |
||||
</select> |
||||
|
||||
|
||||
</mapper> |
@ -0,0 +1,13 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.DataSourceUserMapper"> |
||||
<delete id="deleteByUserId"> |
||||
delete from t_ds_relation_datasource_user |
||||
where user_id = #{userId} |
||||
|
||||
</delete> |
||||
<delete id="deleteByDatasourceId"> |
||||
delete from t_ds_relation_datasource_user |
||||
where datasource_id = #{datasourceId} |
||||
</delete> |
||||
</mapper> |
@ -0,0 +1,19 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.ErrorCommandMapper"> |
||||
<select id="countCommandState" resultType="org.apache.dolphinscheduler.dao.entity.CommandCount"> |
||||
select cmd.command_type as commandType, count(1) as count |
||||
from t_ds_error_command cmd, t_ds_process_definition process |
||||
where cmd.process_definition_id = process.id |
||||
<if test="projectIdArray != null and projectIdArray.length != 0"> |
||||
and process.project_id in |
||||
<foreach collection="projectIdArray" index="index" item="i" open="(" close=")" separator=","> |
||||
#{i} |
||||
</foreach> |
||||
</if> |
||||
<if test="startTime != null and endTime != null"> |
||||
and cmd.startTime <![CDATA[ >= ]]> #{startTime} and cmd.update_time <![CDATA[ <= ]]> #{endTime} |
||||
</if> |
||||
group by cmd.command_type |
||||
</select> |
||||
</mapper> |
@ -0,0 +1,56 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper"> |
||||
<select id="queryByDefineName" resultType="org.apache.dolphinscheduler.dao.entity.ProcessDefinition"> |
||||
select pd.*,u.user_name,p.name as project_name,t.tenant_code,t.tenant_name,q.queue,q.queue_name |
||||
from t_ds_process_definition pd |
||||
JOIN t_ds_user u ON pd.user_id = u.id |
||||
JOIN t_ds_project p ON pd.project_id = p.id |
||||
JOIN t_ds_tenant t ON t.id = u.tenant_id |
||||
JOIN t_ds_queue q ON t.queue_id = q.id |
||||
WHERE p.id = #{projectId} |
||||
and pd.name = #{processDefinitionName} |
||||
</select> |
||||
<select id="queryDefineListPaging" resultType="org.apache.dolphinscheduler.dao.entity.ProcessDefinition"> |
||||
SELECT td.*,sc.schedule_release_state |
||||
FROM t_ds_process_definition td |
||||
left join (select process_definition_id,release_state as schedule_release_state from t_ds_schedules group by process_definition_id,release_state) sc on sc.process_definition_id = td.id |
||||
where td.project_id = #{projectId} |
||||
<if test=" searchVal != null and searchVal != ''"> |
||||
and td.name like concat('%', #{searchVal}, '%') |
||||
</if> |
||||
<if test=" userId != 0"> |
||||
and td.user_id = #{userId} |
||||
</if> |
||||
order by sc.schedule_release_state desc,td.update_time desc |
||||
</select> |
||||
<select id="queryAllDefinitionList" resultType="org.apache.dolphinscheduler.dao.entity.ProcessDefinition"> |
||||
select * |
||||
from t_ds_process_definition |
||||
where project_id = #{projectId} |
||||
order by create_time desc |
||||
</select> |
||||
<select id="queryDefinitionListByIdList" resultType="org.apache.dolphinscheduler.dao.entity.ProcessDefinition"> |
||||
select * |
||||
from t_ds_process_definition |
||||
where id in |
||||
<foreach collection="ids" index="index" item="i" open="(" separator="," close=")"> |
||||
#{i} |
||||
</foreach> |
||||
</select> |
||||
<select id="countDefinitionGroupByUser" resultType="org.apache.dolphinscheduler.dao.entity.DefinitionGroupByUser"> |
||||
SELECT td.user_id as user_id, tu.user_name as user_name, count(0) as count |
||||
FROM t_ds_process_definition td |
||||
JOIN t_ds_user tu on tu.id=td.user_id |
||||
where 1 = 1 |
||||
<if test="projectIds != null and projectIds.length != 0"> |
||||
and td.project_id in |
||||
<foreach collection="projectIds" index="index" item="i" open="(" separator="," close=")"> |
||||
#{i} |
||||
</foreach> |
||||
</if> |
||||
group by td.user_id,tu.user_name |
||||
</select> |
||||
|
||||
|
||||
</mapper> |
@ -0,0 +1,26 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapMapper"> |
||||
<delete id="deleteByParentProcessId"> |
||||
delete |
||||
from t_ds_relation_process_instance |
||||
where parent_process_instance_id=#{parentProcessId} |
||||
|
||||
</delete> |
||||
<select id="queryByParentId" resultType="org.apache.dolphinscheduler.dao.entity.ProcessInstanceMap"> |
||||
select * |
||||
from t_ds_relation_process_instance |
||||
where parent_process_instance_id = #{parentProcessId} |
||||
and parent_task_instance_id = #{parentTaskId} |
||||
</select> |
||||
<select id="queryBySubProcessId" resultType="org.apache.dolphinscheduler.dao.entity.ProcessInstanceMap"> |
||||
select * |
||||
from t_ds_relation_process_instance |
||||
where process_instance_id = #{subProcessId} |
||||
</select> |
||||
<select id="querySubIdListByParentId" resultType="java.lang.Integer"> |
||||
select process_instance_id |
||||
from t_ds_relation_process_instance |
||||
where parent_process_instance_id = #{parentInstanceId} |
||||
</select> |
||||
</mapper> |
@ -0,0 +1,123 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.ProcessInstanceMapper"> |
||||
<select id="queryDetailById" resultType="org.apache.dolphinscheduler.dao.entity.ProcessInstance"> |
||||
select inst.* |
||||
from t_ds_process_instance inst |
||||
where inst.id = #{processId} |
||||
</select> |
||||
<select id="queryByHostAndStatus" resultType="org.apache.dolphinscheduler.dao.entity.ProcessInstance"> |
||||
select * |
||||
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> |
||||
order by id asc |
||||
</select> |
||||
<select id="queryProcessInstanceListPaging" resultType="org.apache.dolphinscheduler.dao.entity.ProcessInstance"> |
||||
select instance.* |
||||
from t_ds_process_instance instance |
||||
join t_ds_process_definition define ON instance.process_definition_id = define.id |
||||
where 1=1 |
||||
and instance.is_sub_process=0 |
||||
and define.project_id = #{projectId} |
||||
<if test="processDefinitionId != 0"> |
||||
and instance.process_definition_id = #{processDefinitionId} |
||||
</if> |
||||
<if test="searchVal != null and searchVal != ''"> |
||||
and instance.name like concat('%', #{searchVal}, '%') |
||||
</if> |
||||
<if test="startTime != null "> |
||||
and instance.start_time > #{startTime} and instance.start_time <![CDATA[ <=]]> #{endTime} |
||||
</if> |
||||
<if test="states != null and states != ''"> |
||||
and instance.state in |
||||
<foreach collection="states" index="index" item="i" open="(" separator="," close=")"> |
||||
#{i} |
||||
</foreach> |
||||
</if> |
||||
<if test="host != null and host != ''"> |
||||
and instance.host like concat('%', #{host}, '%') |
||||
</if> |
||||
order by instance.start_time desc |
||||
</select> |
||||
<update id="setFailoverByHostAndStateArray"> |
||||
update t_ds_process_instance |
||||
set host=null |
||||
where host =#{host} and state in |
||||
<foreach collection="states" index="index" item="i" open="(" close=")" separator=","> |
||||
#{i} |
||||
</foreach> |
||||
</update> |
||||
<update id="updateProcessInstanceByState"> |
||||
update t_ds_process_instance |
||||
set state = #{destState} |
||||
where state = #{originState} |
||||
</update> |
||||
<select id="countInstanceStateByUser" resultType="org.apache.dolphinscheduler.dao.entity.ExecuteStatusCount"> |
||||
select t.state, count(0) as count |
||||
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 |
||||
<if test="startTime != null and endTime != null"> |
||||
and t.start_time >= #{startTime} and t.start_time <![CDATA[ <= ]]> #{endTime} |
||||
</if> |
||||
<if test="projectIds != null and projectIds.length != 0"> |
||||
and p.id in |
||||
<foreach collection="projectIds" index="index" item="i" open="(" close=")" separator=","> |
||||
#{i} |
||||
</foreach> |
||||
</if> |
||||
group by t.state |
||||
</select> |
||||
<select id="queryByProcessDefineId" resultType="org.apache.dolphinscheduler.dao.entity.ProcessInstance"> |
||||
select * |
||||
from t_ds_process_instance |
||||
where process_definition_id=#{processDefinitionId} |
||||
order by start_time desc limit #{size} |
||||
</select> |
||||
<select id="queryLastSchedulerProcess" resultType="org.apache.dolphinscheduler.dao.entity.ProcessInstance"> |
||||
select * |
||||
from t_ds_process_instance |
||||
where process_definition_id=#{processDefinitionId} |
||||
<if test="startTime!=null and endTime != null "> |
||||
and schedule_time between #{startTime} and #{endTime} |
||||
</if> |
||||
order by end_time desc limit 1 |
||||
</select> |
||||
<select id="queryLastRunningProcess" resultType="org.apache.dolphinscheduler.dao.entity.ProcessInstance"> |
||||
select * |
||||
from t_ds_process_instance |
||||
where 1=1 |
||||
<if test="states !=null and states.length != 0"> |
||||
and state in |
||||
<foreach collection="states" item="i" index="index" open="(" separator="," close=")"> |
||||
#{i} |
||||
</foreach> |
||||
</if> |
||||
<if test="startTime!=null and endTime != null "> |
||||
and process_definition_id=#{processDefinitionId} |
||||
and (schedule_time between #{startTime} and #{endTime} or start_time between #{startTime} and #{endTime}) |
||||
</if> |
||||
order by start_time desc limit 1 |
||||
</select> |
||||
<select id="queryLastManualProcess" resultType="org.apache.dolphinscheduler.dao.entity.ProcessInstance"> |
||||
select * |
||||
from t_ds_process_instance |
||||
where process_definition_id=#{processDefinitionId} |
||||
and schedule_time is null |
||||
<if test="startTime!=null and endTime != null "> |
||||
and start_time between #{startTime} and #{endTime} |
||||
</if> |
||||
order by end_time desc limit 1 |
||||
</select> |
||||
|
||||
|
||||
</mapper> |
@ -0,0 +1,51 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.ProjectMapper"> |
||||
<select id="queryDetailById" resultType="org.apache.dolphinscheduler.dao.entity.Project"> |
||||
select p.*,u.user_name as user_name |
||||
from t_ds_project p |
||||
join t_ds_user u on p.user_id = u.id |
||||
where p.id = #{projectId} |
||||
</select> |
||||
<select id="queryByName" resultType="org.apache.dolphinscheduler.dao.entity.Project"> |
||||
select p.*,u.user_name as user_name |
||||
from t_ds_project p |
||||
join t_ds_user u on p.user_id = u.id |
||||
where p.name = #{projectName} |
||||
limit 1 |
||||
</select> |
||||
<select id="queryProjectListPaging" resultType="org.apache.dolphinscheduler.dao.entity.Project"> |
||||
select p.*,u.user_name as user_name, |
||||
(SELECT COUNT(*) FROM t_ds_process_definition AS def WHERE def.project_id = p.id) AS def_count, |
||||
(SELECT COUNT(*) FROM t_ds_process_definition def, t_ds_process_instance inst WHERE def.id = 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> |
||||
order by p.create_time desc |
||||
</select> |
||||
<select id="queryAuthedProjectListByUserId" resultType="org.apache.dolphinscheduler.dao.entity.Project"> |
||||
select p.* |
||||
from t_ds_project p,t_ds_relation_project_user rel |
||||
where p.id = rel.project_id and rel.user_id= #{userId} |
||||
</select> |
||||
<select id="queryProjectExceptUserId" resultType="org.apache.dolphinscheduler.dao.entity.Project"> |
||||
select * |
||||
from t_ds_project |
||||
where user_id <![CDATA[ <> ]]> #{userId} |
||||
</select> |
||||
<select id="queryProjectCreatedByUser" resultType="org.apache.dolphinscheduler.dao.entity.Project"> |
||||
select * |
||||
from t_ds_project |
||||
where user_id = #{userId} |
||||
</select> |
||||
|
||||
</mapper> |
@ -0,0 +1,19 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.ProjectUserMapper"> |
||||
<delete id="deleteProjectRelation"> |
||||
delete from t_ds_relation_project_user |
||||
where 1=1 |
||||
and user_id = #{userId} |
||||
<if test="projectId != 0 "> |
||||
and project_id = #{projectId} |
||||
</if> |
||||
</delete> |
||||
<select id="queryProjectRelation" resultType="org.apache.dolphinscheduler.dao.entity.ProjectUser"> |
||||
select * |
||||
from t_ds_relation_project_user |
||||
where project_id = #{projectId} |
||||
and user_id = #{userId} |
||||
limit 1 |
||||
</select> |
||||
</mapper> |
@ -0,0 +1,25 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.QueueMapper"> |
||||
<select id="queryQueuePaging" resultType="org.apache.dolphinscheduler.dao.entity.Queue"> |
||||
select * |
||||
from t_ds_queue |
||||
where 1= 1 |
||||
<if test="searchVal != null and searchVal != ''"> |
||||
and queue_name like concat('%', #{searchVal}, '%') |
||||
</if> |
||||
order by update_time desc |
||||
</select> |
||||
<select id="queryAllQueueList" resultType="org.apache.dolphinscheduler.dao.entity.Queue"> |
||||
select * |
||||
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> |
||||
</select> |
||||
|
||||
</mapper> |
@ -0,0 +1,57 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.ResourceMapper"> |
||||
<select id="queryResourceList" resultType="org.apache.dolphinscheduler.dao.entity.Resource"> |
||||
select * |
||||
from t_ds_resources |
||||
where 1= 1 |
||||
<if test="alias != null and alias != ''"> |
||||
and alias = #{alias} |
||||
</if> |
||||
<if test="type != -1"> |
||||
and type = #{type} |
||||
</if> |
||||
<if test="userId != 0"> |
||||
and user_id = #{userId} |
||||
</if> |
||||
</select> |
||||
<select id="queryResourceListAuthored" resultType="org.apache.dolphinscheduler.dao.entity.Resource"> |
||||
select * |
||||
from t_ds_resources |
||||
where 1 = 1 |
||||
<if test="type != -1"> |
||||
and type=#{type} |
||||
</if> |
||||
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}) |
||||
</select> |
||||
<select id="queryResourcePaging" resultType="org.apache.dolphinscheduler.dao.entity.Resource"> |
||||
select * |
||||
from t_ds_resources |
||||
where type=#{type} |
||||
<if test="userId != 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> |
||||
<if test="searchVal != null and searchVal != ''"> |
||||
and alias like concat('%', #{searchVal}, '%') |
||||
</if> |
||||
order by update_time desc |
||||
</select> |
||||
<select id="queryAuthorizedResourceList" resultType="org.apache.dolphinscheduler.dao.entity.Resource"> |
||||
select r.* |
||||
from t_ds_resources r,t_ds_relation_resources_user rel |
||||
where r.id = rel.resources_id AND rel.user_id = #{userId} |
||||
</select> |
||||
<select id="queryResourceExceptUserId" resultType="org.apache.dolphinscheduler.dao.entity.Resource"> |
||||
select * |
||||
from t_ds_resources |
||||
where user_id <![CDATA[ <> ]]> #{userId} |
||||
</select> |
||||
<select id="queryTenantCodeByResourceName" resultType="java.lang.String"> |
||||
select tenant_code |
||||
from t_ds_tenant t, t_ds_user u, t_ds_resources res |
||||
where t.id = u.tenant_id and u.id = res.user_id and res.type=0 |
||||
and res.alias= #{resName} |
||||
</select> |
||||
</mapper> |
@ -0,0 +1,15 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.ResourceUserMapper"> |
||||
<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> |
||||
</delete> |
||||
</mapper> |
@ -0,0 +1,41 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.ScheduleMapper"> |
||||
<select id="queryByProcessDefineIdPaging" resultType="org.apache.dolphinscheduler.dao.entity.Schedule"> |
||||
select p_f.name as process_definition_name, p.name as project_name,u.user_name,s.* |
||||
from t_ds_schedules s |
||||
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> |
||||
order by s.update_time desc |
||||
</select> |
||||
<select id="querySchedulerListByProjectName" resultType="org.apache.dolphinscheduler.dao.entity.Schedule"> |
||||
select p_f.name as process_definition_name, p_f.description as definition_description, p.name as project_name,u.user_name,s.* |
||||
from t_ds_schedules s |
||||
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 p.name = #{projectName} |
||||
</select> |
||||
<select id="selectAllByProcessDefineArray" resultType="org.apache.dolphinscheduler.dao.entity.Schedule"> |
||||
select * |
||||
from t_ds_schedules |
||||
where 1= 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 * |
||||
from t_ds_schedules |
||||
where process_definition_id =#{processDefinitionId} |
||||
</select> |
||||
</mapper> |
@ -0,0 +1,9 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.SessionMapper"> |
||||
<select id="queryByUserId" resultType="org.apache.dolphinscheduler.dao.entity.Session"> |
||||
select * |
||||
from t_ds_session |
||||
where user_id = #{userId} |
||||
</select> |
||||
</mapper> |
@ -0,0 +1,113 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.TaskInstanceMapper"> |
||||
<update id="setFailoverByHostAndStateArray"> |
||||
update t_ds_task_instance |
||||
set state = #{destStatus} |
||||
where host = #{host} |
||||
and state in |
||||
<foreach collection="states" index="index" item="i" open="(" separator="," close=")"> |
||||
#{i} |
||||
</foreach> |
||||
</update> |
||||
<select id="queryTaskByProcessIdAndState" resultType="java.lang.Integer"> |
||||
select id |
||||
from t_ds_task_instance |
||||
WHERE process_instance_id = #{processInstanceId} |
||||
and state = #{state} |
||||
and flag = 1 |
||||
</select> |
||||
<select id="findValidTaskListByProcessId" resultType="org.apache.dolphinscheduler.dao.entity.TaskInstance"> |
||||
select * |
||||
from t_ds_task_instance |
||||
WHERE process_instance_id = #{processInstanceId} |
||||
and flag = #{flag} |
||||
order by start_time desc |
||||
</select> |
||||
<select id="queryByHostAndStatus" resultType="org.apache.dolphinscheduler.dao.entity.TaskInstance"> |
||||
select * |
||||
from t_ds_task_instance |
||||
where 1 = 1 |
||||
<if test="host != null and host != ''"> |
||||
and host = #{host} |
||||
</if> |
||||
<if test="states != null and states.length != 0"> |
||||
and state in |
||||
<foreach collection="states" index="index" item="i" open="(" separator="," close=")"> |
||||
#{i} |
||||
</foreach> |
||||
</if> |
||||
</select> |
||||
<select id="countTaskInstanceStateByUser" resultType="org.apache.dolphinscheduler.dao.entity.ExecuteStatusCount"> |
||||
select state, count(0) as count |
||||
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> |
||||
and t.flag = 1 |
||||
<if test="startTime != null and endTime != null"> |
||||
and t.start_time > #{startTime} and t.start_time <![CDATA[ <= ]]> #{endTime} |
||||
</if> |
||||
group by t.state |
||||
</select> |
||||
<select id="queryByInstanceIdAndName" resultType="org.apache.dolphinscheduler.dao.entity.TaskInstance"> |
||||
select * |
||||
from t_ds_task_instance |
||||
where process_instance_id = #{processInstanceId} |
||||
and name = #{name} |
||||
and flag = 1 |
||||
limit 1 |
||||
</select> |
||||
<select id="countTask" resultType="java.lang.Integer"> |
||||
select count(1) as count |
||||
from t_ds_task_instance task,t_ds_process_definition process |
||||
where task.process_definition_id=process.id |
||||
<if test="projectIds != null and projectIds.length != 0"> |
||||
and process.project_id in |
||||
<foreach collection="projectIds" index="index" item="i" open="(" separator="," close=")"> |
||||
#{i} |
||||
</foreach> |
||||
</if> |
||||
<if test="taskIds != null and taskIds.length != 0"> |
||||
and task.id in |
||||
<foreach collection="taskIds" index="index" item="i" open="(" separator="," close=")"> |
||||
#{i} |
||||
</foreach> |
||||
</if> |
||||
</select> |
||||
<select id="queryTaskInstanceListPaging" resultType="org.apache.dolphinscheduler.dao.entity.TaskInstance"> |
||||
select instance.*,process.name as process_instance_name |
||||
from t_ds_task_instance instance |
||||
join t_ds_process_definition define ON instance.process_definition_id = define.id |
||||
join t_ds_process_instance process on process.id=instance.process_instance_id |
||||
where define.project_id = #{projectId} |
||||
<if test="startTime != null"> |
||||
and instance.start_time > #{startTime} and instance.start_time <![CDATA[ <=]]> #{endTime} |
||||
</if> |
||||
<if test="processInstanceId != 0"> |
||||
and instance.process_instance_id = #{processInstanceId} |
||||
</if> |
||||
<if test="searchVal != null and searchVal != ''"> |
||||
and instance.name like concat('%', #{searchVal}, '%') |
||||
</if> |
||||
<if test="taskName != null and taskName != ''"> |
||||
and instance.name=#{taskName} |
||||
</if> |
||||
<if test="states != null and states.length != 0"> |
||||
and instance.state in |
||||
<foreach collection="states" index="index" item="i" open="(" separator="," close=")"> |
||||
#{i} |
||||
</foreach> |
||||
</if> |
||||
<if test="host != null and host != ''"> |
||||
and instance.host like concat('%', #{host}, '%') |
||||
</if> |
||||
order by instance.start_time desc |
||||
</select> |
||||
</mapper> |
@ -0,0 +1,24 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.TenantMapper"> |
||||
<select id="queryById" resultType="org.apache.dolphinscheduler.dao.entity.Tenant"> |
||||
SELECT t.*,q.queue_name,q.queue |
||||
FROM t_ds_tenant t,t_ds_queue q |
||||
WHERE t.queue_id = q.id |
||||
and t.id = #{tenantId} |
||||
</select> |
||||
<select id="queryByTenantCode" resultType="org.apache.dolphinscheduler.dao.entity.Tenant"> |
||||
select * |
||||
from t_ds_tenant |
||||
where tenant_code = #{tenantCode} |
||||
</select> |
||||
<select id="queryTenantPaging" resultType="org.apache.dolphinscheduler.dao.entity.Tenant"> |
||||
SELECT t.*,q.queue_name |
||||
FROM t_ds_tenant t,t_ds_queue q |
||||
WHERE t.queue_id = q.id |
||||
<if test="searchVal != null and searchVal != ''"> |
||||
and t.tenant_name like concat('%', #{searchVal}, '%') |
||||
</if> |
||||
order by t.update_time desc |
||||
</select> |
||||
</mapper> |
@ -0,0 +1,12 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.UDFUserMapper"> |
||||
<delete id="deleteByUserId"> |
||||
delete from t_ds_relation_udfs_user |
||||
where `user_id` = #{userId} |
||||
</delete> |
||||
<delete id="deleteByUdfFuncId"> |
||||
delete from t_ds_relation_udfs_user |
||||
where `udf_id` = #{udfFuncId} |
||||
</delete> |
||||
</mapper> |
@ -0,0 +1,54 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.UdfFuncMapper"> |
||||
<select id="queryUdfByIdStr" resultType="org.apache.dolphinscheduler.dao.entity.UdfFunc"> |
||||
select * |
||||
from t_ds_udfs |
||||
where 1 = 1 |
||||
<if test="ids != null and ids != ''"> |
||||
and id in |
||||
<foreach collection="ids" item="i" open="(" close=")" separator=","> |
||||
#{i} |
||||
</foreach> |
||||
</if> |
||||
<if test="funcNames != null and funcNames != ''"> |
||||
and func_name = #{funcName} |
||||
</if> |
||||
order by id asc |
||||
</select> |
||||
<select id="queryUdfFuncPaging" resultType="org.apache.dolphinscheduler.dao.entity.UdfFunc"> |
||||
select * |
||||
from t_ds_udfs |
||||
where 1=1 |
||||
<if test="searchVal!= null and searchVal != ''"> |
||||
and `name` like concat('%', #{searchVal}, '%') |
||||
</if> |
||||
<if test="userId != 0"> |
||||
and id in ( |
||||
select udf_id from t_ds_relation_udfs_user where user_id=#{userId} |
||||
union select id as udf_id from t_ds_udfs where user_id=#{userId}) |
||||
</if> |
||||
order by create_time desc |
||||
</select> |
||||
<select id="getUdfFuncByType" resultType="org.apache.dolphinscheduler.dao.entity.UdfFunc"> |
||||
select * |
||||
from t_ds_udfs |
||||
where `type` = #{type} |
||||
<if test="userId != 0"> |
||||
and id in ( |
||||
select udf_id from t_ds_relation_udfs_user where user_id=#{userId} |
||||
union select id as udf_id from t_ds_udfs where user_id=#{userId}) |
||||
</if> |
||||
</select> |
||||
<select id="queryUdfFuncExceptUserId" resultType="org.apache.dolphinscheduler.dao.entity.UdfFunc"> |
||||
select * |
||||
from t_ds_udfs |
||||
where user_id <![CDATA[ <> ]]> #{userId} |
||||
</select> |
||||
<select id="queryAuthedUdfFunc" resultType="org.apache.dolphinscheduler.dao.entity.UdfFunc"> |
||||
SELECT u.* |
||||
from t_ds_udfs u,t_ds_relation_udfs_user rel |
||||
WHERE u.id = rel.udf_id |
||||
AND rel.user_id = #{userId} |
||||
</select> |
||||
</mapper> |
@ -0,0 +1,14 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.UserAlertGroupMapper"> |
||||
<delete id="deleteByAlertgroupId"> |
||||
delete from t_ds_relation_user_alertgroup |
||||
where `alertgroup_id` = #{alertgroupId} |
||||
</delete> |
||||
<select id="listUserByAlertgroupId" resultType="org.apache.dolphinscheduler.dao.entity.User"> |
||||
SELECT u.* |
||||
FROM t_ds_relation_user_alertgroup g_u |
||||
JOIN t_ds_user u on g_u.user_id = u.id |
||||
WHERE g_u.alertgroup_id = #{alertgroupId} |
||||
</select> |
||||
</mapper> |
@ -0,0 +1,55 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.UserMapper"> |
||||
|
||||
<select id="queryAllGeneralUser" resultType="org.apache.dolphinscheduler.dao.entity.User"> |
||||
select * from t_ds_user |
||||
where user_type=1; |
||||
</select> |
||||
<select id="queryByUserNameAccurately" resultType="org.apache.dolphinscheduler.dao.entity.User"> |
||||
select * from t_ds_user |
||||
where user_name=#{userName} |
||||
</select> |
||||
<select id="queryUserByNamePassword" resultType="org.apache.dolphinscheduler.dao.entity.User"> |
||||
select * from t_ds_user |
||||
where user_name=#{userName} and user_password = #{password} |
||||
</select> |
||||
|
||||
<select id="queryUserPaging" resultType="org.apache.dolphinscheduler.dao.entity.User"> |
||||
select u.id,u.user_name,u.user_password,u.user_type,u.email,u.phone,u.tenant_id,u.create_time, |
||||
u.update_time,t.tenant_name, |
||||
case when u.queue <![CDATA[ <> ]]> '' then u.queue else q.queue_name end as queue, q.queue_name |
||||
from t_ds_user u |
||||
left join t_ds_tenant t on u.tenant_id=t.id |
||||
left join t_ds_queue q on t.queue_id = q.id |
||||
where 1=1 |
||||
<if test="userName!=null and userName != ''" > |
||||
and u.user_name like concat ('%', #{userName}, '%') |
||||
</if> |
||||
order by u.update_time desc |
||||
</select> |
||||
|
||||
<select id="queryDetailsById" resultType="org.apache.dolphinscheduler.dao.entity.User"> |
||||
select u.*, t.tenant_name, |
||||
case when u.queue <![CDATA[ <> ]]> '' then u.queue else q.queue_name end as queue_name |
||||
from t_ds_user u,t_ds_tenant t,t_ds_queue q |
||||
WHERE u.tenant_id = t.id and t.queue_id = q.id and u.id = #{userId} |
||||
</select> |
||||
|
||||
<select id="queryUserListByAlertGroupId" resultType="org.apache.dolphinscheduler.dao.entity.User"> |
||||
select u.* |
||||
from t_ds_user u, t_ds_relation_user_alertgroup rel |
||||
where u.id = rel.user_id AND u.user_type = 1 AND rel.alertgroup_id = #{alertgroupId} |
||||
</select> |
||||
|
||||
<select id="queryTenantCodeByUserId" resultType="org.apache.dolphinscheduler.dao.entity.User"> |
||||
SELECT u.*,t.tenant_code |
||||
FROM t_ds_user u, t_ds_tenant t |
||||
WHERE u.tenant_id = t.id AND u.id = #{userId} |
||||
</select> |
||||
<select id="queryUserByToken" resultType="org.apache.dolphinscheduler.dao.entity.User"> |
||||
select u.* |
||||
from t_ds_user u ,t_ds_access_token t |
||||
where u.id = t.user_id and token=#{token} and t.expire_time > NOW() |
||||
</select> |
||||
</mapper> |
@ -0,0 +1,23 @@
|
||||
<?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="org.apache.dolphinscheduler.dao.mapper.WorkerGroupMapper"> |
||||
<select id="queryAllWorkerGroup" resultType="org.apache.dolphinscheduler.dao.entity.WorkerGroup"> |
||||
select * |
||||
from t_ds_worker_group |
||||
order by update_time desc |
||||
</select> |
||||
<select id="queryWorkerGroupByName" resultType="org.apache.dolphinscheduler.dao.entity.WorkerGroup"> |
||||
select * |
||||
from t_ds_worker_group |
||||
where `name` = #{name} |
||||
</select> |
||||
<select id="queryListPaging" resultType="org.apache.dolphinscheduler.dao.entity.WorkerGroup"> |
||||
select * |
||||
from t_ds_worker_group |
||||
where 1 = 1 |
||||
<if test="searchVal != null and searchVal != ''"> |
||||
and name like concat('%', #{searchVal}, '%') |
||||
</if> |
||||
order by update_time desc |
||||
</select> |
||||
</mapper> |
@ -0,0 +1,25 @@
|
||||
#zookeeper cluster |
||||
zookeeper.quorum=127.0.0.1:2181 |
||||
|
||||
#dolphinscheduler root directory |
||||
zookeeper.dolphinscheduler.root=/dolphinscheduler |
||||
|
||||
#zookeeper server dirctory |
||||
zookeeper.dolphinscheduler.dead.servers=/dolphinscheduler/dead-servers |
||||
zookeeper.dolphinscheduler.masters=/dolphinscheduler/masters |
||||
zookeeper.dolphinscheduler.workers=/dolphinscheduler/workers |
||||
|
||||
#zookeeper lock dirctory |
||||
zookeeper.dolphinscheduler.lock.masters=/dolphinscheduler/lock/masters |
||||
zookeeper.dolphinscheduler.lock.workers=/dolphinscheduler/lock/workers |
||||
|
||||
#dolphinscheduler failover directory |
||||
zookeeper.dolphinscheduler.lock.failover.masters=/dolphinscheduler/lock/failover/masters |
||||
zookeeper.dolphinscheduler.lock.failover.workers=/dolphinscheduler/lock/failover/workers |
||||
zookeeper.dolphinscheduler.lock.failover.startup.masters=/dolphinscheduler/lock/failover/startup-masters |
||||
|
||||
#dolphinscheduler failover directory |
||||
zookeeper.session.timeout=300 |
||||
zookeeper.connection.timeout=300 |
||||
zookeeper.retry.sleep=1000 |
||||
zookeeper.retry.maxtime=5 |
@ -1,3 +0,0 @@
|
||||
installPath=/data1_1T/escheduler |
||||
deployUser=escheduler |
||||
ips=ark0,ark1,ark2,ark3,ark4 |
@ -1 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'><html><head><title> easyscheduler</title><meta name='Keywords' content=''><meta name='Description' content=''><style type="text/css">table { margin-top:0px; padding-top:0px; border:1px solid; font-size: 14px; color: #333333; border-width: 1px; border-color: #666666; border-collapse: collapse; } table th { border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #dedede; } table td { border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #ffffff; }</style></head><body style="margin:0;padding:0"><table border="1px" cellpadding="5px" cellspacing="-10px"><thead><#if title??> ${title}</#if></thead><#if content??> ${content}</#if></table></body></html> |
@ -1,25 +0,0 @@
|
||||
#zookeeper cluster |
||||
zookeeper.quorum=127.0.0.1:2181 |
||||
|
||||
#escheduler root directory |
||||
zookeeper.escheduler.root=/escheduler |
||||
|
||||
#zookeeper server dirctory |
||||
zookeeper.escheduler.dead.servers=/escheduler/dead-servers |
||||
zookeeper.escheduler.masters=/escheduler/masters |
||||
zookeeper.escheduler.workers=/escheduler/workers |
||||
|
||||
#zookeeper lock dirctory |
||||
zookeeper.escheduler.lock.masters=/escheduler/lock/masters |
||||
zookeeper.escheduler.lock.workers=/escheduler/lock/workers |
||||
|
||||
#escheduler failover directory |
||||
zookeeper.escheduler.lock.failover.masters=/escheduler/lock/failover/masters |
||||
zookeeper.escheduler.lock.failover.workers=/escheduler/lock/failover/workers |
||||
zookeeper.escheduler.lock.failover.startup.masters=/escheduler/lock/failover/startup-masters |
||||
|
||||
#escheduler failover directory |
||||
zookeeper.session.timeout=300 |
||||
zookeeper.connection.timeout=300 |
||||
zookeeper.retry.sleep=1000 |
||||
zookeeper.retry.maxtime=5 |
@ -1,8 +1,8 @@
|
||||
#!/bin/bash |
||||
|
||||
echo "------ escheduler start - build -------" |
||||
echo "------ dolphinscheduler start - build -------" |
||||
printenv |
||||
|
||||
docker build --build-arg version=$version --build-arg tar_version=$tar_version -t $DOCKER_REPO:$version . |
||||
|
||||
echo "------ escheduler end - build -------" |
||||
echo "------ dolphinscheduler end - build -------" |
||||
|
@ -1,7 +1,7 @@
|
||||
-- Records of t_escheduler_user,user : admin , password : escheduler123 |
||||
INSERT INTO `t_escheduler_user` VALUES ('1', 'admin', '055a97b5fcd6d120372ad1976518f371', '0', 'xxx@qq.com', 'xx', '0', '2018-03-27 15:48:50', '2018-10-24 17:40:22'); |
||||
-- Records of t_escheduler_user,user : admin , password : dolphinscheduler123 |
||||
INSERT INTO `t_escheduler_user` VALUES ('1', 'admin', '7ad2410b2f4c074479a8937a28a22b8f', '0', 'xxx@qq.com', 'xx', '0', '2018-03-27 15:48:50', '2018-10-24 17:40:22'); |
||||
INSERT INTO `t_escheduler_alertgroup` VALUES (1, 'escheduler管理员告警组', '0', 'escheduler管理员告警组','2018-11-29 10:20:39', '2018-11-29 10:20:39'); |
||||
INSERT INTO `t_escheduler_relation_user_alertgroup` VALUES ('1', '1', '1', '2018-11-29 10:22:33', '2018-11-29 10:22:33'); |
||||
|
||||
-- Records of t_escheduler_queue,default queue name : default |
||||
INSERT INTO `t_escheduler_queue` VALUES ('1', 'default', 'default'); |
||||
INSERT INTO `t_escheduler_queue` VALUES ('1', 'default', 'default'); |
||||
|
@ -1,8 +1,8 @@
|
||||
-- Records of t_escheduler_user,user : admin , password : escheduler123 |
||||
INSERT INTO "t_escheduler_user" VALUES ('1', 'admin', '055a97b5fcd6d120372ad1976518f371', '0', 'xxx@qq.com', 'xx', '0', '2018-03-27 15:48:50', '2018-10-24 17:40:22'); |
||||
-- Records of t_escheduler_user,user : admin , password : dolphinscheduler123 |
||||
INSERT INTO "t_escheduler_user" VALUES ('1', 'admin', '7ad2410b2f4c074479a8937a28a22b8f', '0', 'xxx@qq.com', 'xx', '0', '2018-03-27 15:48:50', '2018-10-24 17:40:22'); |
||||
INSERT INTO "t_escheduler_alertgroup" VALUES (1, 'escheduler管理员告警组', '0', 'escheduler管理员告警组','2018-11-29 10:20:39', '2018-11-29 10:20:39'); |
||||
INSERT INTO "t_escheduler_relation_user_alertgroup" VALUES ('1', '1', '1', '2018-11-29 10:22:33', '2018-11-29 10:22:33'); |
||||
|
||||
-- Records of t_escheduler_queue,default queue name : default |
||||
INSERT INTO "t_escheduler_queue" VALUES ('1', 'default', 'default'); |
||||
INSERT INTO "t_escheduler_version" VALUES ('1', '1.2.0'); |
||||
INSERT INTO "t_escheduler_version" VALUES ('1', '1.2.0'); |
||||
|
Loading…
Reference in new issue