Commit f55e0cab authored by mcb's avatar mcb

no message

parent da644070
...@@ -143,11 +143,26 @@ public class DateUtils { ...@@ -143,11 +143,26 @@ public class DateUtils {
cal.add(Calendar.DATE, -1); cal.add(Calendar.DATE, -1);
return cal.getTime(); return cal.getTime();
} }
/*
public static String yesterdayStr() { * 获取昨天字符串日期 年月日
* */
public static String getYesterdayStr() {
return dateFormat.format(yesterday()); return dateFormat.format(yesterday());
} }
public static Date beforeYesterday() {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, -2);
return cal.getTime();
}
/*
* 获取前天字符串日期 年月日
* */
public static String getBeforeYesterdayStr() {
return dateFormat.format(beforeYesterday());
}
/** /**
* 格式化时间 * 格式化时间
* <p> * <p>
......
package com.jz.dmp.azkaban.dao;
import com.jz.dmp.azkaban.entity.ProjectFlows;
import com.jz.dmp.modules.controller.azkaban.bean.ProjectFlowsDto;
import com.jz.dmp.modules.controller.bean.IndexProjAzkabanStatuDto;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevExamplesListDto;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevExamplesListReq;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* 数据运维--任务实例
*
* @author Bellamy
* @return
* @since 2021-01-14
*/
public interface ExecutionFlowsMapper {
/**
* 数据运维-数据开发实例列表分页查询
*
* @return
* @author Bellamy
* @since 2021-01-14
*/
List<DataDevExamplesListDto> queryDevExamplesListPage(Map saveParams) throws Exception;
}
package com.jz.dmp.azkaban.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
/**
* 任务实例(ExecutionFlows)实体类
*
* @author Bellamy
* @since 2021-01-14 10:37:57
*/
@ApiModel(value = "任务实例", description = "任务实例")
public class ExecutionFlows implements Serializable {
private static final long serialVersionUID = 272745589551043011L;
@ApiModelProperty(value = "${column.comment}")
private Integer execId;
@ApiModelProperty(value = "${column.comment}")
private Integer projectId;
@ApiModelProperty(value = "${column.comment}")
private Integer version;
@ApiModelProperty(value = "${column.comment}")
private String flowId;
@ApiModelProperty(value = "${column.comment}")
private Integer status;
@ApiModelProperty(value = "${column.comment}")
private String submitUser;
@ApiModelProperty(value = "${column.comment}")
private Long submitTime;
@ApiModelProperty(value = "${column.comment}")
private Long updateTime;
@ApiModelProperty(value = "${column.comment}")
private Long startTime;
@ApiModelProperty(value = "${column.comment}")
private Long endTime;
@ApiModelProperty(value = "${column.comment}")
private Integer encType;
@ApiModelProperty(value = "${column.comment}")
private Object flowData;
@ApiModelProperty(value = "${column.comment}")
private Integer executorId;
public Integer getExecId() {
return execId;
}
public void setExecId(Integer execId) {
this.execId = execId;
}
public Integer getProjectId() {
return projectId;
}
public void setProjectId(Integer projectId) {
this.projectId = projectId;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
public String getFlowId() {
return flowId;
}
public void setFlowId(String flowId) {
this.flowId = flowId;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getSubmitUser() {
return submitUser;
}
public void setSubmitUser(String submitUser) {
this.submitUser = submitUser;
}
public Long getSubmitTime() {
return submitTime;
}
public void setSubmitTime(Long submitTime) {
this.submitTime = submitTime;
}
public Long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Long updateTime) {
this.updateTime = updateTime;
}
public Long getStartTime() {
return startTime;
}
public void setStartTime(Long startTime) {
this.startTime = startTime;
}
public Long getEndTime() {
return endTime;
}
public void setEndTime(Long endTime) {
this.endTime = endTime;
}
public Integer getEncType() {
return encType;
}
public void setEncType(Integer encType) {
this.encType = encType;
}
public Object getFlowData() {
return flowData;
}
public void setFlowData(Object flowData) {
this.flowData = flowData;
}
public Integer getExecutorId() {
return executorId;
}
public void setExecutorId(Integer executorId) {
this.executorId = executorId;
}
}
\ No newline at end of file
...@@ -3,6 +3,8 @@ package com.jz.dmp.modules.controller.dataOperation; ...@@ -3,6 +3,8 @@ package com.jz.dmp.modules.controller.dataOperation;
import com.jz.common.constant.JsonResult; import com.jz.common.constant.JsonResult;
import com.jz.common.constant.ResultCode; import com.jz.common.constant.ResultCode;
import com.jz.common.page.PageInfoResponse; import com.jz.common.page.PageInfoResponse;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevExamplesListDto;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevExamplesListReq;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto; import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq; import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq;
import com.jz.dmp.modules.service.DmpDevelopTaskService; import com.jz.dmp.modules.service.DmpDevelopTaskService;
...@@ -35,19 +37,19 @@ public class DmpDevExamplesController { ...@@ -35,19 +37,19 @@ public class DmpDevExamplesController {
* *
* @return * @return
* @author Bellamy * @author Bellamy
* @since 2021-01-05 * @since 2021-01-14
*/ */
@ApiOperation(value = "列表分页查询", notes = "列表分页查询") @ApiOperation(value = "列表分页查询", notes = "列表分页查询")
@PostMapping(value = "/listPage") @PostMapping(value = "/listPage")
public PageInfoResponse<DataDevTaskListDto> getDevTaskListPage(@RequestBody @Validated DataDevTaskListReq req, HttpServletRequest httpRequest) throws Exception { public PageInfoResponse<DataDevExamplesListDto> getDevExamplesListPage(@RequestBody @Validated DataDevExamplesListReq req, HttpServletRequest httpRequest) throws Exception {
PageInfoResponse<DataDevTaskListDto> pageInfo = new PageInfoResponse<DataDevTaskListDto>(); PageInfoResponse<DataDevExamplesListDto> pageInfo = new PageInfoResponse<DataDevExamplesListDto>();
if (StringUtils.isEmpty(req.getProjectId())) { if (StringUtils.isEmpty(req.getProjectId())) {
pageInfo.setMessage("项目id不能为空!"); pageInfo.setMessage("项目id不能为空!");
pageInfo.setCode(ResultCode.PARAMS_ERROR); pageInfo.setCode(ResultCode.PARAMS_ERROR);
return pageInfo; return pageInfo;
} }
try { try {
pageInfo = dmpDevelopTaskService.queryDevTaskListPage(req); pageInfo = dmpDevelopTaskService.queryDevExamplesListPage(req);
} catch (Exception e) { } catch (Exception e) {
pageInfo.setMessage("查询失败"); pageInfo.setMessage("查询失败");
pageInfo.setCode(ResultCode.INTERNAL_SERVER_ERROR); pageInfo.setCode(ResultCode.INTERNAL_SERVER_ERROR);
......
package com.jz.dmp.modules.controller.dataOperation.bean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @ClassName: DataDevExamplesListDto
* @Description: 数据运维-数据开发实例列表返回参数
* @Author:Bellamy
* @Date 2021/01/14
* @Version 1.0
*/
@ApiModel(value = "数据运维-数据开发实例列表返回参数", description = "数据开发实例列表返回参数")
public class DataDevExamplesListDto {
/*
* 任务ID
* */
@ApiModelProperty(value = "任务ID")
private String taskId;
/*
* 基本信息(任务名称)
* */
@ApiModelProperty(value = "基本信息(任务名称)")
private String taskName;
/*
* 任务类型
* */
@ApiModelProperty(value = "任务类型")
private String taskType;
/*
* 优先级
* */
@ApiModelProperty(value = "优先级")
private String priorityLevel;
/*
* 定时时间
* */
@ApiModelProperty(value = "定时时间")
private String timer;
/*
* 业务日期
* */
@ApiModelProperty(value = "业务日期")
private String businessTime;
/*
* 责任人
* */
@ApiModelProperty(value = "责任人")
private String submitUser;
/*
* 运行时长
* */
@ApiModelProperty(value = "运行时长")
private String runTime;
/*
* 开始时间
* */
@ApiModelProperty(value = "开始时间")
private String startTime;
/*
* 结束时间
* */
@ApiModelProperty(value = "结束时间")
private String endTime;
private String execId;
private String flowData;
/*
* 状态
* */
@ApiModelProperty(value = "状态")
private String status;
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
public String getTaskName() {
return taskName;
}
public void setTaskName(String taskName) {
this.taskName = taskName;
}
public String getTaskType() {
return taskType;
}
public void setTaskType(String taskType) {
this.taskType = taskType;
}
public String getPriorityLevel() {
return priorityLevel;
}
public void setPriorityLevel(String priorityLevel) {
this.priorityLevel = priorityLevel;
}
public String getTimer() {
return timer;
}
public void setTimer(String timer) {
this.timer = timer;
}
public String getBusinessTime() {
return businessTime;
}
public void setBusinessTime(String businessTime) {
this.businessTime = businessTime;
}
public String getRunTime() {
return runTime;
}
public void setRunTime(String runTime) {
this.runTime = runTime;
}
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public String getSubmitUser() {
return submitUser;
}
public void setSubmitUser(String submitUser) {
this.submitUser = submitUser;
}
public String getExecId() {
return execId;
}
public void setExecId(String execId) {
this.execId = execId;
}
public String getFlowData() {
return flowData;
}
public void setFlowData(String flowData) {
this.flowData = flowData;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
...@@ -34,4 +34,6 @@ public interface DmpDevelopTaskDao { ...@@ -34,4 +34,6 @@ public interface DmpDevelopTaskDao {
* @since 2021-01-13 * @since 2021-01-13
*/ */
List<DataDevTaskListDto> queryDevTaskListPage(DataDevTaskListReq req) throws Exception; List<DataDevTaskListDto> queryDevTaskListPage(DataDevTaskListReq req) throws Exception;
List<DataDevTaskListDto> queryTaskTreeInfo(Map params) throws Exception;
} }
...@@ -2,6 +2,8 @@ package com.jz.dmp.modules.service; ...@@ -2,6 +2,8 @@ package com.jz.dmp.modules.service;
import com.jz.common.constant.JsonResult; import com.jz.common.constant.JsonResult;
import com.jz.common.page.PageInfoResponse; import com.jz.common.page.PageInfoResponse;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevExamplesListDto;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevExamplesListReq;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto; import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq; import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq;
import com.jz.dmp.modules.model.DmpDevelopTask; import com.jz.dmp.modules.model.DmpDevelopTask;
...@@ -33,4 +35,13 @@ public interface DmpDevelopTaskService { ...@@ -33,4 +35,13 @@ public interface DmpDevelopTaskService {
* @author Bellamy * @author Bellamy
*/ */
JsonResult runTaskByTaskId(String taskId) throws Exception; JsonResult runTaskByTaskId(String taskId) throws Exception;
/**
* 数据运维-数据开发实例列表分页查询
*
* @return
* @author Bellamy
* @since 2021-01-14
*/
PageInfoResponse<DataDevExamplesListDto> queryDevExamplesListPage(DataDevExamplesListReq req) throws Exception;
} }
\ No newline at end of file
...@@ -6,10 +6,14 @@ import com.jz.agent.service.DmpDsAgentService; ...@@ -6,10 +6,14 @@ import com.jz.agent.service.DmpDsAgentService;
import com.jz.common.constant.JsonResult; import com.jz.common.constant.JsonResult;
import com.jz.common.constant.ResultCode; import com.jz.common.constant.ResultCode;
import com.jz.common.page.PageInfoResponse; import com.jz.common.page.PageInfoResponse;
import com.jz.common.utils.DateUtils;
import com.jz.common.utils.JsonMapper; import com.jz.common.utils.JsonMapper;
import com.jz.common.utils.StringUtils; import com.jz.common.utils.StringUtils;
import com.jz.common.utils.web.XmlUtils; import com.jz.common.utils.web.XmlUtils;
import com.jz.dmp.agent.DmpAgentResult; import com.jz.dmp.agent.DmpAgentResult;
import com.jz.dmp.azkaban.dao.ExecutionFlowsMapper;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevExamplesListDto;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevExamplesListReq;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto; import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto;
import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq; import com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListReq;
import com.jz.dmp.modules.dao.DmpDevelopTaskDao; import com.jz.dmp.modules.dao.DmpDevelopTaskDao;
...@@ -25,12 +29,11 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -25,12 +29,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import static com.jz.common.utils.DateUtils.getYesterdayStr;
/** /**
* 任务开发(DmpDevelopTask)表服务实现类 * 任务开发(DmpDevelopTask)表服务实现类
* *
...@@ -61,6 +64,9 @@ public class DmpDevelopTaskServiceImpl implements DmpDevelopTaskService { ...@@ -61,6 +64,9 @@ public class DmpDevelopTaskServiceImpl implements DmpDevelopTaskService {
@Autowired @Autowired
private OfflineSynchService offlineSynchService; private OfflineSynchService offlineSynchService;
@Autowired
private ExecutionFlowsMapper executionFlowsMapper;
/** /**
* 添加保存dmp数据(包含校验数据) * 添加保存dmp数据(包含校验数据)
* *
...@@ -763,4 +769,80 @@ public class DmpDevelopTaskServiceImpl implements DmpDevelopTaskService { ...@@ -763,4 +769,80 @@ public class DmpDevelopTaskServiceImpl implements DmpDevelopTaskService {
public JsonResult runTaskByTaskId(String taskId) throws Exception { public JsonResult runTaskByTaskId(String taskId) throws Exception {
return offlineSynchService.taskRunNowByTaskId(taskId); return offlineSynchService.taskRunNowByTaskId(taskId);
} }
/**
* 数据运维-数据开发实例列表分页查询
*
* @return
* @author Bellamy
* @since 2021-01-14
*/
@Override
public PageInfoResponse<DataDevExamplesListDto> queryDevExamplesListPage(DataDevExamplesListReq req) throws Exception {
PageInfoResponse<DataDevExamplesListDto> pageInfoResponse = new PageInfoResponse<>();
Map saveParams = new HashMap();
if (StringUtils.isNotBlank(req.getTreeName())) {
saveParams.put("taskName", req.getTreeName());
}
if (org.apache.commons.lang3.StringUtils.isNotEmpty(req.getBusinessTime())) {
String[] cretime = req.getBusinessTime().split("-");
saveParams.put("startTime", cretime[0].trim() + " 00:00:00");
saveParams.put("endTime", cretime[1].trim() + " 23:59:59");
} else if (StringUtils.isNotBlank(req.getCreTimeType())) {
if ("01".equals(req.getCreTimeType())) { //昨天
saveParams.put("businessTime", DateUtils.getYesterdayStr());
}
if ("02".equals(req.getCreTimeType())) { //前天
saveParams.put("businessTime", DateUtils.getBeforeYesterdayStr());
}
if ("03".equals(req.getCreTimeType())) { //全部
saveParams.put("businessTime", null);
}
} else {
//默认当天日期
saveParams.put("businessTime", DateUtils.currentDate());
}
String taskName = "";
PageHelper.startPage(req.getPageNum(), req.getPageSize());
Map params = new HashMap();
params.put("projectId", req.getProjectId());
//
List<DataDevTaskListDto> treeList = dmpDevelopTaskDao.queryTaskTreeInfo(params);
if (treeList.size() > 0 && treeList != null) {
for (DataDevTaskListDto treeDto : treeList) {
if (StringUtils.isNotBlank(treeDto.getTaskName())) {
taskName += "," + treeDto.getTaskName();
}
}
}
saveParams.put("taskName", taskName.substring(1).split(","));
List<DataDevExamplesListDto> list = executionFlowsMapper.queryDevExamplesListPage(saveParams);
/*List<DataDevExamplesListDto> list = executionFlowsMapper.queryDevExamplesListPage(req);
if (list.size() > 0) {
for (DataDevExamplesListDto dto : list) {
if (StringUtils.isNotBlank(dto.getTaskName())) {
taskName += "," + dto.getTaskName();
}
}
Map params = new HashMap();
params.put("projectId", req.getProjectId());
params.put("taskName", taskName.substring(1).split(","));
List<DataDevTaskListDto> treeList = dmpDevelopTaskDao.queryTaskTreeInfo(params);
if (treeList.size() > 0 && treeList != null) {
for (DataDevTaskListDto treeDto : treeList) {
treeDto.getTaskName();
}
}
}*/
PageInfo<DataDevExamplesListDto> pageInfo = new PageInfo<>(list);
pageInfoResponse.setCode(ResultCode.SUCCESS);
pageInfoResponse.setMessage("查询成功");
pageInfoResponse.setData(pageInfo);
return pageInfoResponse;
}
} }
\ No newline at end of file
<?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.jz.dmp.azkaban.dao.ExecutionFlowsMapper">
<resultMap type="com.jz.dmp.azkaban.entity.ExecutionFlows" id="ExecutionFlowsMap">
<result property="execId" column="exec_id" jdbcType="INTEGER"/>
<result property="projectId" column="project_id" jdbcType="INTEGER"/>
<result property="version" column="version" jdbcType="INTEGER"/>
<result property="flowId" column="flow_id" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="INTEGER"/>
<result property="submitUser" column="submit_user" jdbcType="VARCHAR"/>
<result property="submitTime" column="submit_time" jdbcType="INTEGER"/>
<result property="updateTime" column="update_time" jdbcType="INTEGER"/>
<result property="startTime" column="start_time" jdbcType="INTEGER"/>
<result property="endTime" column="end_time" jdbcType="INTEGER"/>
<result property="encType" column="enc_type" jdbcType="INTEGER"/>
<result property="flowData" column="flow_data" jdbcType="OTHER"/>
<result property="executorId" column="executor_id" jdbcType="INTEGER"/>
</resultMap>
<!--查询单个-->
<select id="queryById" resultMap="ExecutionFlowsMap">
select
exec_id, project_id, version, flow_id, status, submit_user, submit_time, update_time, start_time, end_time, enc_type, flow_data, executor_id
from execution_flows
where exec_id = #{execId}
</select>
<!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="ExecutionFlowsMap">
select
exec_id, project_id, version, flow_id, status, submit_user, submit_time, update_time, start_time, end_time, enc_type, flow_data, executor_id
from execution_flows
limit #{offset}, #{limit}
</select>
<!--通过实体作为筛选条件查询-->
<select id="queryAll" resultMap="ExecutionFlowsMap">
select
exec_id, project_id, version, flow_id, status, submit_user, submit_time, update_time, start_time, end_time,
enc_type, flow_data, executor_id
from execution_flows
<where>
<if test="execId != null">
and exec_id = #{execId}
</if>
<if test="projectId != null">
and project_id = #{projectId}
</if>
<if test="version != null">
and version = #{version}
</if>
<if test="flowId != null and flowId != ''">
and flow_id = #{flowId}
</if>
<if test="status != null">
and status = #{status}
</if>
<if test="submitUser != null and submitUser != ''">
and submit_user = #{submitUser}
</if>
<if test="submitTime != null">
and submit_time = #{submitTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="startTime != null">
and start_time = #{startTime}
</if>
<if test="endTime != null">
and end_time = #{endTime}
</if>
<if test="encType != null">
and enc_type = #{encType}
</if>
<if test="flowData != null">
and flow_data = #{flowData}
</if>
<if test="executorId != null">
and executor_id = #{executorId}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="execId" useGeneratedKeys="true">
insert into execution_flows(project_id, version, flow_id, status, submit_user, submit_time, update_time, start_time, end_time, enc_type, flow_data, executor_id)
values (#{projectId}, #{version}, #{flowId}, #{status}, #{submitUser}, #{submitTime}, #{updateTime}, #{startTime}, #{endTime}, #{encType}, #{flowData}, #{executorId})
</insert>
<insert id="insertBatch" keyProperty="execId" useGeneratedKeys="true">
insert into execution_flows(project_id, version, flow_id, status, submit_user, submit_time, update_time,
start_time, end_time, enc_type, flow_data, executor_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.projectId}, #{entity.version}, #{entity.flowId}, #{entity.status}, #{entity.submitUser},
#{entity.submitTime}, #{entity.updateTime}, #{entity.startTime}, #{entity.endTime}, #{entity.encType},
#{entity.flowData}, #{entity.executorId})
</foreach>
</insert>
<insert id="insertOrUpdateBatch" keyProperty="execId" useGeneratedKeys="true">
insert into execution_flows(project_id, version, flow_id, status, submit_user, submit_time, update_time,
start_time, end_time, enc_type, flow_data, executor_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.projectId}, #{entity.version}, #{entity.flowId}, #{entity.status}, #{entity.submitUser},
#{entity.submitTime}, #{entity.updateTime}, #{entity.startTime}, #{entity.endTime}, #{entity.encType},
#{entity.flowData}, #{entity.executorId})
</foreach>
on duplicate key update
project_id = values(project_id) , version = values(version) , flow_id = values(flow_id) , status =
values(status) , submit_user = values(submit_user) , submit_time = values(submit_time) , update_time =
values(update_time) , start_time = values(start_time) , end_time = values(end_time) , enc_type =
values(enc_type) , flow_data = values(flow_data) , executor_id = values(executor_id)
</insert>
<!--通过主键修改数据-->
<update id="update">
update execution_flows
<set>
<if test="projectId != null">
project_id = #{projectId},
</if>
<if test="version != null">
version = #{version},
</if>
<if test="flowId != null and flowId != ''">
flow_id = #{flowId},
</if>
<if test="status != null">
status = #{status},
</if>
<if test="submitUser != null and submitUser != ''">
submit_user = #{submitUser},
</if>
<if test="submitTime != null">
submit_time = #{submitTime},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="startTime != null">
start_time = #{startTime},
</if>
<if test="endTime != null">
end_time = #{endTime},
</if>
<if test="encType != null">
enc_type = #{encType},
</if>
<if test="flowData != null">
flow_data = #{flowData},
</if>
<if test="executorId != null">
executor_id = #{executorId},
</if>
</set>
where exec_id = #{execId}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete from execution_flows where exec_id = #{execId}
</delete>
<!--数据运维-数据开发实例列表分页查询-->
<select id="queryDevExamplesListPage" resultType="com.jz.dmp.modules.controller.dataOperation.bean.DataDevExamplesListDto" parameterType="java.util.Map">
select
exec_id as execId,
flow_id as taskName,
submit_user as submitUser,
from_unixtime(submit_time/1000, '%Y-%m-%d %H:%i:%s') as businessTime,
from_unixtime(start_time/1000, '%Y-%m-%d %H:%i:%s') as startTime,
((case when end_time >=0 then end_time else 0 end) - (case when start_time >=0 then start_time else 0 end)) as runTime,
from_unixtime(update_time/1000, '%Y-%m-%d %H:%i:%s') as updateTime,
from_unixtime(end_time/1000, '%Y-%m-%d %H:%i:%s') as endTime,
flow_data as flowData,
status
from
execution_flows
where 1=1
<if test="businessTime != null and businessTime != ''"> and from_unixtime(submit_time/1000,'%Y-%m-%d') =#{businessTime} </if>
<if test="taskName != null and taskName != ''"> and flow_id like concat('%',#{taskName},'%') </if>
<if test="startTime != null and startTime != ''"> and from_unixtime(submit_time/1000,'%Y-%m-%d %H:%i:%s') >=#{startTime} </if>
<if test="endTime != null and endTime != ''">#{endTime} >= and from_unixtime(submit_time/1000,'%Y-%m-%d %H:%i:%s')</if>
</select>
</mapper>
\ No newline at end of file
...@@ -138,4 +138,25 @@ ...@@ -138,4 +138,25 @@
<if test="taskType != null and taskType!= ''"> and t1.type=#{taskType} </if> <if test="taskType != null and taskType!= ''"> and t1.type=#{taskType} </if>
</select> </select>
<select id="queryTaskTreeInfo" resultType="com.jz.dmp.modules.controller.dataOperation.bean.DataDevTaskListDto">
select
t1.id as treeId,
t1.name as taskName,
t1.type as taskType
from
dmp_navigation_tree t1
left join dmp_develop_task t2 on t2.TREE_ID=t1.ID
left join dmp_member t3 on t1.create_user_id=t3.user_id
where 1=1 and t1.type='01'
and t1.project_id = #{projectId}
<if test="treeId != null and treeId != ''"> and t1.id =#{treeId} </if>
<if test="taskName != null and taskName != ''">
and t1.name in
<foreach collection="taskName" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="taskType != null and taskType!= ''"> and t1.type=#{taskType} </if>
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment