|
374 | 374 | <result property="processDefinitionName" column="ProcessDefinitionName" jdbcType="VARCHAR" /> |
375 | 375 | <result property="processDefinitionKey" column="ProcessDefinitionKey" jdbcType="VARCHAR" /> |
376 | 376 | <result property="processDefinitionVersion" column="ProcessDefinitionVersion" jdbcType="INTEGER" /> |
| 377 | + <result property="processDefinitionCategory" column="ProcessDefinitionCategory" jdbcType="VARCHAR"/> |
377 | 378 | <result property="deploymentId" column="DeploymentId" jdbcType="VARCHAR" /> |
378 | 379 |
|
379 | 380 | <result property="activityId" column="ACT_ID_" jdbcType="VARCHAR" /> |
|
474 | 475 | <result property="processDefinitionName" column="ProcessDefinitionName" jdbcType="VARCHAR" /> |
475 | 476 | <result property="processDefinitionKey" column="ProcessDefinitionKey" jdbcType="VARCHAR" /> |
476 | 477 | <result property="processDefinitionVersion" column="ProcessDefinitionVersion" jdbcType="INTEGER" /> |
| 478 | + <result property="processDefinitionCategory" column="ProcessDefinitionCategory" jdbcType="VARCHAR"/> |
477 | 479 | <result property="deploymentId" column="DeploymentId" jdbcType="VARCHAR" /> |
478 | 480 | <result property="activityId" column="ACT_ID_" jdbcType="VARCHAR" /> |
479 | 481 | <result property="isActive" column="IS_ACTIVE_" jdbcType="BOOLEAN" /> |
|
581 | 583 | and IS_ACTIVE_ = #{parameter.isActive} |
582 | 584 | </select> |
583 | 585 |
|
584 | | - <select id="selectExecutionsByParentExecutionAndActivityIds" parameterType="org.flowable.common.engine.impl.db.ListQueryParameterObject" resultMap="executionResultMap"> |
585 | | - select * |
586 | | - from ${prefix}ACT_RU_EXECUTION |
587 | | - where PARENT_ID_ = #{parameter.parentExecutionId} |
588 | | - and ACT_ID_ in |
589 | | - <foreach item="activityId" collection="parameter.activityIds" open="(" separator="," close=")"> |
590 | | - #{activityId} |
591 | | - </foreach> |
592 | | - </select> |
| 586 | + <select id="selectExecutionsByParentExecutionAndActivityIds" parameterType="org.flowable.common.engine.impl.db.ListQueryParameterObject" |
| 587 | + resultMap="executionResultMap"> |
| 588 | + select * |
| 589 | + from ${prefix}ACT_RU_EXECUTION |
| 590 | + where PARENT_ID_ = #{parameter.parentExecutionId} |
| 591 | + and ACT_ID_ in |
| 592 | + <foreach item="activityId" collection="parameter.activityIds" open="(" separator="," close=")"> |
| 593 | + #{activityId} |
| 594 | + </foreach> |
| 595 | + </select> |
593 | 596 |
|
594 | | - <select id="selectExecutionsByQueryCriteria" parameterType="org.flowable.engine.impl.ExecutionQueryImpl" resultMap="executionResultMap"> |
595 | | - <if test="needsPaging">${limitBefore}</if> |
596 | | - SELECT RES.* <if test="needsPaging">${limitBetween}</if>, P.KEY_ as ProcessDefinitionKey, P.ID_ as ProcessDefinitionId, P.NAME_ as ProcessDefinitionName, P.VERSION_ as ProcessDefinitionVersion, P.DEPLOYMENT_ID_ as DeploymentId |
597 | | - <include refid="selectExecutionsByQueryCriteriaSql"/> |
598 | | - ${orderBy} |
599 | | - <if test="needsPaging">${limitAfter}</if> |
600 | | - </select> |
| 597 | + <select id="selectExecutionsByQueryCriteria" parameterType="org.flowable.engine.impl.ExecutionQueryImpl" resultMap="executionResultMap"> |
| 598 | + <if test="needsPaging">${limitBefore}</if> |
| 599 | + SELECT RES.* <if test="needsPaging">${limitBetween}</if>, P.KEY_ as ProcessDefinitionKey, P.ID_ as ProcessDefinitionId, P.NAME_ as |
| 600 | + ProcessDefinitionName, P.VERSION_ as ProcessDefinitionVersion, P.CATEGORY_ as ProcessDefinitionCategory, P.DEPLOYMENT_ID_ as DeploymentId |
| 601 | + <include refid="selectExecutionsByQueryCriteriaSql"/> |
| 602 | + ${orderBy} |
| 603 | + <if test="needsPaging">${limitAfter}</if> |
| 604 | + </select> |
601 | 605 |
|
602 | | - <select id="selectExecutionCountByQueryCriteria" parameterType="org.flowable.engine.impl.ExecutionQueryImpl" resultType="long"> |
603 | | - select count(distinct RES.ID_) |
604 | | - <include refid="selectExecutionsByQueryCriteriaSql"/> |
605 | | - </select> |
| 606 | + <select id="selectExecutionCountByQueryCriteria" parameterType="org.flowable.engine.impl.ExecutionQueryImpl" resultType="long"> |
| 607 | + select count(distinct RES.ID_) |
| 608 | + <include refid="selectExecutionsByQueryCriteriaSql"/> |
| 609 | + </select> |
606 | 610 |
|
607 | | - <!-- same as selectExecutionsByQueryCriteria, but with different parameterType --> |
608 | | - <select id="selectProcessInstanceByQueryCriteria" parameterType="org.flowable.engine.impl.ProcessInstanceQueryImpl" resultMap="processInstanceResultMap"> |
609 | | - <if test="needsPaging">${limitBefore}</if> |
610 | | - SELECT RES.* <if test="needsPaging">${limitBetween}</if>, P.KEY_ as ProcessDefinitionKey, P.ID_ as ProcessDefinitionId, P.NAME_ as ProcessDefinitionName, P.VERSION_ as ProcessDefinitionVersion, P.DEPLOYMENT_ID_ as DeploymentId |
611 | | - <include refid="selectExecutionsByQueryCriteriaSql"/> |
612 | | - ${orderBy} |
613 | | - <if test="needsPaging">${limitAfter}</if> |
614 | | - </select> |
| 611 | + <!-- same as selectExecutionsByQueryCriteria, but with different parameterType --> |
| 612 | + <select id="selectProcessInstanceByQueryCriteria" parameterType="org.flowable.engine.impl.ProcessInstanceQueryImpl" resultMap="processInstanceResultMap"> |
| 613 | + <if test="needsPaging">${limitBefore}</if> |
| 614 | + SELECT RES.* <if test="needsPaging">${limitBetween}</if>, P.KEY_ as ProcessDefinitionKey, P.ID_ as ProcessDefinitionId, P.NAME_ as |
| 615 | + ProcessDefinitionName, P.VERSION_ as ProcessDefinitionVersion, P.CATEGORY_ as ProcessDefinitionCategory, P.DEPLOYMENT_ID_ as DeploymentId |
| 616 | + <include refid="selectExecutionsByQueryCriteriaSql"/> |
| 617 | + ${orderBy} |
| 618 | + <if test="needsPaging">${limitAfter}</if> |
| 619 | + </select> |
615 | 620 |
|
616 | | - <select id="selectProcessInstanceCountByQueryCriteria" parameterType="org.flowable.engine.impl.ProcessInstanceQueryImpl" resultType="long"> |
617 | | - select count(distinct RES.ID_) |
618 | | - <include refid="selectExecutionsByQueryCriteriaSql"/> |
619 | | - </select> |
| 621 | + <select id="selectProcessInstanceCountByQueryCriteria" parameterType="org.flowable.engine.impl.ProcessInstanceQueryImpl" resultType="long"> |
| 622 | + select count(distinct RES.ID_) |
| 623 | + <include refid="selectExecutionsByQueryCriteriaSql"/> |
| 624 | + </select> |
620 | 625 |
|
621 | | - <sql id="selectExecutionsByQueryCriteriaSql"> |
622 | | - from ${prefix}ACT_RU_EXECUTION RES |
623 | | - <!-- Doing an inner join on the definition table is OK, since it is a 1:1 relationship --> |
624 | | - inner join ${prefix}ACT_RE_PROCDEF P on RES.PROC_DEF_ID_ = P.ID_ |
625 | | - <include refid="commonSelectExecutionsByQueryCriteriaSql"/> |
626 | | - </sql> |
| 626 | + <sql id="selectExecutionsByQueryCriteriaSql"> |
| 627 | + from ${prefix}ACT_RU_EXECUTION RES |
| 628 | + <!-- Doing an inner join on the definition table is OK, since it is a 1:1 relationship --> |
| 629 | + inner join ${prefix}ACT_RE_PROCDEF P on RES.PROC_DEF_ID_ = P.ID_ |
| 630 | + <include refid="commonSelectExecutionsByQueryCriteriaSql"/> |
| 631 | + </sql> |
627 | 632 |
|
628 | | - <select id="selectProcessInstanceWithVariablesByQueryCriteria" parameterType="org.flowable.engine.impl.ProcessInstanceQueryImpl" resultMap="processInstanceAndVariablesResultMap"> |
629 | | - SELECT RES.*, |
630 | | - VAR.ID_ as VAR_ID_, VAR.NAME_ as VAR_NAME_, VAR.TYPE_ as VAR_TYPE_, VAR.REV_ as VAR_REV_, |
631 | | - VAR.PROC_INST_ID_ as VAR_PROC_INST_ID_, VAR.EXECUTION_ID_ as VAR_EXECUTION_ID_, VAR.TASK_ID_ as VAR_TASK_ID_, |
632 | | - VAR.META_INFO_ as VAR_META_INFO_, |
633 | | - VAR.BYTEARRAY_ID_ as VAR_BYTEARRAY_ID_, VAR.DOUBLE_ as VAR_DOUBLE_, |
634 | | - VAR.TEXT_ as VAR_TEXT_, VAR.TEXT2_ as VAR_TEXT2_, VAR.LONG_ as VAR_LONG_ |
635 | | - FROM ( |
| 633 | + <select id="selectProcessInstanceWithVariablesByQueryCriteria" parameterType="org.flowable.engine.impl.ProcessInstanceQueryImpl" |
| 634 | + resultMap="processInstanceAndVariablesResultMap"> |
| 635 | + SELECT RES.*, |
| 636 | + VAR.ID_ as VAR_ID_, VAR.NAME_ as VAR_NAME_, VAR.TYPE_ as VAR_TYPE_, VAR.REV_ as VAR_REV_, |
| 637 | + VAR.PROC_INST_ID_ as VAR_PROC_INST_ID_, VAR.EXECUTION_ID_ as VAR_EXECUTION_ID_, VAR.TASK_ID_ as VAR_TASK_ID_, |
| 638 | + VAR.META_INFO_ as VAR_META_INFO_, |
| 639 | + VAR.BYTEARRAY_ID_ as VAR_BYTEARRAY_ID_, VAR.DOUBLE_ as VAR_DOUBLE_, |
| 640 | + VAR.TEXT_ as VAR_TEXT_, VAR.TEXT2_ as VAR_TEXT2_, VAR.LONG_ as VAR_LONG_ |
| 641 | + FROM ( |
636 | 642 | <!-- top 100 percent is only needed when doing order by in a subselect --> |
637 | 643 | <if test="needsPaging">${limitBefore}</if> |
638 | | - SELECT <if test="_databaseId == 'mssql'">top 100 percent</if> RES.* <if test="needsPaging">${limitBetween}</if>, P.KEY_ as ProcessDefinitionKey, P.ID_ as ProcessDefinitionId, P.NAME_ as ProcessDefinitionName, P.VERSION_ as ProcessDefinitionVersion, P.DEPLOYMENT_ID_ as DeploymentId |
| 644 | + SELECT <if test="_databaseId == 'mssql'">top 100 percent</if> RES.* <if test="needsPaging">${limitBetween}</if>, P.KEY_ as ProcessDefinitionKey, P.ID_ |
| 645 | + as ProcessDefinitionId, P.NAME_ as ProcessDefinitionName, P.VERSION_ as ProcessDefinitionVersion, P.CATEGORY_ as ProcessDefinitionCategory, |
| 646 | + P.DEPLOYMENT_ID_ as DeploymentId |
639 | 647 | <include refid="selectProcessInstanceWithVariablesByQueryCriteriaSql"/> |
640 | 648 | ${orderBy} |
641 | 649 | <if test="needsPaging">${limitAfter}</if> |
642 | | - ) RES |
643 | | - left outer join ${prefix}ACT_RU_VARIABLE VAR ON RES.PROC_INST_ID_ = VAR.EXECUTION_ID_ |
644 | | - <if test="needsProcessDefinitionOuterJoin"> |
645 | | - inner join ${prefix}ACT_RE_PROCDEF P on RES.PROC_DEF_ID_ = P.ID_ |
646 | | - </if> |
647 | | - ${outerJoinOrderBy} |
648 | | - </select> |
| 650 | + ) RES |
| 651 | + left outer join ${prefix}ACT_RU_VARIABLE VAR ON RES.PROC_INST_ID_ = VAR.EXECUTION_ID_ |
| 652 | + <if test="needsProcessDefinitionOuterJoin"> |
| 653 | + inner join ${prefix}ACT_RE_PROCDEF P on RES.PROC_DEF_ID_ = P.ID_ |
| 654 | + </if> |
| 655 | + ${outerJoinOrderBy} |
| 656 | + </select> |
649 | 657 |
|
650 | 658 | <sql id="selectProcessInstanceWithVariablesByQueryCriteriaSql"> |
651 | 659 | from ${prefix}ACT_RU_EXECUTION RES |
|
0 commit comments