1、数据查询的二次查询
This commit is contained in:
@@ -82,4 +82,12 @@ public interface SimulationTaskMapper extends BaseMapper<SimulationTask> {
|
||||
void saveBatchTaskMember(@Param("list") List<SimulationTaskMember> taskMembersToCreate);
|
||||
|
||||
void saveBatchTaskAttention(@Param("list") List<SimulationTaskAttention> taskAttentionsToCreate);
|
||||
|
||||
List<SpdmAnalysisTaskVo> taskListByTag(@Param("req") SpdmAnalysisTaskListReq req, @Param("tenantId") Long tenantId, @Param("allNodeIdList") List<String> allNodeIdList, @Param("pos") int pos, @Param("limit") int limit,@Param("userId") Long userId
|
||||
, @Param("tag1KeyList") List<String> tag1KeyList, @Param("tag2KeyList") List<String> tag2KeyList
|
||||
, @Param("tag3KeyList") List<String> tag3KeyList, @Param("tag4KeyList") List<String> tag4KeyList
|
||||
, @Param("tag5KeyList") List<String> tag5KeyList, @Param("tag6KeyList") List<String> tag6KeyList
|
||||
, @Param("tag7KeyList") List<String> tag7KeyList, @Param("tag8KeyList") List<String> tag8KeyList
|
||||
, @Param("tag9KeyList") List<String> tag9KeyList, @Param("tag10KeyList") List<String> tag10KeyList);
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.sdm.project.model.req;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.sdm.common.entity.ExportExcelFormat;
|
||||
import com.sdm.common.entity.pojo.BaseEntity;
|
||||
import com.sdm.common.entity.req.data.TagReq;
|
||||
import com.sdm.common.entity.req.task.TaskExportExcelParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -90,5 +91,11 @@ public class SpdmAnalysisPerformanceListReq extends BaseEntity {
|
||||
|
||||
private String runId;
|
||||
|
||||
/**
|
||||
* 标签请求参数 设置tag1-tag10 ,taskId, runId记录文件所属节点信息
|
||||
*/
|
||||
@Schema(description = "标签请求参数")
|
||||
private TagReq tagReq;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.sdm.common.entity.ExportExcelFormat;
|
||||
import com.sdm.common.entity.pojo.BaseEntity;
|
||||
import com.sdm.common.entity.req.data.TagReq;
|
||||
import com.sdm.common.entity.req.task.TaskExportExcelParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -94,4 +95,10 @@ public class SpdmAnalysisRunListReq extends BaseEntity {
|
||||
private String reportTemplate;
|
||||
|
||||
private String reportContent;
|
||||
|
||||
/**
|
||||
* 标签请求参数 设置tag1-tag10 ,taskId, runId记录文件所属节点信息
|
||||
*/
|
||||
@Schema(description = "标签请求参数")
|
||||
private TagReq tagReq;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.sdm.common.entity.ExportExcelFormat;
|
||||
import com.sdm.common.entity.pojo.BaseEntity;
|
||||
import com.sdm.common.entity.req.data.TagReq;
|
||||
import com.sdm.common.entity.req.task.TaskExportExcelParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -148,4 +149,10 @@ public class SpdmAnalysisTaskListReq extends BaseEntity {
|
||||
|
||||
private String reportContent;
|
||||
|
||||
/**
|
||||
* 标签请求参数 设置tag1-tag10 ,taskId, runId记录文件所属节点信息
|
||||
*/
|
||||
@Schema(description = "标签请求参数")
|
||||
private TagReq tagReq;
|
||||
|
||||
}
|
||||
|
||||
@@ -1787,6 +1787,206 @@ public class TaskServiceImpl implements ITaskService {
|
||||
int limit = req.getSize();
|
||||
Long tenantId = ThreadLocalContext.getTenantId();
|
||||
Long userId = ThreadLocalContext.getUserId();
|
||||
|
||||
TagReq tagReq = req.getTagReq();
|
||||
if (ObjectUtils.isEmpty(tagReq)){
|
||||
log.info("tagReq为空");
|
||||
return oldAnalysisTaskList(req);
|
||||
}
|
||||
// key可能为多个,根据逗号转化为集合
|
||||
List<String> tag1KeyList = new ArrayList<>();
|
||||
List<String> tag2KeyList = new ArrayList<>();
|
||||
List<String> tag3KeyList = new ArrayList<>();
|
||||
List<String> tag4KeyList = new ArrayList<>();
|
||||
List<String> tag5KeyList = new ArrayList<>();
|
||||
List<String> tag6KeyList = new ArrayList<>();
|
||||
List<String> tag7KeyList = new ArrayList<>();
|
||||
List<String> tag8KeyList = new ArrayList<>();
|
||||
List<String> tag9KeyList = new ArrayList<>();
|
||||
List<String> tag10KeyList = new ArrayList<>();
|
||||
String tag1Key = tagReq.getTag1();
|
||||
if (StringUtils.isNotBlank(tag1Key)) {
|
||||
tag1KeyList = Arrays.stream(tag1Key.split(",")).toList();
|
||||
}
|
||||
String tag2Key = tagReq.getTag2();
|
||||
if (StringUtils.isNotBlank(tag2Key)) {
|
||||
tag2KeyList = Arrays.stream(tag2Key.split(",")).toList();
|
||||
}
|
||||
String tag3Key = tagReq.getTag3();
|
||||
if (StringUtils.isNotBlank(tag3Key)) {
|
||||
tag3KeyList = Arrays.stream(tag3Key.split(",")).toList();
|
||||
}
|
||||
String tag4Key = tagReq.getTag4();
|
||||
if (StringUtils.isNotBlank(tag4Key)) {
|
||||
tag4KeyList = Arrays.stream(tag4Key.split(",")).toList();
|
||||
}
|
||||
String tag5Key = tagReq.getTag5();
|
||||
if (StringUtils.isNotBlank(tag5Key)) {
|
||||
tag5KeyList = Arrays.stream(tag5Key.split(",")).toList();
|
||||
}
|
||||
String tag6Key = tagReq.getTag6();
|
||||
if (StringUtils.isNotBlank(tag6Key)) {
|
||||
tag6KeyList = Arrays.stream(tag6Key.split(",")).toList();
|
||||
}
|
||||
String tag7Key = tagReq.getTag7();
|
||||
if (StringUtils.isNotBlank(tag7Key)) {
|
||||
tag7KeyList = Arrays.stream(tag7Key.split(",")).toList();
|
||||
}
|
||||
String tag8Key = tagReq.getTag8();
|
||||
if (StringUtils.isNotBlank(tag8Key)) {
|
||||
tag8KeyList = Arrays.stream(tag8Key.split(",")).toList();
|
||||
}
|
||||
String tag9Key = tagReq.getTag9();
|
||||
if (StringUtils.isNotBlank(tag9Key)) {
|
||||
tag9KeyList = Arrays.stream(tag9Key.split(",")).toList();
|
||||
}
|
||||
String tag10Key = tagReq.getTag10();
|
||||
if (StringUtils.isNotBlank(tag10Key)) {
|
||||
tag10KeyList = Arrays.stream(tag10Key.split(",")).toList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
String taskNodeId = tagReq.getTaskId();
|
||||
List<SpdmAnalysisTaskVo> taskVoList;
|
||||
List<SpdmAnalysisTaskVo> allTaskVoList = new ArrayList<>();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("total", 0);
|
||||
if (StringUtils.isNotBlank(taskNodeId)) {
|
||||
allTaskVoList = mapper.getAnalysisTask(taskNodeId);
|
||||
} else {
|
||||
taskVoList = mapper.taskListByTag(req, tenantId, new ArrayList<>(), pos, limit,userId,
|
||||
tag1KeyList,tag2KeyList,tag3KeyList,tag4KeyList,tag5KeyList,tag6KeyList,tag7KeyList
|
||||
,tag8KeyList,tag9KeyList,tag10KeyList);
|
||||
if (CollectionUtils.isEmpty(taskVoList)) {
|
||||
log.error("数据分析中未查询到任务信息");
|
||||
jsonObject.put("data", new ArrayList<>());
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
allTaskVoList = taskVoList;
|
||||
}
|
||||
if (CollectionUtils.isEmpty(allTaskVoList)) {
|
||||
log.error("数据分析中未查询到任务信息");
|
||||
jsonObject.put("data", new ArrayList<>());
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
jsonObject.put("total", allTaskVoList.size());
|
||||
taskVoList = allTaskVoList.stream().skip((long) (req.getCurrent() - 1) * req.getSize()).limit(req.getSize()).toList();
|
||||
if (CollectionUtils.isEmpty(taskVoList)) {
|
||||
log.error("数据分析中未查询到任务信息");
|
||||
jsonObject.put("data", new ArrayList<>());
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
List<String> allNodeIdList = new ArrayList<>();
|
||||
for (SpdmAnalysisTaskVo spdmAnalysisTaskVo : taskVoList) {
|
||||
String tag1 = spdmAnalysisTaskVo.getTag1();
|
||||
if (StringUtils.isNotBlank(tag1)) {
|
||||
allNodeIdList.addAll(Arrays.stream(tag1.split(",")).toList());
|
||||
}
|
||||
String tag2 = spdmAnalysisTaskVo.getTag2();
|
||||
if (StringUtils.isNotBlank(tag2)) {
|
||||
allNodeIdList.addAll(Arrays.stream(tag2.split(",")).toList());
|
||||
}
|
||||
String tag3 = spdmAnalysisTaskVo.getTag3();
|
||||
if (StringUtils.isNotBlank(tag3)) {
|
||||
allNodeIdList.addAll(Arrays.stream(tag3.split(",")).toList());
|
||||
}
|
||||
String tag4 = spdmAnalysisTaskVo.getTag4();
|
||||
if (StringUtils.isNotBlank(tag4)) {
|
||||
allNodeIdList.addAll(Arrays.stream(tag4.split(",")).toList());
|
||||
}
|
||||
String tag5 = spdmAnalysisTaskVo.getTag5();
|
||||
if (StringUtils.isNotBlank(tag5)) {
|
||||
allNodeIdList.addAll(Arrays.stream(tag5.split(",")).toList());
|
||||
}
|
||||
String tag6 = spdmAnalysisTaskVo.getTag6();
|
||||
if (StringUtils.isNotBlank(tag6)) {
|
||||
allNodeIdList.addAll(Arrays.stream(tag6.split(",")).toList());
|
||||
}
|
||||
String tag7 = spdmAnalysisTaskVo.getTag7();
|
||||
if (StringUtils.isNotBlank(tag7)) {
|
||||
allNodeIdList.addAll(Arrays.stream(tag7.split(",")).toList());
|
||||
}
|
||||
String tag8 = spdmAnalysisTaskVo.getTag8();
|
||||
if (StringUtils.isNotBlank(tag8)) {
|
||||
allNodeIdList.addAll(Arrays.stream(tag8.split(",")).toList());
|
||||
}
|
||||
String tag9 = spdmAnalysisTaskVo.getTag9();
|
||||
if (StringUtils.isNotBlank(tag9)) {
|
||||
allNodeIdList.addAll(Arrays.stream(tag9.split(",")).toList());
|
||||
}
|
||||
String tag10 = spdmAnalysisTaskVo.getTag10();
|
||||
if (StringUtils.isNotBlank(tag10)) {
|
||||
allNodeIdList.addAll(Arrays.stream(tag10.split(",")).toList());
|
||||
}
|
||||
}
|
||||
Map<String, ProjectNodePo> nodeMap = new HashMap<>();
|
||||
if (CollectionUtils.isNotEmpty(allNodeIdList)) {
|
||||
List<ProjectNodePo> allNodeList = projectMapper.getNodeListByNodeIdList(allNodeIdList);
|
||||
nodeMap = allNodeList.stream()
|
||||
.collect(Collectors.toMap(
|
||||
ProjectNodePo::getUuid, // key:取uuid
|
||||
Function.identity(), // value:取对象本身
|
||||
(existing, replacement) -> existing // 重复时保留已存在的(第一个)元素
|
||||
));
|
||||
}
|
||||
|
||||
// 设置仿真负责人
|
||||
List<String> taskIdList = taskVoList.stream().map(SpdmAnalysisTaskVo::getUuid).toList();
|
||||
List<TaskNodeMemberPo> taskNodeMemberPoList = projectMapper.queryTaskNodeMembersByNodeIdList(taskIdList);
|
||||
Map<String, List<TaskNodeMemberPo>> memberMap = new HashMap<>();
|
||||
Map<Long, String> cidUserMap = new HashMap<>();
|
||||
if (CollectionUtils.isNotEmpty(taskNodeMemberPoList)) {
|
||||
taskNodeMemberPoList = taskNodeMemberPoList.stream().filter(member -> MemberTypeEnum.PRINCIPAL.getCode().equals(member.getType())).toList();
|
||||
if (CollectionUtils.isNotEmpty(taskNodeMemberPoList)) {
|
||||
memberMap = taskNodeMemberPoList.stream().collect(Collectors.groupingBy(TaskNodeMemberPo::getTaskId));
|
||||
SdmResponse<List<CIDUserResp>> cidUserResp = sysUserFeignClient.listUserByIds(UserQueryReq.builder()
|
||||
.userIds(taskNodeMemberPoList.stream().map(TaskNodeMemberPo::getUserId).toList()).build());
|
||||
List<CIDUserResp> cidUserRespList;
|
||||
if (cidUserResp.isSuccess() && CollectionUtils.isNotEmpty(cidUserRespList = cidUserResp.getData())) {
|
||||
cidUserMap = cidUserRespList.stream().collect(Collectors.toMap(CIDUserResp::getUserId, CIDUserResp::getNickname));
|
||||
}
|
||||
}
|
||||
}
|
||||
ProjectNodePo eachProjectNodePo;
|
||||
List<TaskNodeMemberPo> eachTaskNodeMemberPoList;
|
||||
for (SpdmAnalysisTaskVo task : taskVoList) {
|
||||
eachProjectNodePo = nodeMap.get(task.getNodeId());
|
||||
ProjectNodePo phaseNode = nodeMap.get(task.getTag2());
|
||||
if (phaseNode != null) {
|
||||
task.setPhaseName(phaseNode.getNodeName());
|
||||
}
|
||||
ProjectNodePo projectNode = nodeMap.get(task.getTag1());
|
||||
if (projectNode != null) {
|
||||
task.setProjectName(projectNode.getNodeName());
|
||||
}
|
||||
if (eachProjectNodePo != null && NodeTypeEnum.DISCIPLINE.getValue().equals(eachProjectNodePo.getNodeType())) {
|
||||
task.setDisciplineName(eachProjectNodePo.getNodeName());
|
||||
}
|
||||
eachTaskNodeMemberPoList = memberMap.get(task.getUuid());
|
||||
if (CollectionUtils.isNotEmpty(eachTaskNodeMemberPoList) && MapUtils.isNotEmpty(cidUserMap)) {
|
||||
List<String> nickNameList = new ArrayList<>();
|
||||
for (TaskNodeMemberPo taskNodeMemberPo : eachTaskNodeMemberPoList) {
|
||||
String nickName = cidUserMap.get(taskNodeMemberPo.getUserId());
|
||||
if (StringUtils.isBlank(nickName)) {
|
||||
continue;
|
||||
}
|
||||
nickNameList.add(nickName);
|
||||
}
|
||||
task.setPMembers(String.join(",", nickNameList));
|
||||
}
|
||||
}
|
||||
jsonObject.put("currentPage", req.getCurrent());
|
||||
jsonObject.put("pageSize", req.getSize());
|
||||
jsonObject.put("data", taskVoList);
|
||||
return SdmResponse.success(jsonObject);
|
||||
}
|
||||
|
||||
public SdmResponse oldAnalysisTaskList(SpdmAnalysisTaskListReq req) {
|
||||
int pos = (req.getCurrent() - 1) * req.getSize();
|
||||
int limit = req.getSize();
|
||||
Long tenantId = ThreadLocalContext.getTenantId();
|
||||
Long userId = ThreadLocalContext.getUserId();
|
||||
String projectNodeId = req.getProjectNodeId();
|
||||
String phaseNodeId = req.getPhaseNodeId();
|
||||
String machineNodeId = req.getMachineNodeId();
|
||||
|
||||
@@ -1034,4 +1034,412 @@
|
||||
ORDER BY create_time ASC LIMIT #{offset}, #{pageSize}
|
||||
</select>
|
||||
|
||||
<select id="taskListByTag" resultType="com.sdm.project.model.vo.SpdmAnalysisTaskVo">
|
||||
SELECT st.*
|
||||
FROM simulation_task st
|
||||
LEFT JOIN simulation_task_member stm ON st.uuid = stm.task_id
|
||||
WHERE stm.user_id = #{userId}
|
||||
AND st.tenant_id = #{tenantId}
|
||||
<if test="allNodeIdList != null and allNodeIdList.size > 0">
|
||||
and st.node_id in (
|
||||
<foreach collection='allNodeIdList' item='nodeId' index='index' separator=','>
|
||||
#{nodeId}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="req.taskName != null and req.taskName != ''">
|
||||
<bind name="searchKey1" value="'%' + req.taskName + '%'"/>
|
||||
and st.task_name like #{searchKey1}
|
||||
</if>
|
||||
<if test="req.name != null and req.name != ''">
|
||||
<bind name="searchKey2" value="'%' + req.name + '%'"/>
|
||||
and st.task_name like #{searchKey2}
|
||||
</if>
|
||||
<if test="req.taskCode != null and req.taskCode != ''">
|
||||
<bind name="searchKey3" value="'%' + req.taskCode + '%'"/>
|
||||
and st.task_code like #{searchKey3}
|
||||
</if>
|
||||
<if test="req.days != null and req.days != ''">
|
||||
<bind name="searchKey4" value="'%' + req.days + '%'"/>
|
||||
and st.days like #{searchKey4}
|
||||
</if>
|
||||
<if test="req.realDays != null and req.realDays != ''">
|
||||
<bind name="searchKey5" value="'%' + req.realDays + '%'"/>
|
||||
and st.realDays like #{searchKey5}
|
||||
</if>
|
||||
<if test="req.standard != null and req.standard != ''">
|
||||
<bind name="searchKey6" value="'%' + req.standard + '%'"/>
|
||||
and st.standard like #{searchKey6}
|
||||
</if>
|
||||
<if test="req.status != null and req.status != ''">
|
||||
and st.status = #{req.status}
|
||||
</if>
|
||||
<if test="req.achieveStatus != null and req.achieveStatus != ''">
|
||||
and st.achieve_status = #{req.achieveStatus}
|
||||
</if>
|
||||
<if test="req.progress != null and req.progress != ''">
|
||||
<bind name="searchKey7" value="'%' + req.progress + '%'"/>
|
||||
and st.progress like #{searchKey7}
|
||||
</if>
|
||||
<if test="req.exeStatus != null and req.exeStatus != ''">
|
||||
and st.exe_status like #{req.exeStatus}
|
||||
</if>
|
||||
<if test="req.confidence != null and req.confidence != ''">
|
||||
<bind name="searchKey8" value="'%' + req.confidence + '%'"/>
|
||||
and st.confidence like #{searchKey8}
|
||||
</if>
|
||||
<if test="req.analyseTarget != null and req.analyseTarget != ''">
|
||||
<bind name="searchKey9" value="'%' + req.analyseTarget + '%'"/>
|
||||
and st.analyse_target like #{searchKey9}
|
||||
</if>
|
||||
<if test="req.analyseSoftware != null and req.analyseSoftware != ''">
|
||||
<bind name="searchKey10" value="'%' + req.analyseSoftware + '%'"/>
|
||||
and st.analyse_software like #{searchKey10}
|
||||
</if>
|
||||
<if test="req.approvalStatus != null and req.approvalStatus != ''">
|
||||
and st.approvalStatus = #{req.approvalStatus}
|
||||
</if>
|
||||
<if test="req.comfirmStatus != null and req.comfirmStatus != ''">
|
||||
<bind name="searchKey11" value="'%' + req.comfirmStatus + '%'"/>
|
||||
and st.comfirm_status like #{searchKey11}
|
||||
</if>
|
||||
<if test="req.difficult != null and req.difficult != ''">
|
||||
and st.difficult = #{req.difficult}
|
||||
</if>
|
||||
<if test="req.department != null and req.department != ''">
|
||||
<bind name="searchKey12" value="'%' + req.department + '%'"/>
|
||||
and st.department like #{searchKey12}
|
||||
</if>
|
||||
<if test="req.sectionName != null and req.sectionName != ''">
|
||||
<bind name="searchKey13" value="'%' + req.sectionName + '%'"/>
|
||||
and st.sectionName like #{searchKey13}
|
||||
</if>
|
||||
<if test="req.groupName != null and req.groupName != ''">
|
||||
<bind name="searchKey14" value="'%' + req.groupName + '%'"/>
|
||||
and st.groupName like #{searchKey14}
|
||||
</if>
|
||||
<if test="req.bCapacity != null and req.bCapacity != ''">
|
||||
<bind name="searchKey15" value="'%' + req.bCapacity + '%'"/>
|
||||
and st.bCapacity like #{searchKey15}
|
||||
</if>
|
||||
<if test="req.flowTemplate != null and req.flowTemplate != ''">
|
||||
<bind name="searchKey16" value="'%' + req.flowTemplate + '%'"/>
|
||||
and st.flowTemplate like #{searchKey16}
|
||||
</if>
|
||||
<if test="req.demandId != null and req.demandId != ''">
|
||||
and st.demandId = #{req.demandId}
|
||||
</if>
|
||||
<if test="req.cidFlowId != null and req.cidFlowId != ''">
|
||||
and st.cidFlowId = #{req.cidFlowId}
|
||||
</if>
|
||||
<if test="req.imageFileId != null and req.imageFileId != ''">
|
||||
and st.imageFileId = #{req.imageFileId}
|
||||
</if>
|
||||
|
||||
<if test="req.expStatus != null and req.expStatus != ''">
|
||||
and st.expStatus = #{req.expStatus}
|
||||
</if>
|
||||
<if test="req.discipline != null and req.discipline != ''">
|
||||
<bind name="searchKey17" value="'%' + req.discipline + '%'"/>
|
||||
and st.discipline like #{searchKey17}
|
||||
</if>
|
||||
<if test="req.reportTemplate != null and req.reportTemplate != ''">
|
||||
<bind name="searchKey18" value="'%' + req.reportTemplate + '%'"/>
|
||||
and st.reportTemplate like #{searchKey18}
|
||||
</if>
|
||||
<if test="req.reportContent != null and req.reportContent != ''">
|
||||
<bind name="searchKey19" value="'%' + req.reportContent + '%'"/>
|
||||
and st.reportContent like #{searchKey19}
|
||||
</if>
|
||||
|
||||
<if test="req.beginTime != null and req.beginTime != ''">
|
||||
<![CDATA[
|
||||
and STR_TO_DATE(st.begin_time,'%Y-%m-%d %H:%i:%s') >= #{req.beginTime}
|
||||
]]>
|
||||
</if>
|
||||
<if test="req.endTime != null and req.endTime != ''">
|
||||
<![CDATA[
|
||||
and STR_TO_DATE(st.end_time,'%Y-%m-%d %H:%i:%s') <= #{req.endTime}
|
||||
]]>
|
||||
</if>
|
||||
|
||||
<if test="tag1KeyList != null and tag1KeyList.size > 0">
|
||||
and st.tag1 in (
|
||||
<foreach collection='tag1KeyList' item='tag1Key' index='index' separator=','>
|
||||
#{tag1Key}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="tag2KeyList != null and tag2KeyList.size > 0">
|
||||
and st.tag2 in (
|
||||
<foreach collection='tag2KeyList' item='tag2Key' index='index' separator=','>
|
||||
#{tag2Key}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="tag3KeyList != null and tag3KeyList.size > 0">
|
||||
and st.tag3 in (
|
||||
<foreach collection='tag3KeyList' item='tag3Key' index='index' separator=','>
|
||||
#{tag3Key}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="tag4KeyList != null and tag4KeyList.size > 0">
|
||||
and st.tag4 in (
|
||||
<foreach collection='tag4KeyList' item='tag4Key' index='index' separator=','>
|
||||
#{tag4Key}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="tag5KeyList != null and tag5KeyList.size > 0">
|
||||
and st.tag5 in (
|
||||
<foreach collection='tag5KeyList' item='tag5Key' index='index' separator=','>
|
||||
#{tag5Key}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="tag6KeyList != null and tag6KeyList.size > 0">
|
||||
and st.tag6 in (
|
||||
<foreach collection='tag6KeyList' item='tag6Key' index='index' separator=','>
|
||||
#{tag6Key}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="tag7KeyList != null and tag7KeyList.size > 0">
|
||||
and st.tag7 in (
|
||||
<foreach collection='tag7KeyList' item='tag7Key' index='index' separator=','>
|
||||
#{tag7Key}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="tag8KeyList != null and tag8KeyList.size > 0">
|
||||
and st.tag8 in (
|
||||
<foreach collection='tag8KeyList' item='tag8Key' index='index' separator=','>
|
||||
#{tag8Key}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="tag9KeyList != null and tag9KeyList.size > 0">
|
||||
and st.tag9 in (
|
||||
<foreach collection='tag9KeyList' item='tag9Key' index='index' separator=','>
|
||||
#{tag9Key}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="tag10KeyList != null and tag10KeyList.size > 0">
|
||||
and st.tag10 in (
|
||||
<foreach collection='tag10KeyList' item='tag10Key' index='index' separator=','>
|
||||
#{tag10Key}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
|
||||
|
||||
|
||||
UNION
|
||||
|
||||
SELECT st.*
|
||||
FROM simulation_task st
|
||||
LEFT JOIN simulation_node_member snm ON st.tag1 = snm.nodeId
|
||||
WHERE snm.user_id = #{userId}
|
||||
AND st.tenant_id = #{tenantId}
|
||||
<if test="allNodeIdList != null and allNodeIdList.size > 0">
|
||||
and st.node_id in (
|
||||
<foreach collection='allNodeIdList' item='nodeId' index='index' separator=','>
|
||||
#{nodeId}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="req.taskName != null and req.taskName != ''">
|
||||
<bind name="searchKey1" value="'%' + req.taskName + '%'"/>
|
||||
and st.task_name like #{searchKey1}
|
||||
</if>
|
||||
<if test="req.name != null and req.name != ''">
|
||||
<bind name="searchKey2" value="'%' + req.name + '%'"/>
|
||||
and st.task_name like #{searchKey2}
|
||||
</if>
|
||||
|
||||
<if test="req.taskCode != null and req.taskCode != ''">
|
||||
<bind name="searchKey3" value="'%' + req.taskCode + '%'"/>
|
||||
and st.task_code like #{searchKey3}
|
||||
</if>
|
||||
<if test="req.days != null and req.days != ''">
|
||||
<bind name="searchKey4" value="'%' + req.days + '%'"/>
|
||||
and st.days like #{searchKey4}
|
||||
</if>
|
||||
<if test="req.realDays != null and req.realDays != ''">
|
||||
<bind name="searchKey5" value="'%' + req.realDays + '%'"/>
|
||||
and st.realDays like #{searchKey5}
|
||||
</if>
|
||||
<if test="req.standard != null and req.standard != ''">
|
||||
<bind name="searchKey6" value="'%' + req.standard + '%'"/>
|
||||
and st.standard like #{searchKey6}
|
||||
</if>
|
||||
<if test="req.status != null and req.status != ''">
|
||||
and st.status = #{req.status}
|
||||
</if>
|
||||
<if test="req.achieveStatus != null and req.achieveStatus != ''">
|
||||
and st.achieve_status = #{req.achieveStatus}
|
||||
</if>
|
||||
<if test="req.progress != null and req.progress != ''">
|
||||
<bind name="searchKey7" value="'%' + req.progress + '%'"/>
|
||||
and st.progress like #{searchKey7}
|
||||
</if>
|
||||
<if test="req.exeStatus != null and req.exeStatus != ''">
|
||||
and st.exe_status like #{req.exeStatus}
|
||||
</if>
|
||||
<if test="req.confidence != null and req.confidence != ''">
|
||||
<bind name="searchKey8" value="'%' + req.confidence + '%'"/>
|
||||
and st.confidence like #{searchKey8}
|
||||
</if>
|
||||
<if test="req.analyseTarget != null and req.analyseTarget != ''">
|
||||
<bind name="searchKey9" value="'%' + req.analyseTarget + '%'"/>
|
||||
and st.analyse_target like #{searchKey9}
|
||||
</if>
|
||||
<if test="req.analyseSoftware != null and req.analyseSoftware != ''">
|
||||
<bind name="searchKey10" value="'%' + req.analyseSoftware + '%'"/>
|
||||
and st.analyse_software like #{searchKey10}
|
||||
</if>
|
||||
<if test="req.approvalStatus != null and req.approvalStatus != ''">
|
||||
and st.approvalStatus = #{req.approvalStatus}
|
||||
</if>
|
||||
<if test="req.comfirmStatus != null and req.comfirmStatus != ''">
|
||||
<bind name="searchKey11" value="'%' + req.comfirmStatus + '%'"/>
|
||||
and st.comfirm_status like #{searchKey11}
|
||||
</if>
|
||||
<if test="req.difficult != null and req.difficult != ''">
|
||||
and st.difficult = #{req.difficult}
|
||||
</if>
|
||||
<if test="req.department != null and req.department != ''">
|
||||
<bind name="searchKey12" value="'%' + req.department + '%'"/>
|
||||
and st.department like #{searchKey12}
|
||||
</if>
|
||||
<if test="req.sectionName != null and req.sectionName != ''">
|
||||
<bind name="searchKey13" value="'%' + req.sectionName + '%'"/>
|
||||
and st.sectionName like #{searchKey13}
|
||||
</if>
|
||||
<if test="req.groupName != null and req.groupName != ''">
|
||||
<bind name="searchKey14" value="'%' + req.groupName + '%'"/>
|
||||
and st.groupName like #{searchKey14}
|
||||
</if>
|
||||
<if test="req.bCapacity != null and req.bCapacity != ''">
|
||||
<bind name="searchKey15" value="'%' + req.bCapacity + '%'"/>
|
||||
and st.bCapacity like #{searchKey15}
|
||||
</if>
|
||||
<if test="req.flowTemplate != null and req.flowTemplate != ''">
|
||||
<bind name="searchKey16" value="'%' + req.flowTemplate + '%'"/>
|
||||
and st.flowTemplate like #{searchKey16}
|
||||
</if>
|
||||
<if test="req.demandId != null and req.demandId != ''">
|
||||
and st.demandId = #{req.demandId}
|
||||
</if>
|
||||
<if test="req.cidFlowId != null and req.cidFlowId != ''">
|
||||
and st.cidFlowId = #{req.cidFlowId}
|
||||
</if>
|
||||
<if test="req.imageFileId != null and req.imageFileId != ''">
|
||||
and st.imageFileId = #{req.imageFileId}
|
||||
</if>
|
||||
|
||||
<if test="req.expStatus != null and req.expStatus != ''">
|
||||
and st.expStatus = #{req.expStatus}
|
||||
</if>
|
||||
<if test="req.discipline != null and req.discipline != ''">
|
||||
<bind name="searchKey17" value="'%' + req.discipline + '%'"/>
|
||||
and st.discipline like #{searchKey17}
|
||||
</if>
|
||||
<if test="req.reportTemplate != null and req.reportTemplate != ''">
|
||||
<bind name="searchKey18" value="'%' + req.reportTemplate + '%'"/>
|
||||
and st.reportTemplate like #{searchKey18}
|
||||
</if>
|
||||
<if test="req.reportContent != null and req.reportContent != ''">
|
||||
<bind name="searchKey19" value="'%' + req.reportContent + '%'"/>
|
||||
and st.reportContent like #{searchKey19}
|
||||
</if>
|
||||
|
||||
<if test="req.beginTime != null and req.beginTime != ''">
|
||||
<![CDATA[
|
||||
and STR_TO_DATE(st.begin_time,'%Y-%m-%d %H:%i:%s') >= #{req.beginTime}
|
||||
]]>
|
||||
</if>
|
||||
<if test="req.endTime != null and req.endTime != ''">
|
||||
<![CDATA[
|
||||
and STR_TO_DATE(st.end_time,'%Y-%m-%d %H:%i:%s') <= #{req.endTime}
|
||||
]]>
|
||||
</if>
|
||||
|
||||
<if test="tag1KeyList != null and tag1KeyList.size > 0">
|
||||
and st.tag1 in (
|
||||
<foreach collection='tag1KeyList' item='tag1Key' index='index' separator=','>
|
||||
#{tag1Key}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="tag2KeyList != null and tag2KeyList.size > 0">
|
||||
and st.tag2 in (
|
||||
<foreach collection='tag2KeyList' item='tag2Key' index='index' separator=','>
|
||||
#{tag2Key}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="tag3KeyList != null and tag3KeyList.size > 0">
|
||||
and st.tag3 in (
|
||||
<foreach collection='tag3KeyList' item='tag3Key' index='index' separator=','>
|
||||
#{tag3Key}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="tag4KeyList != null and tag4KeyList.size > 0">
|
||||
and st.tag4 in (
|
||||
<foreach collection='tag4KeyList' item='tag4Key' index='index' separator=','>
|
||||
#{tag4Key}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="tag5KeyList != null and tag5KeyList.size > 0">
|
||||
and st.tag5 in (
|
||||
<foreach collection='tag5KeyList' item='tag5Key' index='index' separator=','>
|
||||
#{tag5Key}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="tag6KeyList != null and tag6KeyList.size > 0">
|
||||
and st.tag6 in (
|
||||
<foreach collection='tag6KeyList' item='tag6Key' index='index' separator=','>
|
||||
#{tag6Key}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="tag7KeyList != null and tag7KeyList.size > 0">
|
||||
and st.tag7 in (
|
||||
<foreach collection='tag7KeyList' item='tag7Key' index='index' separator=','>
|
||||
#{tag7Key}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="tag8KeyList != null and tag8KeyList.size > 0">
|
||||
and st.tag8 in (
|
||||
<foreach collection='tag8KeyList' item='tag8Key' index='index' separator=','>
|
||||
#{tag8Key}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="tag9KeyList != null and tag9KeyList.size > 0">
|
||||
and st.tag9 in (
|
||||
<foreach collection='tag9KeyList' item='tag9Key' index='index' separator=','>
|
||||
#{tag9Key}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<if test="tag10KeyList != null and tag10KeyList.size > 0">
|
||||
and st.tag10 in (
|
||||
<foreach collection='tag10KeyList' item='tag10Key' index='index' separator=','>
|
||||
#{tag10Key}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
|
||||
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user