提交 730cf310 编写于 作者: B bao liang 提交者: lgcareer

refactor dao interface. (#897)

* update english documents

* refactor zk client

* update documents

* update zkclient

* update zkclient

* update documents

* add architecture-design

* change i18n

* update i18n

* update english documents

* add architecture-design

* update english documents

* update en-US documents

* add architecture-design

* update demo site

* add mybatis plus model

* modify mybatisplus

* modify mybatisplus

* change interface by mybatisplus

* add unit test

* refactor dao interface.
上级 46672d6b
......@@ -384,15 +384,17 @@ public class DataAnalysisService {
}
Integer taskQueueCount = 0;
Integer taskKillCount = 0;
int[] projectIds = new int[1];
projectIds[0] = projectId;
if (tasksQueueIds.length != 0){
taskQueueCount = taskInstanceMapper.countTask(
loginUser.getId(),loginUser.getUserType(),String.valueOf(projectId),
StringUtils.join(tasksQueueIds, ","));
loginUser.getId(),loginUser.getUserType(),projectIds,
tasksQueueIds);
}
if (tasksKillIds.length != 0){
taskKillCount = taskInstanceMapper.countTask(loginUser.getId(),loginUser.getUserType(),projectId, tasksKillIds);
taskKillCount = taskInstanceMapper.countTask(loginUser.getId(),loginUser.getUserType(), projectIds, tasksKillIds);
}
......
此差异已折叠。
......@@ -45,38 +45,4 @@ public interface ProcessDefinitionMapper extends BaseMapper<ProcessDefinition> {
List<DefinitionGroupByUser> countDefinitionGroupByUser(
@Param("userId") Integer userId,
@Param("projectIds") Integer[] projectIds);
/**
* update receivers and cc by definition id
* @param receivers
* @param receiversCc
* @param processDefinitionId
* @return
*/
@UpdateProvider(type = ProcessDefinitionMapperProvider.class, method = "updateReceiversAndCcById")
int updateReceiversAndCcById(@Param("receivers") String receivers,
@Param("receiversCc") String receiversCc,
@Param("processDefinitionId") int processDefinitionId);
/**
* query all
* @return
*/
@Results(value = {@Result(property = "id", column = "id", id = true, javaType = Integer.class, jdbcType = JdbcType.INTEGER),
@Result(property = "name", column = "name", javaType = String.class, jdbcType = JdbcType.VARCHAR),
@Result(property = "version", column = "version", javaType = Integer.class, jdbcType = JdbcType.TINYINT),
@Result(property = "releaseState", column = "release_state", typeHandler = EnumOrdinalTypeHandler.class, javaType = ReleaseState.class, jdbcType = JdbcType.TINYINT),
@Result(property = "projectId", column = "project_id", javaType = Integer.class, jdbcType = JdbcType.INTEGER),
@Result(property = "userId", column = "user_id", javaType = Integer.class, jdbcType = JdbcType.INTEGER),
@Result(property = "desc", column = "desc", javaType = String.class, jdbcType = JdbcType.VARCHAR),
@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 = "flag", column = "flag", typeHandler = EnumOrdinalTypeHandler.class, javaType = Flag.class, jdbcType = JdbcType.TINYINT),
@Result(property = "userName", column = "user_name", javaType = String.class, jdbcType = JdbcType.VARCHAR),
@Result(property = "timeout", column = "timeout", javaType = Integer.class, jdbcType = JdbcType.INTEGER),
@Result(property = "tenantId", column = "tenant_id", javaType = Integer.class, jdbcType = JdbcType.INTEGER),
@Result(property = "projectName", column = "project_name", javaType = String.class, jdbcType = JdbcType.VARCHAR)
})
@SelectProvider(type = ProcessDefinitionMapperProvider.class, method = "queryAll")
List<ProcessDefinition> queryAll();
}
......@@ -50,8 +50,8 @@ public interface TaskInstanceMapper extends BaseMapper<TaskInstance> {
Integer countTask(@Param("userId") int userId,
@Param("userType") UserType userType,
@Param("projectIds") String projectIds,
@Param("taskIds") String taskIds);
@Param("projectIds") int[] projectIds,
@Param("taskIds") int[] taskIds);
List<ExecuteStatusCount> countTaskInstanceStateByUser(@Param("userId") int userId,
@Param("userType") UserType userType,
......
......@@ -60,7 +60,12 @@
<if test="projectIds != null and projectIds != ''">
and process.project_id in (#{projectIds})
</if>
and task.id in (#{taskIds})
<if test="taskIds != null and taskIds.length != 0">
and task.id in
<foreach collection="taskIds" index="index" item="i" open="(" separator="," close=")">
#{i}
</foreach>
</if>
</select>
<select id="queryTaskInstanceListPaging" resultType="cn.escheduler.dao.entity.TaskInstance">
select instance.*,process.name as process_instance_name, UNIX_TIMESTAMP(instance.end_time)-UNIX_TIMESTAMP(instance.start_time) as duration
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册