@Select("SELECT ID, TASK_ID, CREATED, MODIFIED, CLASSIFICATION_KEY, REF_COMPANY, REF_SYSTEM, REF_INSTANCE, REF_TYPE, REF_VALUE, CHANNEL, RECEIVED, CUSTOM_ATTRIBUTES " + "FROM ATTACHMENT " + "WHERE TASK_ID = #{taskId}") @Results(value = { @Result(property = "id", column = "ID"), @Result(property = "taskId", column = "TASK_ID"), @Result(property = "created", column = "CREATED"), @Result(property = "modified", column = "MODIFIED"), @Result(property = "classification", column = "CLASSIFICATION_KEY", javaType = Classification.class, one = @One(select = CLASSIFICATION_FINDBYID)), @Result(property = "objectReference.company", column = "REF_COMPANY"), @Result(property = "objectReference.system", column = "REF_SYSTEM"), @Result(property = "objectReference.systemInstance", column = "REF_INSTANCE"), @Result(property = "objectReference.type", column = "REF_TYPE"), @Result(property = "objectReference.value", column = "REF_VALUE"), @Result(property = "channel", column = "CHANNEL"), @Result(property = "received", column = "RECEIVED"), @Result(property = "customAttributes", column = "CUSTOM_ATTRIBUTES", jdbcType = JdbcType.BLOB, javaType = Map.class, typeHandler = MapTypeHandler.class), }) List<AttachmentImpl> findAttachmentsByTaskId(@Param("taskId") String taskId);
/** * 通过评测记录唯一标识符获取试题对象. * @param submissionId - 评测记录的唯一标识符 * @return 一个评测记录对象 */ @Select("SELECT * FROM voj_submissions WHERE submission_id = #{submissionId}") @Options(useCache = true) @Results({ @Result(property = "submissionId", column = "submission_id"), @Result(property = "problem", column = "problem_id", javaType = Problem.class, one = @One(select="org.verwandlung.voj.judger.mapper.ProblemMapper.getProblem")), @Result(property = "uid", column = "uid"), @Result(property = "language", column = "language_id", javaType=Language.class, one = @One(select="org.verwandlung.voj.judger.mapper.LanguageMapper.getLanguageUsingId")), @Result(property = "submitTime", column = "submission_submit_time"), @Result(property = "executeTime", column = "submission_execute_time"), @Result(property = "usedTime", column = "submission_used_time"), @Result(property = "usedMemory", column = "submission_used_memory"), @Result(property = "judgeResultSlug", column = "submission_judge_result"), @Result(property = "judgeScore", column = "submission_judge_score"), @Result(property = "judgeLog", column = "submission_judge_log"), @Result(property = "code", column = "submission_code"), }) Submission getSubmission(@Param("submissionId") long submissionId);
@Select({ "SELECT *", "FROM blog" }) @Results({ @Result( property = "author", column = "author_id", one = @One(select = "org.apache.ibatis.binding.BoundAuthorMapper.selectAuthor"), many = @Many(select = "selectPostsById")) }) List<Blog> selectWithBothOneAndMany();
/** * 通过用户名获取用户对象. * @param username - 用户名 * @return 预期的用户对象或空引用 */ @Select("SELECT * FROM voj_users WHERE username = #{username}") @Options(useCache = false) @Results(value = { @Result(property = "userGroup", column = "user_group_id", javaType = UserGroup.class, one = @One(select="org.verwandlung.voj.judger.mapper.UserGroupMapper.getUserGroupUsingId")), @Result(property = "preferLanguage", column = "prefer_language_id", javaType = Language.class, one = @One(select="org.verwandlung.voj.judger.mapper.LanguageMapper.getLanguageUsingId")) }) User getUserUsingUsername(@Param("username") String username);
@Select("SELECT ID, CREATED, CLAIMED, COMPLETED, MODIFIED, PLANNED, DUE, NAME, DESCRIPTION, PRIORITY, STATE, CLASSIFICATION_KEY, WORKBASKET_KEY, DOMAIN, OWNER, POR_COMPANY, POR_SYSTEM, POR_INSTANCE, POR_TYPE, POR_VALUE, IS_READ, IS_TRANSFERRED, CUSTOM_ATTRIBUTES, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8, CUSTOM_9, CUSTOM_10 " + "FROM TASK " + "WHERE WORKBASKET_KEY = #{workbasketKey} " + "AND STATE = #{taskState}") @Results(value = { @Result(property = "id", column = "ID"), @Result(property = "created", column = "CREATED"), @Result(property = "claimed", column = "CLAIMED"), @Result(property = "completed", column = "COMPLETED"), @Result(property = "modified", column = "MODIFIED"), @Result(property = "planned", column = "PLANNED"), @Result(property = "due", column = "DUE"), @Result(property = "name", column = "NAME"), @Result(property = "description", column = "DESCRIPTION"), @Result(property = "note", column = "NOTE"), @Result(property = "priority", column = "PRIORITY"), @Result(property = "state", column = "STATE"), @Result(property = "workbasketKey", column = "WORKBASKET_KEY"), @Result(property = "classification", column = "CLASSIFICATION_KEY", javaType = Classification.class, one = @One(select = CLASSIFICATION_FINDBYKEYANDDOMAIN)), @Result(property = "domain", column = "DOMAIN"), @Result(property = "owner", column = "OWNER"), @Result(property = "primaryObjRef.company", column = "POR_COMPANY"), @Result(property = "primaryObjRef.system", column = "POR_SYSTEM"), @Result(property = "primaryObjRef.systemInstance", column = "POR_INSTANCE"), @Result(property = "primaryObjRef.type", column = "POR_TYPE"), @Result(property = "primaryObjRef.value", column = "POR_VALUE"), @Result(property = "isRead", column = "IS_READ"), @Result(property = "isTransferred", column = "IS_TRANSFERRED"), @Result(property = "customAttributes", column = "CUSTOM_ATTRIBUTES", jdbcType = JdbcType.BLOB, javaType = Map.class, typeHandler = MapTypeHandler.class), @Result(property = "custom1", column = "CUSTOM_1"), @Result(property = "custom2", column = "CUSTOM_2"), @Result(property = "custom3", column = "CUSTOM_3"), @Result(property = "custom4", column = "CUSTOM_4"), @Result(property = "custom5", column = "CUSTOM_5"), @Result(property = "custom6", column = "CUSTOM_6"), @Result(property = "custom7", column = "CUSTOM_7"), @Result(property = "custom8", column = "CUSTOM_8"), @Result(property = "custom9", column = "CUSTOM_9"), @Result(property = "custom10", column = "CUSTOM_10")}) List<TaskImpl> findTasksByWorkbasketIdAndState(@Param("workbasketKey") String workbasketKey, @Param("taskState") TaskState taskState);