66 lines
3.2 KiB
XML
66 lines
3.2 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="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>
|