164 lines
7.7 KiB
XML
164 lines
7.7 KiB
XML
<?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">
|
|
|
|
<!--查询超时的代办任务流程-->
|
|
<select id="findDaysAwaitFlowTask" resultType="Map">
|
|
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 > 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 < 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 < 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 < 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 < 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="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 < 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 < DATE_SUB(NOW(), INTERVAL 1 DAY)
|
|
GROUP BY
|
|
spc.projectid,
|
|
sp.projectName,
|
|
spc.infotype,
|
|
spc.rechecksenduser
|
|
ORDER BY
|
|
spc.projectid
|
|
</select>
|
|
|
|
<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>
|
|
|
|
<!--查询项目甲方代表-->
|
|
<select id="findTowerMaxIdByDate" parameterType="String" resultType="Integer">
|
|
select max(id) from dev_tower_data_run where date(create_time)=${date}
|
|
</select>
|
|
|
|
<delete id="deleteDevTowerDataRunByMaxId" parameterType="Long">
|
|
delete from dev_tower_data_run where create_time <![CDATA[ < ]]> CURDATE() - INTERVAL 15 DAY;
|
|
</delete>
|
|
|
|
<select id="findAllTowerMaxId" resultType="Map">
|
|
select * from dev_tower_data_run where id in (select max(r.id) from dev_tower_data_run r GROUP BY r.device_key)
|
|
</select>
|
|
|
|
<update id="updateTowerConfigOnline" parameterType="Map">
|
|
update dev_tower_project_config set online = #{online} where device_sn=#{deviceSn}
|
|
</update>
|
|
</mapper>
|