Co-authored-by: caishunfeng <534328519@qq.com>
@ -56,6 +56,6 @@ public interface CommandMapper extends BaseMapper<Command> {
* query command page
* @return
*/
IPage<Command> queryCommandPage(IPage<Command> page);
List<Command> queryCommandPage(@Param("limit") int limit, @Param("offset") int offset);
}
@ -46,6 +46,7 @@
<select id="queryCommandPage" resultType="org.apache.dolphinscheduler.dao.entity.Command">
select *
from t_ds_command
order by update_time asc
order by process_instance_priority, id asc
limit #{limit} offset #{offset}
</select>
</mapper>
@ -308,8 +308,7 @@ public class ProcessService {
public List<Command> findCommandPage(int pageSize, int pageNumber) {
Page<Command> commandPage = new Page<>(pageNumber, pageSize);
return commandMapper.queryCommandPage(commandPage).getRecords();
return commandMapper.queryCommandPage(pageSize, pageNumber * pageSize);
/**
@ -327,7 +327,8 @@ CREATE TABLE t_ds_command
process_instance_priority int(11) DEFAULT NULL,
worker_group varchar(64),
environment_code bigint(20) DEFAULT '-1',
PRIMARY KEY (id)
PRIMARY KEY (id),
KEY priority_id_index (process_instance_priority, id)
);
-- ----------------------------
@ -333,7 +333,8 @@ CREATE TABLE `t_ds_command` (
`worker_group` varchar(64) COMMENT 'worker group',
`environment_code` bigint(20) DEFAULT '-1' COMMENT 'environment code',
`dry_run` int NULL DEFAULT 0 COMMENT 'dry run flag:0 normal, 1 dry run',
PRIMARY KEY (`id`)
PRIMARY KEY (`id`),
KEY `priority_id_index` (`process_instance_priority`,`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
@ -258,6 +258,8 @@ CREATE TABLE t_ds_command (
) ;
create index priority_id_index on t_ds_command (process_instance_priority,id);
--
-- Table structure for table t_ds_datasource