2022-09-16 15:07:17 +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.rzyc.mapper.OATaskMapper">
|
|
|
|
|
<resultMap id="BaseResultMap" type="com.rzyc.model.OATask">
|
|
|
|
|
<id column="OATaskId" jdbcType="VARCHAR" property="oataskid" />
|
|
|
|
|
<result column="TaskType" jdbcType="VARCHAR" property="tasktype" />
|
2022-09-20 14:54:58 +08:00
|
|
|
<result column="OTCId" jdbcType="VARCHAR" property="otcid" />
|
2022-09-16 15:07:17 +08:00
|
|
|
<result column="SysPercent" jdbcType="INTEGER" property="syspercent" />
|
|
|
|
|
<result column="StartDate" jdbcType="TIMESTAMP" property="startdate" />
|
|
|
|
|
<result column="EndDate" jdbcType="TIMESTAMP" property="enddate" />
|
|
|
|
|
<result column="PlanEndDate" jdbcType="TIMESTAMP" property="planenddate" />
|
|
|
|
|
<result column="AppStatus" jdbcType="VARCHAR" property="appstatus" />
|
|
|
|
|
<result column="Subject" jdbcType="VARCHAR" property="subject" />
|
|
|
|
|
<result column="Frequency" jdbcType="BIGINT" property="frequency" />
|
|
|
|
|
<result column="IsFinish" jdbcType="VARCHAR" property="isfinish" />
|
|
|
|
|
<result column="RedAlert" jdbcType="VARCHAR" property="redAlert" />
|
|
|
|
|
<result column="YellowAlert" jdbcType="VARCHAR" property="yellowAlert" />
|
|
|
|
|
<result column="totalFrequency" jdbcType="BIGINT" property="totalFrequency" />
|
|
|
|
|
<result column="CreatedOn" jdbcType="TIMESTAMP" property="createdon" />
|
|
|
|
|
<result column="CreatedBy" jdbcType="VARCHAR" property="createdby" />
|
|
|
|
|
<result column="ModifiedOn" jdbcType="TIMESTAMP" property="modifiedon" />
|
|
|
|
|
<result column="ModifiedBy" jdbcType="VARCHAR" property="modifiedby" />
|
|
|
|
|
</resultMap>
|
2022-09-20 14:54:58 +08:00
|
|
|
|
|
|
|
|
|
2022-09-16 15:07:17 +08:00
|
|
|
<sql id="Base_Column_List">
|
2022-09-20 14:54:58 +08:00
|
|
|
OATaskId, TaskType,OTCId,send_id,SysPercent,
|
|
|
|
|
StartDate, EndDate, PlanEndDate, AppStatus, title,Subject, Frequency,
|
|
|
|
|
IsFinish, CreatedOn, CreatedBy,
|
2022-09-16 15:07:17 +08:00
|
|
|
ModifiedOn, ModifiedBy
|
|
|
|
|
</sql>
|
2022-09-20 14:54:58 +08:00
|
|
|
|
2022-09-16 15:07:17 +08:00
|
|
|
<insert id="insert" parameterType="com.rzyc.model.OATask">
|
2022-09-20 14:54:58 +08:00
|
|
|
insert into OATask (OATaskId, TaskType,OTCId,send_id,
|
|
|
|
|
SysPercent,
|
2022-09-16 15:07:17 +08:00
|
|
|
StartDate, EndDate, PlanEndDate,
|
2022-09-20 14:54:58 +08:00
|
|
|
AppStatus,title, Subject, AttachmentFlag,Frequency,
|
2022-09-16 15:07:17 +08:00
|
|
|
Priority, IsFinish, OALabel,
|
|
|
|
|
LinkedUrl, ReadBack, OTCId,del_state,
|
|
|
|
|
OTCType, CreatedOn, CreatedBy,
|
|
|
|
|
ModifiedOn, ModifiedBy, DocBody
|
|
|
|
|
)
|
2022-09-20 14:54:58 +08:00
|
|
|
values (#{oataskid,jdbcType=VARCHAR},
|
|
|
|
|
#{tasktype,jdbcType=VARCHAR},
|
|
|
|
|
#{otcid,jdbcType=VARCHAR},
|
|
|
|
|
#{sendId,jdbcType=VARCHAR},
|
|
|
|
|
#{syspercent,jdbcType=INTEGER},
|
2022-09-16 15:07:17 +08:00
|
|
|
#{startdate,jdbcType=TIMESTAMP}, #{enddate,jdbcType=TIMESTAMP}, #{planenddate,jdbcType=TIMESTAMP},
|
2022-09-20 14:54:58 +08:00
|
|
|
#{appstatus,jdbcType=VARCHAR},
|
|
|
|
|
#{title,jdbcType=VARCHAR},
|
|
|
|
|
#{subject,jdbcType=VARCHAR},
|
2022-09-16 15:07:17 +08:00
|
|
|
#{frequency,jdbcType=BIGINT},
|
2022-09-20 14:54:58 +08:00
|
|
|
#{isfinish,jdbcType=VARCHAR},
|
|
|
|
|
#{delState,jdbcType=VARCHAR},#{createdon,jdbcType=TIMESTAMP}, #{createdby,jdbcType=VARCHAR},
|
|
|
|
|
#{modifiedon,jdbcType=TIMESTAMP}, #{modifiedby,jdbcType=VARCHAR}
|
2022-09-16 15:07:17 +08:00
|
|
|
)
|
|
|
|
|
</insert>
|
2022-09-20 14:54:58 +08:00
|
|
|
|
2022-09-16 15:07:17 +08:00
|
|
|
|
|
|
|
|
<!--任务列表-->
|
|
|
|
|
<resultMap id="TaskResultMap" type="com.rzyc.model.OATask">
|
|
|
|
|
<id column="OATaskId" jdbcType="VARCHAR" property="oataskid" />
|
|
|
|
|
<result column="TaskType" jdbcType="VARCHAR" property="tasktype" />
|
2022-09-20 14:54:58 +08:00
|
|
|
<result column="OTCId" jdbcType="VARCHAR" property="otcid" />
|
2022-09-16 15:07:17 +08:00
|
|
|
<result column="SysPercent" jdbcType="INTEGER" property="syspercent" />
|
|
|
|
|
<result column="StartDate" jdbcType="TIMESTAMP" property="startdate" />
|
|
|
|
|
<result column="EndDate" jdbcType="TIMESTAMP" property="enddate" />
|
|
|
|
|
<result column="PlanEndDate" jdbcType="TIMESTAMP" property="planenddate" />
|
|
|
|
|
<result column="AppStatus" jdbcType="VARCHAR" property="appstatus" />
|
|
|
|
|
<result column="Subject" jdbcType="VARCHAR" property="subject" />
|
|
|
|
|
<result column="Frequency" jdbcType="BIGINT" property="frequency" />
|
|
|
|
|
<result column="totalFrequency" jdbcType="BIGINT" property="totalFrequency" />
|
|
|
|
|
<result column="IsFinish" jdbcType="VARCHAR" property="isfinish" />
|
|
|
|
|
<result column="RedAlert" jdbcType="VARCHAR" property="redAlert" />
|
|
|
|
|
<result column="YellowAlert" jdbcType="VARCHAR" property="yellowAlert" />
|
|
|
|
|
<result column="CreatedOn" jdbcType="TIMESTAMP" property="createdon" />
|
|
|
|
|
<result column="CreatedBy" jdbcType="VARCHAR" property="createdby" />
|
|
|
|
|
<result column="ModifiedOn" jdbcType="TIMESTAMP" property="modifiedon" />
|
|
|
|
|
<result column="ModifiedBy" jdbcType="VARCHAR" property="modifiedby" />
|
|
|
|
|
<result column="checkNum" jdbcType="BIGINT" property="checkNum" />
|
|
|
|
|
<result column="AppStatus" jdbcType="VARCHAR" property="appstatus" />
|
|
|
|
|
<result column="ChinaName" jdbcType="VARCHAR" property="sendName" />
|
|
|
|
|
<result column="taskStatus" jdbcType="VARCHAR" property="taskStatus" />
|
|
|
|
|
<result column="UnitName" jdbcType="VARCHAR" property="unitName" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<!--发布任务列表-->
|
|
|
|
|
<select id="sendTaskPage" resultMap="TaskResultMap">
|
|
|
|
|
SELECT
|
|
|
|
|
su.`ChinaName`,
|
|
|
|
|
(SELECT COUNT(*) FROM OADistribution ob WHERE ob.OATaskId = ot.OATaskId AND ob.AppStatus = '已读') checkNum,
|
|
|
|
|
ot.*
|
|
|
|
|
FROM OATask ot
|
|
|
|
|
left join SysUser su on su.SysUserId = ot.`CreatedBy`
|
|
|
|
|
WHERE ot.`TaskPerson` = #{sysUserId}
|
|
|
|
|
AND ot.`Subject` LIKE #{condition}
|
|
|
|
|
<foreach collection ="entTasks" item="entTask" index= "index" >
|
|
|
|
|
AND ot.TaskType != #{entTask}
|
|
|
|
|
</foreach>
|
|
|
|
|
and ot.del_state = 1
|
|
|
|
|
ORDER BY ot.CreatedOn DESC
|
|
|
|
|
LIMIT #{start},#{end};
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!--发布任务总数-->
|
|
|
|
|
<select id="countSendTask" resultType="java.lang.Long">
|
|
|
|
|
SELECT
|
|
|
|
|
count(*)
|
|
|
|
|
FROM OATask ot
|
|
|
|
|
WHERE ot.`TaskPerson` = #{sysUserId}
|
|
|
|
|
AND ot.`Subject` LIKE #{condition}
|
|
|
|
|
<foreach collection ="entTasks" item="entTask" index= "index" >
|
|
|
|
|
AND ot.TaskType != #{entTask}
|
|
|
|
|
</foreach>
|
|
|
|
|
and ot.del_state = 1
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!--接收任务列表-->
|
|
|
|
|
<select id="receiveTaskPage" resultMap="TaskResultMap">
|
|
|
|
|
SELECT lf.PerformClassName ChinaName,ob.`AppStatus` taskStatus,
|
|
|
|
|
lt.RedAlert,lt.YellowAlert,
|
|
|
|
|
lt.Frequency totalFrequency,ot.*
|
|
|
|
|
FROM OATask ot
|
|
|
|
|
LEFT JOIN OADistribution ob ON ob.`OATaskId` = ot.`OATaskId`
|
|
|
|
|
LEFT JOIN SysUser su ON su.`SysUserId` = ot.`TaskPerson`
|
|
|
|
|
left join ListPerform lf on su.SysTitle = lf.ListPerformId
|
|
|
|
|
left join ListFactor lt on ot.OTCId = lt.listFactorId
|
|
|
|
|
WHERE ot.`Subject` LIKE '%%'
|
|
|
|
|
and ot.del_state = 1
|
|
|
|
|
<if test="null != tasktype and '' != tasktype " >
|
|
|
|
|
<if test=" '履职任务' == tasktype">
|
|
|
|
|
AND (ot.TaskType is null or ot.TaskType = '履职任务')
|
|
|
|
|
AND ot.StartDate <= #{startTime}
|
|
|
|
|
AND (ot.IsFinish IS NULL OR ot.IsFinish = '否')
|
|
|
|
|
and lt.del_state = 1
|
|
|
|
|
</if>
|
|
|
|
|
<if test=" '履职任务' != tasktype">
|
|
|
|
|
AND ot.TaskType = #{tasktype}
|
|
|
|
|
</if>
|
|
|
|
|
</if>
|
|
|
|
|
AND (ob.`SysUserId` IN (
|
|
|
|
|
<foreach collection ="sysUserIds" item="sysUserId" index= "index" separator =",">
|
|
|
|
|
#{sysUserId}
|
|
|
|
|
</foreach>
|
|
|
|
|
)
|
|
|
|
|
<if test="null != otcIds and otcIds.size > 0 ">
|
|
|
|
|
OR ot.OTCId IN (
|
|
|
|
|
<foreach collection ="otcIds" item="otcId" index= "index" separator =",">
|
|
|
|
|
#{otcId}
|
|
|
|
|
</foreach>
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
)
|
|
|
|
|
AND ot.`OATaskId` IS NOT NULL
|
|
|
|
|
ORDER BY ot.OTCId ASC ,ot.`StartDate` DESC
|
|
|
|
|
LIMIT #{start},#{end};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!--接收任务列表-->
|
|
|
|
|
<select id="countReceiveTask" resultType="java.lang.Long">
|
|
|
|
|
SELECT count(*) FROM OATask ot
|
|
|
|
|
LEFT JOIN OADistribution ob ON ob.`OATaskId` = ot.`OATaskId`
|
|
|
|
|
LEFT JOIN SysUser su ON su.`SysUserId` = ot.`CreatedBy`
|
|
|
|
|
WHERE ot.`Subject` LIKE '%%'
|
|
|
|
|
and ot.del_state = 1
|
|
|
|
|
<if test="null != tasktype and '' != tasktype " >
|
|
|
|
|
<if test=" '履职任务' == tasktype">
|
|
|
|
|
AND (ot.TaskType is null or ot.TaskType = '履职任务')
|
|
|
|
|
AND ot.StartDate <= #{startTime}
|
|
|
|
|
AND (ot.IsFinish IS NULL OR ot.IsFinish = '否')
|
|
|
|
|
</if>
|
|
|
|
|
<if test=" '履职任务' != tasktype">
|
|
|
|
|
AND ot.TaskType = #{tasktype}
|
|
|
|
|
</if>
|
|
|
|
|
</if>
|
|
|
|
|
AND (ob.`SysUserId` IN (
|
|
|
|
|
<foreach collection ="sysUserIds" item="sysUserId" index= "index" separator =",">
|
|
|
|
|
#{sysUserId}
|
|
|
|
|
</foreach>
|
|
|
|
|
)
|
|
|
|
|
<if test="null != otcIds and otcIds.size > 0 ">
|
|
|
|
|
OR ot.OTCId IN (
|
|
|
|
|
<foreach collection ="otcIds" item="otcId" index= "index" separator =",">
|
|
|
|
|
#{otcId}
|
|
|
|
|
</foreach>
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
)
|
|
|
|
|
AND ot.`OATaskId` IS NOT NULL
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!--通过otcid查询任务-->
|
|
|
|
|
<select id="findByOtcId" resultMap="TaskResultMap">
|
|
|
|
|
SELECT lt.Frequency totalFrequency,ot.* FROM `OATask` ot
|
|
|
|
|
left join ListFactor lt on ot.OTCId = lt.listFactorId
|
|
|
|
|
WHERE ot.OTCId IN (
|
|
|
|
|
<foreach collection ="otcIds" item="otcId" index= "index" separator =",">
|
|
|
|
|
#{otcId}
|
|
|
|
|
</foreach>
|
|
|
|
|
)
|
|
|
|
|
AND ot.StartDate <= NOW()
|
|
|
|
|
and ot.del_state = 1
|
|
|
|
|
and lf.del_state = 1
|
|
|
|
|
ORDER BY ot.OTCId ASC ,ot.`StartDate` DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!--修改任务完成状态-->
|
|
|
|
|
<update id="changeIsFinish">
|
|
|
|
|
UPDATE `OATask` SET IsFinish = '是' ,
|
|
|
|
|
EndDate = now()
|
|
|
|
|
WHERE OATaskId IN (
|
|
|
|
|
<foreach collection ="taskIds" item="taskId" index= "index" separator =",">
|
|
|
|
|
#{taskId}
|
|
|
|
|
</foreach>
|
|
|
|
|
)
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<!--任务详情-->
|
|
|
|
|
<select id="taskDetail" resultMap="TaskResultMap">
|
|
|
|
|
SELECT ob.`AppStatus` taskStatus,ot.* FROM OATask ot
|
|
|
|
|
LEFT JOIN `OADistribution` ob ON ot.OATaskId = ob.OATaskId
|
|
|
|
|
AND ob.SysUserId = #{sysUserId}
|
|
|
|
|
WHERE ot.OATaskId = #{taskId}
|
|
|
|
|
LIMIT 1;
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!--通过月份查询履职信息-->
|
|
|
|
|
<select id="findByMonths" resultMap="TaskResultMap">
|
|
|
|
|
SELECT * FROM `OATask` ot WHERE ot.`OTCId` = #{otcId}
|
|
|
|
|
AND ot.`TaskType` = '履职任务'
|
|
|
|
|
and ot.del_state = 1
|
|
|
|
|
AND (
|
|
|
|
|
<foreach collection ="times" item="time" index= "index" separator ="or">
|
|
|
|
|
ot.`StartDate` LIKE #{time}
|
|
|
|
|
</foreach>
|
|
|
|
|
)
|
|
|
|
|
;
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!--查询企业消息通知-->
|
|
|
|
|
<select id="findByEntId" resultMap="TaskResultMap">
|
|
|
|
|
SELECT su.`UnitName`,ot.* FROM OATask ot
|
|
|
|
|
LEFT JOIN SysUnit su ON su.sysunitid = ot.`TaskDepart`
|
|
|
|
|
WHERE ot.`OTCId` = #{entId}
|
|
|
|
|
and ot.del_state = 1
|
|
|
|
|
ORDER BY ot.`CreatedBy` DESC
|
|
|
|
|
LIMIT #{start},#{end};
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!--企业消息通知总数-->
|
|
|
|
|
<select id="countByEntId" resultType="java.lang.Long">
|
|
|
|
|
SELECT count(*) FROM OATask ot
|
|
|
|
|
WHERE ot.`OTCId` = #{entId}
|
|
|
|
|
and ot.del_state = 1
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!--修改履职任务-->
|
|
|
|
|
<update id="finshTask">
|
|
|
|
|
UPDATE `OATask` SET IsFinish = '是' ,
|
|
|
|
|
EndDate = NOW() WHERE `TaskType` = '履职任务'
|
|
|
|
|
AND `OTCId` = #{otcId}
|
|
|
|
|
AND `StartDate` <= #{time} AND `PlanEndDate` >= #{time};
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<!--批量导入任务-->
|
|
|
|
|
<insert id="insertList" parameterType="com.rzyc.model.OATask">
|
2022-09-20 14:54:58 +08:00
|
|
|
insert into OATask (OATaskId, TaskType,OTCId,send_id,
|
|
|
|
|
SysPercent,
|
2022-09-16 15:07:17 +08:00
|
|
|
StartDate, EndDate, PlanEndDate,
|
2022-09-20 14:54:58 +08:00
|
|
|
AppStatus, title,Subject,Frequency,
|
|
|
|
|
IsFinish,
|
|
|
|
|
del_state, CreatedOn, CreatedBy,
|
2022-09-16 15:07:17 +08:00
|
|
|
ModifiedOn, ModifiedBy, DocBody
|
|
|
|
|
)
|
|
|
|
|
values
|
|
|
|
|
<foreach collection="records" item="record" separator=",">
|
2022-09-20 14:54:58 +08:00
|
|
|
(#{record.oataskid,jdbcType=VARCHAR},
|
2022-09-16 15:07:17 +08:00
|
|
|
#{record.tasktype,jdbcType=VARCHAR},
|
2022-09-20 14:54:58 +08:00
|
|
|
#{record.otcid,jdbcType=VARCHAR},
|
|
|
|
|
#{record.sendId,jdbcType=VARCHAR},
|
2022-09-16 15:07:17 +08:00
|
|
|
#{record.syspercent,jdbcType=INTEGER},
|
|
|
|
|
#{record.startdate,jdbcType=TIMESTAMP}, #{record.enddate,jdbcType=TIMESTAMP},
|
|
|
|
|
#{record.planenddate,jdbcType=TIMESTAMP},
|
2022-09-20 14:54:58 +08:00
|
|
|
#{record.appstatus,jdbcType=VARCHAR},
|
|
|
|
|
#{record.title,jdbcType=VARCHAR},
|
|
|
|
|
#{record.subject,jdbcType=VARCHAR},
|
2022-09-16 15:07:17 +08:00
|
|
|
#{record.frequency,jdbcType=BIGINT},
|
2022-09-20 14:54:58 +08:00
|
|
|
#{record.isfinish,jdbcType=VARCHAR},
|
2022-09-16 15:07:17 +08:00
|
|
|
#{record.delState,jdbcType=VARCHAR},
|
2022-09-20 14:54:58 +08:00
|
|
|
#{record.createdon,jdbcType=TIMESTAMP},
|
2022-09-16 15:07:17 +08:00
|
|
|
#{record.createdby,jdbcType=VARCHAR},
|
2022-09-20 14:54:58 +08:00
|
|
|
#{record.modifiedon,jdbcType=TIMESTAMP}, #{record.modifiedby,jdbcType=VARCHAR}
|
2022-09-16 15:07:17 +08:00
|
|
|
)
|
|
|
|
|
</foreach>
|
|
|
|
|
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<!--修改任务完成进度-->
|
|
|
|
|
<update id="changeFrequency">
|
|
|
|
|
UPDATE `OATask`
|
|
|
|
|
SET
|
|
|
|
|
Frequency = #{frequency},
|
|
|
|
|
IsFinish = #{isFinish}
|
|
|
|
|
WHERE OATaskId = #{taskId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<!--需完成的任务列-->
|
|
|
|
|
<select id="findByOtcIdAndTime" resultMap="BaseResultMap">
|
|
|
|
|
select * from `OATask` ot
|
|
|
|
|
WHERE ot.`TaskType` = '履职任务'
|
|
|
|
|
and ot.del_state = 1
|
|
|
|
|
AND ot.`OTCId` = #{otcId}
|
|
|
|
|
AND (ot.IsFinish IS NULL OR ot.IsFinish = '否')
|
|
|
|
|
AND ot.`StartDate` <= #{time} AND ot.`PlanEndDate` >= #{time};
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--需完成的任务列-->
|
|
|
|
|
<select id="findByListPerformId" resultMap="BaseResultMap">
|
|
|
|
|
SELECT ot.*,
|
|
|
|
|
lf.RedAlert,lf.YellowAlert,
|
|
|
|
|
lf.Frequency totalFrequency
|
|
|
|
|
FROM `OATask` ot
|
|
|
|
|
LEFT JOIN ListFactor lf ON ot.`OTCId` = lf.`ListFactorId`
|
|
|
|
|
WHERE ot.`TaskType` = '履职任务'
|
|
|
|
|
and lf.del_state = 1
|
|
|
|
|
and ot.del_state = 1
|
|
|
|
|
AND lf.`ListPerformId` = #{listPerformId}
|
|
|
|
|
AND lf.`SysYear` = #{sysYear}
|
|
|
|
|
<if test="null != isFinish and '' != isFinish">
|
|
|
|
|
AND ot.IsFinish = #{isFinish}
|
|
|
|
|
</if>
|
|
|
|
|
AND ot.`StartDate` < #{time}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!--任务详情-->
|
|
|
|
|
<select id="findById" resultMap="BaseResultMap">
|
|
|
|
|
SELECT ot.* FROM `OATask` ot
|
|
|
|
|
WHERE ot.`OATaskId` = #{taskId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--未完成的履职任务-->
|
|
|
|
|
<select id="notFinishTask" resultMap="BaseResultMap">
|
|
|
|
|
SELECT * FROM OATask ot
|
|
|
|
|
WHERE ot.`TaskType` = '履职任务'
|
|
|
|
|
and ot.del_state = 1
|
|
|
|
|
AND ot.`OTCId` = #{otcId}
|
|
|
|
|
AND ot.`StartDate` < NOW()
|
|
|
|
|
AND ot.`IsFinish` = '否'
|
|
|
|
|
ORDER BY ot.`StartDate` DESC;
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--接收任务列表-->
|
|
|
|
|
<select id="receiveTaskPages" resultMap="TaskResultMap">
|
|
|
|
|
SELECT ob.`AppStatus` taskStatus,ot.*
|
|
|
|
|
FROM OATask ot
|
|
|
|
|
LEFT JOIN OADistribution ob ON ob.`OATaskId` = ot.`OATaskId`
|
|
|
|
|
LEFT JOIN SysUser su ON su.`SysUserId` = ot.`TaskPerson`
|
|
|
|
|
WHERE ot.`Subject` LIKE #{condition}
|
|
|
|
|
and ot.del_state = 1
|
|
|
|
|
<if test="null != tasktype and '' != tasktype " >
|
|
|
|
|
AND ot.TaskType = #{tasktype}
|
|
|
|
|
</if>
|
|
|
|
|
AND ob.`SysUserId` IN (
|
|
|
|
|
<foreach collection ="sysUserIds" item="sysUserId" index= "index" separator =",">
|
|
|
|
|
#{sysUserId}
|
|
|
|
|
</foreach>
|
|
|
|
|
)
|
|
|
|
|
AND ot.TaskType != '履职任务'
|
|
|
|
|
AND ot.`OATaskId` IS NOT NULL
|
|
|
|
|
ORDER BY ot.OTCId ASC ,ot.`StartDate` DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!--已完成事项-->
|
|
|
|
|
<select id="countComplete" resultType="java.lang.Integer">
|
|
|
|
|
SELECT count(*)
|
|
|
|
|
FROM `oatask` ot
|
|
|
|
|
LEFT JOIN listfactor lf ON ot.`OTCId` = lf.`ListFactorId`
|
|
|
|
|
WHERE ot.`TaskType` = '履职任务'
|
|
|
|
|
AND ot.`StartDate` <= NOW() AND ot.`IsFinish` = '是'
|
|
|
|
|
AND lf.`ListPerformId` = #{listPerformId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!--已超时事项-->
|
|
|
|
|
<select id="countOvertime" resultType="java.lang.Integer">
|
|
|
|
|
SELECT count(*)
|
|
|
|
|
FROM `oatask` ot
|
|
|
|
|
LEFT JOIN listfactor lf ON ot.`OTCId` = lf.`ListFactorId`
|
|
|
|
|
WHERE ot.`TaskType` = '履职任务'
|
|
|
|
|
AND ot.`PlanEndDate` <= NOW() AND ot.`IsFinish` = '否'
|
|
|
|
|
AND lf.`ListPerformId` = #{listPerformId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!--进行中事项-->
|
|
|
|
|
<select id="countConduct" resultType="java.lang.Integer">
|
|
|
|
|
SELECT count(*)
|
|
|
|
|
FROM `oatask` ot
|
|
|
|
|
LEFT JOIN listfactor lf ON ot.`OTCId` = lf.`ListFactorId`
|
|
|
|
|
WHERE ot.`TaskType` = '履职任务'
|
|
|
|
|
AND ot.`StartDate` <= NOW() AND ot.`PlanEndDate` >= NOW() AND ot.`IsFinish` = '否'
|
|
|
|
|
AND lf.`ListPerformId` = #{listPerformId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|