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 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 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 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 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
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
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 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}
and su.user_id in
#{item}
and sur.role_id in
#{item}
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
and su.user_id in
#{item}
and sur.role_id in
#{item}
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 id, openId, msgOpenId, userId, loginName, nickname, isDel, creatTime, unionid from sys_user_openid where loginName = #{loginName} and isDel = 0
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 max(id) from dev_tower_data_run where date(create_time)=${date}
delete from dev_tower_data_run where create_time CURDATE() - INTERVAL 15 DAY;
select * from dev_tower_data_run where id in (select max(r.id) from dev_tower_data_run r GROUP BY r.device_key)
update dev_tower_project_config set online = #{online} where device_sn=#{deviceSn}