jhprjv2/ruoyi-quartz/src/main/resources/mapper/quartz/TaskMapper.xml

148 lines
6.9 KiB
XML
Raw Normal View History

2024-04-05 19:25:29 +08:00
<?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.ruoyi.quartz.mapper.TaskMapper">
2024-04-09 21:46:07 +08:00
<!--查询超时的代办任务流程-->
2024-04-05 19:25:29 +08:00
<select id="findDaysAwaitFlowTask" resultType="Map">
2024-04-09 21:46:07 +08:00
select fa.businessKey,fa.businessKeyName,fa.ASSIGNEE_,fa.USER_ID_,fa.GROUP_ID_,count(1) as total from vw_flow_await fa where fa.taskName !='提交申请' and fa.duration &gt; 4320 GROUP BY fa.businessKey,fa.businessKeyName,fa.ASSIGNEE_,fa.USER_ID_,fa.GROUP_ID_
</select>
<!--查询超时的代办举牌验收-->
<select id="findDaysAwaitJpysList" resultType="Map">
select spc.project_id as projectId,sp.projectName,spc.supervise_user as superviseUser,spc.supervise_user_name as superviseUserName, count(1) as total from sur_project_checking spc
left JOIN sur_project sp on sp.id = spc.project_id
where spc.approve_status=1 and spc.is_del=0 and spc.create_time &lt; DATE_SUB(NOW(),INTERVAL 3 DAY) GROUP BY spc.project_id,sp.projectName,spc.supervise_user,spc.supervise_user_name
ORDER BY spc.project_id
</select>
<!--查询超时的代办实测实量-->
<select id="findDaysAwaitScslList" resultType="Map">
select spc.project_id as projectId,sp.projectName,spc.supervise_user as superviseUser,spc.supervise_user_name as superviseUserName, count(1) as total from sur_project_measure spc
left JOIN sur_project sp on sp.id = spc.project_id
where spc.approve_status=1 and spc.is_del=0 and spc.create_time &lt; DATE_SUB(NOW(),INTERVAL 3 DAY) GROUP BY spc.project_id,sp.projectName,spc.supervise_user,spc.supervise_user_name
ORDER BY spc.project_id
</select>
<!--查询超时的代办取样复试-->
<select id="findDaysAwaitQyfsList" resultType="Map">
select spc.project_id as projectId,sp.projectName,spc.witness_user as witnessUser,spc.witness_user_name as witnessUserName, count(1) as total from sur_project_check_detection spc
left JOIN sur_project sp on sp.id = spc.project_id
where spc.approve_status=1 and spc.is_del=0 and spc.create_time &lt; DATE_SUB(NOW(),INTERVAL 3 DAY) GROUP BY spc.project_id,sp.projectName,spc.witness_user,spc.witness_user_name
ORDER BY spc.project_id
</select>
<!--查询超时的代办材料封样-->
<select id="findDaysAwaitClfyList" resultType="Map">
select spc.project_id as projectId,sp.projectName,spc.witness_user as witnessUser,spc.witness_user_name as witnessUserName, count(1) as total from sur_project_material_seal spc
left JOIN sur_project sp on sp.id = spc.project_id
where spc.approve_status=1 and spc.is_del=0 and spc.create_time &lt; DATE_SUB(NOW(),INTERVAL 3 DAY) GROUP BY spc.project_id,sp.projectName,spc.witness_user,spc.witness_user_name
ORDER BY spc.project_id
2024-04-05 19:25:29 +08:00
</select>
2024-04-10 11:57:13 +08:00
<!--查询超时未整改的隐患数据-->
<select id="findDaysAwaitYhzgList" resultType="Map">
SELECT
spc.projectid AS projectId,
sp.projectName,
spc.infotype,
spc.lordsentuser,
min(date(spc.nickedtime)) as minNickTime,
count(1) AS total
FROM
smz_ssp_problemmodify spc
LEFT JOIN sur_project sp ON sp.id = spc.projectid
WHERE
spc.checkstate in (0, 3)
AND spc.isdel = 0
AND spc.nickedtime &lt; DATE_SUB(NOW(), INTERVAL 1 DAY)
GROUP BY
spc.projectid,
sp.projectName,
spc.infotype,
spc.lordsentuser
ORDER BY
spc.projectid
</select>
<!--查询超时未复检的隐患数据-->
<select id="findDaysAwaitYhfjList" resultType="Map">
SELECT
spc.projectid AS projectId,
sp.projectName,
spc.infotype,
spc.rechecksenduser,
min(date(spc.nickedtime)) as minNickTime,
count(1) AS total
FROM
smz_ssp_problemmodify spc
LEFT JOIN sur_project sp ON sp.id = spc.projectid
WHERE
spc.checkstate = 1
AND spc.isdel = 0
AND spc.nickedtime &lt; DATE_SUB(NOW(), INTERVAL 1 DAY)
GROUP BY
spc.projectid,
sp.projectName,
spc.infotype,
spc.rechecksenduser
ORDER BY
spc.projectid
</select>
2024-04-05 19:25:29 +08:00
<select id="findFlowTaskUsers" resultType="com.ruoyi.common.core.domain.entity.SysUser">
select su.* from sys_user su
left join sur_project_userinfo spu on spu.user_id = su.user_id
left join sys_user_role sur on sur.user_id = su.user_id
where spu.project_id = #{businessKey}
<if test="candidateUsers !=null and candidateUsers.size()>0">
and su.user_id in
<foreach collection="candidateUsers" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="candidateGroups !=null and candidateGroups.size()>0">
and sur.role_id in
<foreach collection="candidateGroups" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</select>
<select id="findFlowTaskDeptUsers" resultType="com.ruoyi.common.core.domain.entity.SysUser">
select su.* from sys_user su
left join sys_dept sd on sd.dept_id = su.dept_id
left join sys_user_role sur on sur.user_id = su.user_id
where 1=1
<if test="candidateUsers !=null and candidateUsers.size()>0">
and su.user_id in
<foreach collection="candidateUsers" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="candidateGroups !=null and candidateGroups.size()>0">
and sur.role_id in
<foreach collection="candidateGroups" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
and EXISTS
(SELECT 1 FROM sur_project sp WHERE sp.id=#{businessKey} and (FIND_IN_SET(sp.deptId,sd.ancestors) or sp.deptId=sd.dept_id));
</select>
<select id="findSysUserOpenidsByUser" parameterType="String" resultType="Map">
select id, openId, msgOpenId, userId, loginName, nickname, isDel, creatTime, unionid from sys_user_openid where loginName = #{loginName} and isDel = 0
</select>
<!--查询项目甲方代表-->
<select id="findMsgProMagUsers" parameterType="Long" resultType="Map">
select suo.id, suo.openId, suo.msgOpenId, suo.userId, suo.loginName, suo.nickname, suo.isDel, suo.creatTime, suo.unionid
from sys_user_openid suo
left join sys_user su on su.phonenumber = suo.loginName
left join sur_project_userinfo spu on spu.user_id = su.user_id
where spu.project_id = #{proId} and spu.job_type=21 and spu.is_del = 0 and su.del_flag = '0' and suo.isDel=0
</select>
</mapper>