Commit c1145bee authored by qiaozhanwei's avatar qiaozhanwei
Browse files

project process define count and process instance running count

parent 89b5ea93
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -115,6 +115,8 @@ public interface ProjectMapper {
            @Result(property = "perm", column = "perm", javaType = Integer.class, jdbcType = JdbcType.INTEGER),
            @Result(property = "createTime", column = "create_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE),
            @Result(property = "updateTime", column = "update_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE),
            @Result(property = "defCount", column = "def_count", javaType = Integer.class, jdbcType = JdbcType.INTEGER),
            @Result(property = "instRunningCount", column = "inst_running_count", javaType = Integer.class, jdbcType = JdbcType.INTEGER),
    })
    @SelectProvider(type = ProjectMapperProvider.class, method = "queryProjectListPaging")
    List<Project> queryProjectListPaging(@Param("userId") Integer userId,
@@ -145,6 +147,8 @@ public interface ProjectMapper {
            @Result(property = "perm", column = "perm", javaType = Integer.class, jdbcType = JdbcType.INTEGER),
            @Result(property = "createTime", column = "create_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE),
            @Result(property = "updateTime", column = "update_time", javaType = Timestamp.class, jdbcType = JdbcType.DATE),
            @Result(property = "defCount", column = "def_count", javaType = Integer.class, jdbcType = JdbcType.INTEGER),
            @Result(property = "instRunningCount", column = "inst_running_count", javaType = Integer.class, jdbcType = JdbcType.INTEGER),
    })
    @SelectProvider(type = ProjectMapperProvider.class, method = "queryAllProjectListPaging")
    List<Project> queryAllProjectListPaging(
+4 −2
Original line number Diff line number Diff line
@@ -157,7 +157,8 @@ public class ProjectMapperProvider {
        return new SQL() {{
            SELECT("p.*");
            SELECT("u.user_name as user_name");

            SELECT("(SELECT COUNT(*) FROM t_escheduler_process_definition AS def WHERE def.project_id = p.id) AS def_count");
            SELECT("(SELECT COUNT(*) FROM t_escheduler_process_definition def, t_escheduler_process_instance inst WHERE def.id = inst.process_definition_id AND def.project_id = p.id AND inst.state=1 ) as inst_running_count");
            FROM(TABLE_NAME + " p");
            JOIN("t_escheduler_user u on u.id=p.user_id");
            WHERE("p.id in " +
@@ -199,7 +200,8 @@ public class ProjectMapperProvider {
        return new SQL() {{
            SELECT("p.*");
            SELECT("u.user_name as user_name");

            SELECT("(SELECT COUNT(*) FROM t_escheduler_process_definition AS def WHERE def.project_id = p.id) AS def_count");
            SELECT("(SELECT COUNT(*) FROM t_escheduler_process_definition def, t_escheduler_process_instance inst WHERE def.id = inst.process_definition_id AND def.project_id = p.id AND inst.state=1 ) as inst_running_count");
            FROM(TABLE_NAME + " p");
            JOIN("t_escheduler_user u on p.user_id = u.id");

+26 −0
Original line number Diff line number Diff line
@@ -63,6 +63,32 @@ public class Project {
     */
    private int perm;

    /**
     * process define count
     */
    private int defCount;

    /**
     * process instance running count
     */
    private int instRunningCount;

    public int getDefCount() {
        return defCount;
    }

    public void setDefCount(int defCount) {
        this.defCount = defCount;
    }

    public int getInstRunningCount() {
        return instRunningCount;
    }

    public void setInstRunningCount(int instRunningCount) {
        this.instRunningCount = instRunningCount;
    }

    public int getId() {
        return id;
    }
+13 −1
Original line number Diff line number Diff line
@@ -12,6 +12,12 @@
          <th>
            <span>{{$t('Owned Users')}}</span>
          </th>
          <th>
            <span>{{$t('Process Define Count')}}</span>
          </th>
          <th>
            <span>{{$t('Process Instance Running Count')}}</span>
          </th>
          <th>
            <span>{{$t('Description')}}</span>
          </th>
@@ -37,6 +43,12 @@
          <td>
            <span>{{item.userName || '-'}}</span>
          </td>
          <td>
            <span>{{item.defCount}}</span>
          </td>
          <td>
            <span>{{item.instRunningCount}}</span>
          </td>
          <td>
            <span>{{item.desc}}</span>
          </td>
+2 −0
Original line number Diff line number Diff line
@@ -452,4 +452,6 @@ export default {
  'Pre Statement': 'Pre Statement',
  'Post Statement': 'Post Statement',
  'Statement cannot be empty': 'Statement cannot be empty',
  'Process Define Count':'Process Define Count',
  'Process Instance Running Count':'Process Instance Running Count',
}
Loading