待办中心-查询完善。

This commit is contained in:
wangzhijiang
2022-10-27 15:13:39 +08:00
parent ed5354b8a6
commit 5c1f217dcb
2 changed files with 120 additions and 106 deletions
@@ -19,81 +19,102 @@
<sql id="BaseQuerySql">
<where>
(
pi.id IN (
SELECT
pid.process_info_id
FROM
process_info_detail pid
<where>
pid.user_id = #{params.currentUserId}
<if test="params.taskStatus != null and params.taskStatus != ''">
and pid.status = #{params.taskStatus}
</if>
</where>
)
)
<if test="params.projectName != null and params.projectName !=''">
and (
pni.project_name like CONCAT(CONCAT('%',#{params.projectName}),'%')
or pyni.year_name like CONCAT(CONCAT('%',#{params.projectName}),'%')
temp.project_name like CONCAT(CONCAT('%',#{params.projectName}),'%')
or temp.year_name like CONCAT(CONCAT('%',#{params.projectName}),'%')
)
</if>
<if test="params.serialNumber != null and params.serialNumber !=''">
and (
pli.serial_number like CONCAT(CONCAT('%',#{params.serialNumber}),'%')
)
<if test="params.standardInfo != null and params.standardInfo !=''">
and temp.standard_info like CONCAT(CONCAT('%',#{params.standardInfo}),'%')
</if>
<if test="params.flowType != null and params.flowType !=''">
and pi.flow_type = #{params.flowType}
and temp.flow_type = #{params.flowType}
</if>
<if test="params.status != null and params.status !=''">
and pi.status = #{params.status}
</if>
<if test="params.flowTypeList != null">
and pi.flow_type in
<foreach collection="params.flowTypeList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="params.createBy != null and params.createBy != ''">
and pi.create_by = #{params.createBy}
and temp.status = #{params.status}
</if>
</where>
</sql>
<select id="queryProjectProcessPageList" resultType="com.jero.modules.todoCenter.vo.ProcessInfoVO">
SELECT
pi.id,
pi.project_library_id,
pi.project_laws_inventory_id,
pi.buss_document_library_id,
pi.acti_proc_inst_id,
pni.project_name,
pyni.year_name,
pli.serial_number,
pli.title,
plb.title_en,
pi.flow_type,
createBy.username as "create_by",
pi.end_time,
(select detail.task_id from process_info_detail detail where detail.process_info_id = pi.id and detail.user_id = #{params.currentUserId} order by submit_time desc limit 1) as task_id,
(select detail.task_definition_key from process_info_detail detail where detail.process_info_id = pi.id and detail.user_id = #{params.currentUserId} order by submit_time desc limit 1) as task_definition_key,
pi.status,
pi.prc_num,
pi.prc_name,
plb.project_name_id,
plb.target_market,
plb.studio_engineer
FROM
process_info pi
left join project_library_base plb on plb.id = pi.project_library_id
left join project_name_info pni on pni.id = plb.project_name_id
left join project_year_name_info pyni on pyni.id = plb.year_name_id
left join project_laws_inventory pli on pi.project_laws_inventory_id = pli.id
LEFT JOIN sys_user createBy on createBy.id = pi.create_by
select temp.* from (
SELECT
pi.id,
pi.project_library_id,
pi.project_laws_inventory_id,
pi.buss_document_library_id,
pi.acti_proc_inst_id,
pni.project_name,
pyni.year_name,
pli.serial_number,
pli.title,
bdl.title_en,
<if test="params.cut == 'cn'">
concat(pli.serial_number,'、',pli.title) as standard_info,
</if>
<if test="params.cut == 'en'">
concat(pli.serial_number,'、',bdl.title_en) as standard_info,
</if>
pi.flow_type,
createBy.username as "create_by",
pi.end_time,
(
select
detail.task_id
from
process_info_detail detail
where detail.process_info_id = pi.id and detail.user_id = #{params.currentUserId} order by submit_time desc limit 1
) as task_id,
(
select
detail.task_definition_key
from
process_info_detail detail
where detail.process_info_id = pi.id and detail.user_id = #{params.currentUserId} order by submit_time desc limit 1
) as task_definition_key,
pi.status,
pi.prc_num,
pi.prc_name,
plb.project_name_id,
plb.target_market,
plb.studio_engineer
FROM
process_info pi
left join project_library_base plb on plb.id = pi.project_library_id
left join project_name_info pni on pni.id = plb.project_name_id
left join project_year_name_info pyni on pyni.id = plb.year_name_id
left join project_laws_inventory pli on pi.project_laws_inventory_id = pli.id
LEFT JOIN sys_user createBy on createBy.id = pi.create_by
LEFT JOIN buss_document_library bdl ON pi.buss_document_library_id = bdl.id
<where>
and pi.id IN (
SELECT
pid.process_info_id
FROM
process_info_detail pid
<where>
pid.user_id = #{params.currentUserId}
<if test="params.taskStatus != null and params.taskStatus != ''">
and pid.status = #{params.taskStatus}
</if>
</where>
)
<if test="params.flowTypeList != null">
and pi.flow_type in
<foreach collection="params.flowTypeList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="params.queryType == 'issuedProcess'">
<if test="params.createBy != null and params.createBy != ''">
and pi.create_by = #{params.createBy}
</if>
</if>
</where>
) temp
<include refid="BaseQuerySql"/>
order by pi.end_time desc
order by temp.end_time desc
</select>
<select id="queryProjectProcessTodoTaskListList" resultType="com.jero.modules.todoCenter.vo.ProcessInfoVO">
select temp.* from (
@@ -107,12 +128,30 @@
pyni.year_name,
pli.serial_number,
pli.title,
plb.title_en,
bdl.title_en,
<if test="params.cut == 'cn'">
concat(pli.serial_number,'、',pli.title) as standard_info,
</if>
<if test="params.cut == 'en'">
concat(pli.serial_number,'、',bdl.title_en) as standard_info,
</if>
pi.flow_type,
createBy.username AS "create_by",
pi.end_time,
(select detail.task_id from process_info_detail detail where detail.process_info_id = pi.id and detail.user_id = #{params.currentUserId} and detail.`status` = 'NotDone' limit 1) as task_id,
(select detail.task_definition_key from process_info_detail detail where detail.process_info_id = pi.id and detail.user_id = #{params.currentUserId} and detail.`status` = 'NotDone' limit 1) as task_definition_key,
(
select
detail.task_id
from
process_info_detail detail
where detail.process_info_id = pi.id and detail.user_id = #{params.currentUserId} and detail.`status` = 'NotDone' limit 1
) as task_id,
(
select
detail.task_definition_key
from
process_info_detail detail
where detail.process_info_id = pi.id and detail.user_id = #{params.currentUserId} and detail.`status` = 'NotDone' limit 1
) as task_definition_key,
pi.STATUS,
pi.prc_num,
pi.prc_name,
@@ -126,6 +165,7 @@
LEFT JOIN project_year_name_info pyni ON pyni.id = plb.year_name_id
LEFT JOIN project_laws_inventory pli ON pi.project_laws_inventory_id = pli.id
LEFT JOIN sys_user createBy ON createBy.id = pi.create_by
LEFT JOIN buss_document_library bdl ON pi.buss_document_library_id = bdl.id
where
(
pi.id IN (
@@ -133,8 +173,7 @@
pid.process_info_id
FROM
process_info_detail pid
where
pid.user_id = #{params.currentUserId} and pid.status = #{params.taskStatus}
where pid.user_id = #{params.currentUserId} and pid.status = #{params.taskStatus}
)
)
AND pi.flow_type IN
@@ -151,11 +190,18 @@
pni.project_name,
pyni.year_name,
'--' as serial_number,
'--' as standard_info,
'' as title,
'' as title_en,
pi.flow_type,
createBy.username AS "create_by",
(select pid.end_time from process_info_detail pid where pid.process_info_id = pi.id and pid.STATUS = 'NotDone' order by pid.end_time asc limit 1) as end_time,
(
select
pid.end_time
from
process_info_detail pid
where pid.process_info_id = pi.id and pid.STATUS = 'NotDone' order by pid.end_time asc limit 1
) as end_time,
'' as task_id,
'' as task_definition_key,
pi.STATUS,
@@ -178,34 +224,12 @@
pid.process_info_id
FROM
process_info_detail pid
where
pid.user_id = #{params.currentUserId} and pid.status = #{params.taskStatus}
where pid.user_id = #{params.currentUserId} and pid.status = #{params.taskStatus}
)
)
AND pi.flow_type = #{params.qdqrFlowTypeValue}
)temp
<where>
<if test="params.projectName != null and params.projectName !=''">
and (
temp.project_name like CONCAT(CONCAT('%',#{params.projectName}),'%')
or temp.year_name like CONCAT(CONCAT('%',#{params.projectName}),'%')
)
</if>
<if test="params.serialNumber != null and params.serialNumber !=''">
and (
temp.serial_number like CONCAT(CONCAT('%',#{params.serialNumber}),'%')
)
</if>
<if test="params.flowType != null and params.flowType !=''">
and temp.flow_type = #{params.flowType}
</if>
<if test="params.status != null and params.status !=''">
and temp.status = #{params.status}
</if>
<if test="params.createBy != null and params.createBy != ''">
and temp.create_by = #{params.createBy}
</if>
</where>
<include refid="BaseQuerySql"/>
order by temp.end_time asc
</select>
<select id="queryLawsAssessPageList" resultType="com.jero.modules.todoCenter.vo.ProcessInfoVO">
@@ -232,8 +256,7 @@
detail.task_id
from
process_info_detail detail
where detail.process_info_id = pi.id
and detail.user_id = #{params.currentUserId}
where detail.process_info_id = pi.id and detail.user_id = #{params.currentUserId}
<if test="params.queryType == 'todoProcess'">
and detail.`status` = #{params.taskStatus}
</if>
@@ -245,8 +268,7 @@
detail.task_definition_key
from
process_info_detail detail
where detail.process_info_id = pi.id
and detail.user_id = #{params.currentUserId}
where detail.process_info_id = pi.id and detail.user_id = #{params.currentUserId}
<if test="params.queryType == 'todoProcess'">
and detail.`status` = #{params.taskStatus}
</if>
@@ -275,22 +297,13 @@
pid.process_info_id
FROM
process_info_detail pid
where
pid.user_id = #{params.currentUserId}
and pid.status = #{params.taskStatus}
where pid.user_id = #{params.currentUserId} and pid.status = #{params.taskStatus}
)
)
</if>
</where>
) temp
<where>
<if test="params.standardInfo != null and params.standardInfo != ''">
and temp.standard_info like CONCAT(CONCAT('%',#{params.standardInfo}),'%')
</if>
<if test="params.flowType != null and params.flowType !=''">
and temp.flow_type = #{params.flowType}
</if>
</where>
<include refid="BaseQuerySql"/>
<if test="params.queryType == 'todoProcess' ">
order by temp.end_time asc
</if>
@@ -237,6 +237,7 @@ public class ProcessInfoEOServiceImpl extends ServiceImpl<ProcessInfoEOMapper, P
this.setFlowTypeList(flowTypeList);
params.put("flowTypeList",flowTypeList);
params.put("currentUserId",currentUser.getId());
params.put("queryType","issuedProcess");
IPage page = new Page(pageNo, pageSize);
IPage<ProcessInfoVO> result = this.baseMapper.queryProjectProcessPageList(page,params);