Files
faw-report-library-boot/report-activity/target/classes/mybatis/mapper/mysql/TaskMapper.xml
T
2023-05-08 10:34:12 +08:00

70 lines
3.5 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.adc.da.wkflow.business_main.mapper.TaskMapper">
<resultMap id="taskEntityMap" type="org.activiti.engine.task.TaskInfo">
<id property="id" column="ID_"/>
<result property="rev" column="REV_"/>
<result property="executionId" column="EXECUTION_ID_"/>
<result property="processInstanceId" column="PROC_INST_ID_"/>
<result property="processDefinitionId" column="PROC_DEF_ID_"/>
<result property="name" column="NAME_"/>
<result property="parentTaskId" column="PARENT_TASK_ID_"/>
<result property="description" column="DESCRIPTION_"/>
<result property="taskDefinitionKey" column="TASK_DEF_KEY_"/>
<result property="owner" column="OWNER_"/>
<result property="assignee" column="ASSIGNEE_"/>
<result property="delegation" column="DELEGATION_"/>
<result property="priority" column="PRIORITY_"/>
<result property="createTime" column="CREATE_TIME_" javaType="java.util.Date"/>
<result property="dueDate" column="DUE_DATE_" javaType="java.util.Date"/>
<result property="category" column="CATEGORY_"/>
<result property="suspensionState" column="SUSPENSION_STATE_"/>
<result property="tenantId" column="TENANT_ID_"/>
<result property="formKey" column="FORM_KEY_"/>
</resultMap>
<select id="todoTaskList" resultMap="taskEntityMap">
select distinct RES.* from ACT_RU_TASK RES
left join ACT_RU_IDENTITYLINK I on I.TASK_ID_ = RES.ID_
inner join ACT_RE_PROCDEF D on RES.PROC_DEF_ID_ = D.ID_
<where>
<if test="pageVO.name !='' and pageVO.name !=null">
and RES.NAME_ LIKE #{pageVO.name}
</if>
<if test="pageVO.startTime !='' and pageVO.startTime !=null">
and RES.CREATE_TIME_ >= #{pageVO.startTime}
</if>
<if test="pageVO.endTime !='' and pageVO.endTime !=null">
and RES.CREATE_TIME_ &lt; #{pageVO.endTime}
</if>
(RES.ASSIGNEE_=#{pageVO.userId} or (RES.ASSIGNEE_ is null and I.TYPE_ = 'candidate' and
(I.USER_ID_=#{pageVO.userId} )))
or (RES.ASSIGNEE_ is null and I.TYPE_ = 'candidate' )
</where>
order by RES.CREATE_TIME_ desc
</select>
<select id="todoTaskListCount" resultType="java.lang.Long">
select count(1) from
( select distinct RES.* from ACT_RU_TASK RES
left join ACT_RU_IDENTITYLINK I on I.TASK_ID_ = RES.ID_
inner join ACT_RE_PROCDEF D on RES.PROC_DEF_ID_ = D.ID_
<where>
<if test="pageVO.name !='' and pageVO.name !=null">
and RES.NAME_ LIKE #{pageVO.name}
</if>
<if test="pageVO.startTime !='' and pageVO.startTime !=null">
and RES.CREATE_TIME_ >= #{pageVO.startTime}
</if>
<if test="pageVO.endTime !='' and pageVO.endTime !=null">
and RES.CREATE_TIME_ &lt; #{pageVO.endTime}
</if>
(RES.ASSIGNEE_=#{pageVO.userId} or (RES.ASSIGNEE_ is null and I.TYPE_ = 'candidate' and (I.USER_ID_=#{pageVO.userId} )))
or (RES.ASSIGNEE_ is null and I.TYPE_ = 'candidate' )
</where>
order by RES.CREATE_TIME_ desc
)num
</select>
</mapper>