@Select(value = "select id, name, create_time from roncoo_user where id = #{id,jdbcType=INTEGER}") @Results(value = { @Result(column = "create_time", property = "createTime", jdbcType = JdbcType.TIMESTAMP) }) RoncooUser selectByPrimaryKey(Integer id); }
@Results(value = { @Result(property = "id", column = "id", id = true), @Result(property = "name", column = "name"), @Result(property = "age", column = "age"), @Result(property = "description", column = "desc", typeHandler = DescriptionTypeHandler.class), @Result(property = "height", column = "height") }) @Select("SELECT id,name,age,`desc`,height FROM user WHERE id = #{id}") User selectUser(int id);
@Results(id = "roleResultMap", value = { @Result(property = "id", column = "id", id = true), @Result(property = "roleName", column = "role_name"), @Result(property = "enabled", column = "enabled"), @Result(property = "createBy", column = "create_by"), @Result(property = "createTime", column = "create_time") }) @Select("select id,role_name, enabled, create_by, create_time from sys_role where id = #{id}") SysRole selectById2(Long id);
@Select("SELECT * FROM message") @Results({ @Result(property = "id", column = "id", javaType = Integer.class, jdbcType = JdbcType.INTEGER), @Result(property = "nickName", column = "nick_name", javaType = String.class, jdbcType = JdbcType.VARCHAR), @Result(property = "ip", column = "ip", javaType = String.class, jdbcType = JdbcType.VARCHAR), @Result(property = "insertTime", column = "INSERT_TIME", javaType = Date.class, jdbcType = JdbcType.DATE) }) List<Message> list(); }
@Select("SELECT * FROM OWF_ACTIVITY_CREATION") @Results(value = { @Result(property = "factoryName", column = "FACTORY_NAME"), @Result(property = "processDefinitionId", column = "PROCESS_DEFINITION_ID"), @Result(property = "processInstanceId", column = "PROCESS_INSTANCE_ID"), @Result(property = "propertiesText", column = "PROPERTIES_TEXT") }) List<SimpleRuntimeActivityDefinitionEntity> findAll();
@Select("SELECT * FROM OWF_ACTIVITY_PERMISSION where PROCESS_DEFINITION_ID=#{processDefinitionId} and ACTIVITY_KEY=#{taskDefinitionKey}") @Results(value = { @Result(property = "processDefinitionId", column = "PROCESS_DEF_ID"), @Result(property = "activityKey", column = "ACTIVITY_KEY"), @Result(property = "assignee", column = "ASSIGNED_USER"), @Result(property = "grantedGroupString", column = "GRANTED_GROUPS"), @Result(property = "grantedUserString", column = "GRANTED_USERS") }) public SqlActivityPermissionEntity load(@Param("processDefinitionId") String processDefinitionId, @Param("taskDefinitionKey") String taskDefinitionKey);
@Select("SELECT * FROM OWF_USER where USER_ID=#{userId}") @Results(value = { @Result(property = "userId", column = "USER_ID"), @Result(property = "email", column = "EMAIL"), @Result(property = "nickName", column = "NICK_NAME"), @Result(property = "mobilePhoneNumber", column = "MOBILE_PHONE_NUMBER") }) SimpleUserDetailsEntity findUserDetailsById(@Param("userId") String userId);
@Select("SELECT * FROM OWF_DELEGATION where DELEGATED=#{delegated}") @Results(value = { @Result(property = "opTime", column = "OP_TIME") }) List<SqlDelegationEntity> findByDelegated(@Param("delegated") String delegated);
@Select("SELECT * FROM OWF_DELEGATION") @Results(value = { @Result(property = "opTime", column = "OP_TIME") }) List<SqlDelegationEntity> list();
@Select("SELECT * from case_hit_disp_comments chd LEFT JOIN hits_disposition_comments hdc ON chd.hit_disp_comments_id = hdc.id WHERE chd.hit_disp_id =#{hitDispId}") @ResultType(CaseHitDispComment.class) @Results(id = "findhitDispCommentsByHitDispd", value = { @Result(property = "hitDispId", column = "hit_disp_id", id = true), @Result(property = "hitDispCommentsId", column = "hit_disp_comments_id"), @Result(property = "createdAt", column = "created_at"), @Result(property = "updatedAt", column = "updated_at"), @Result(property = "comments", column = "comments") }) public List<CaseHitDispComment> findCaseHitDispComments(@Param("hitDispId")Long hitDispId);
@Select("SELECT tutor_id, t.name as tutor_name, email, addr_id FROM tutors t where t.tutor_id=#{tutorId}") @Results({ @Result(id=true, column="tutor_id", property="tutorId"), @Result(column="tutor_name", property="name"), @Result(column="email", property="email"), @Result(property="address", column="addr_id", one=@One(select="com.mybatis3.mappers.AddressMapper.selectAddressById")), @Result(property="courses", column="tutor_id", many=@Many(select="com.mybatis3.mappers.TutorMapper.selectCoursesByTutorId")) }) Tutor selectTutorWithCoursesById(int tutorId);
/** * 获取指定worker未完成的工作流列表 */ @Results(value = { @Result(property = "id", column = "id", id = true, javaType = int.class, jdbcType = JdbcType.INTEGER), @Result(property = "flowId", column = "flow_id", javaType = int.class, jdbcType = JdbcType.INTEGER) }) @SelectProvider(type = ExecutionFlowMapperProvider.class, method = "selectNoFinishFlow") List<ExecutionFlow> selectNoFinishFlow(@Param("worker") String worker);