Java Code Examples for org.apache.ibatis.annotations.ResultMap

The following examples show how to use org.apache.ibatis.annotations.ResultMap. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: Java-API-Test-Examples   Source File: CoffeeMapper.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * This method was generated by MyBatis Generator.
 * This method corresponds to the database table T_COFFEE
 *
 * @mbg.generated Sun Dec 08 00:33:16 CST 2019
 */
@Select({
    "select",
    "ID, NAME, PRICE, CREATE_TIME, UPDATE_TIME",
    "from T_COFFEE",
    "where ID = #{id,jdbcType=BIGINT}"
})
@ResultMap("com.zuozewei.springbootdatadrivendemo.db.auto.mapper.CoffeeMapper.BaseResultMap")
Coffee selectByPrimaryKey(Long id);
 
Example 2
Source Project: nexus-public   Source File: BrowseNodeDAO.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Find the direct children of a browse node.
 */
@SelectProvider(type = BrowseNodeDAOQueryBuilder.class, method = "findChildrenQuery")
@ResultMap("datastoreBrowseNode")
Iterable<DatastoreBrowseNode> findChildren(
    @Param("repository") ContentRepository repository,
    @Param("path") String path,
    @Param("maxNodes") int maxNodes,
    @Param("contentSelectors") List<String> contentSelectors,
    @Param(WHERE_PARAMS) Map<String, Object> whereParams);
 
Example 3
Source Project: mybaties   Source File: PersonMapper.java    License: Apache License 2.0 5 votes vote down vote up
@Select({
  "SELECT id, firstName, lastName, parent_id, parent_firstName, parent_lastName",
  "FROM Person",
  "WHERE id = #{id,jdbcType=INTEGER}"
})
@ResultMap("personMapComplex")
public Person getWithComplex2(Long id);
 
Example 4
Source Project: mybaties   Source File: PersonMapper.java    License: Apache License 2.0 5 votes vote down vote up
@Select({
    "SELECT id, firstName, lastName, parent_id, parent_firstName, parent_lastName",
    "FROM Person",
    "WHERE id = #{id,jdbcType=INTEGER}"
  })
@ResultMap("org.apache.ibatis.submitted.complex_column.PersonMapper.personMapComplex")
public Person getWithComplex3(Long id);
 
Example 5
Source Project: mybatis   Source File: PersonMapper.java    License: Apache License 2.0 5 votes vote down vote up
@Select({
  "SELECT id, firstName, lastName, parent_id, parent_firstName, parent_lastName",
  "FROM Person",
  "WHERE id = #{id,jdbcType=INTEGER}"
})
@ResultMap("personMapComplex")
public Person getWithComplex2(Long id);
 
Example 6
Source Project: mybatis   Source File: PersonMapper.java    License: Apache License 2.0 5 votes vote down vote up
@Select({
    "SELECT id, firstName, lastName, parent_id, parent_firstName, parent_lastName",
    "FROM Person",
    "WHERE id = #{id,jdbcType=INTEGER}"
  })
@ResultMap("org.apache.ibatis.submitted.complex_column.PersonMapper.personMapComplex")
public Person getWithComplex3(Long id);
 
Example 7
Source Project: oneplatform   Source File: WeixinBindingEntityMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Cache
@Select("SELECT * FROM weixin_bindings where open_id=#{openId} limit 1")
@ResultMap("BaseResultMap")
WeixinBindingEntity findByOpenId(@Param("openId") String openId);
 
Example 8
Source Project: oneplatform   Source File: WeixinBindingEntityMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Cache
@Select("SELECT * FROM weixin_bindings where union_id=#{unionId}")
@ResultMap("BaseResultMap")
List<WeixinBindingEntity> findByUnionId(@Param("unionId") String unionId);
 
Example 9
Source Project: oneplatform   Source File: WeixinBindingEntityMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Cache
@Select("SELECT * FROM weixin_bindings where user_id=#{userId}")
@ResultMap("BaseResultMap")
List<WeixinBindingEntity> findByUserId(@Param("userId") int userId);
 
Example 10
Source Project: oneplatform   Source File: RegionEntityMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Select("select * from static_region where parent_id = #{pid}")
@ResultMap("BaseResultMap")
List<RegionEntity> findByParentId(int pid);
 
Example 11
Source Project: oneplatform   Source File: UserAssetsEntityMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Select("SELECT * user_assets WHERE user_id = #{userId} AND enabled = 1")
@ResultMap("BaseResultMap")
List<UserAssetsEntity> findListByUserId(Integer userId);
 
Example 12
Source Project: oneplatform   Source File: DepartmentEntityMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Select("select * from department where branch_id=#{branchId} order by id")
@ResultMap("BaseResultMap")
List<DepartmentEntity> findByBranchId(int branchId);
 
Example 13
Source Project: oneplatform   Source File: DepartmentEntityMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Select("select * from department where in_active=1 order by id")
@ResultMap("BaseResultMap")
List<DepartmentEntity> findAllActive();
 
Example 14
@Select("select * from employee_departments where employee_id=#{employeeId} and in_active=1 order by id")
@ResultMap("BaseResultMap")
List<EmployeeDepartmentEntity> findActiveByEmployeeId(int employeeId );
 
Example 15
Source Project: oneplatform   Source File: PositionEntityMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Select("select * from positions where name=#{name} limit 1")
@ResultMap("BaseResultMap")
PositionEntity findByName(String name);
 
Example 16
Source Project: oneplatform   Source File: CompanyEntityMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Select("select * from company where is_branch=0 limit 1")
@ResultMap("BaseResultMap")
CompanyEntity findHeadCompany();
 
Example 17
Source Project: oneplatform   Source File: CompanyEntityMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Select("select * from company where in_active=1 order by id")
@ResultMap("BaseResultMap")
List<CompanyEntity> findAllActive();
 
Example 18
Source Project: oneplatform   Source File: PermissionGroupEntityMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Select("select * from sys_permission_group where menu_id=#{menuId} and enabled=1")
@ResultMap("BaseResultMap")
List<PermissionGroupEntity> findListByMenuId(Integer menuId);
 
Example 19
Source Project: oneplatform   Source File: ModuleEntityMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Cache
@Select("SELECT * FROM sys_module where service_id=#{serviceId} limit 1")
@ResultMap("BaseResultMap")
ModuleEntity findByServiceId(@Param("serviceId") String serviceId);
 
Example 20
Source Project: oneplatform   Source File: ModuleEntityMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Cache
@Select("SELECT * FROM sys_module where route_name=#{routeName} limit 1")
@ResultMap("BaseResultMap")
ModuleEntity findByRouteName(@Param("routeName") String routeName);
 
Example 21
@Select("select * from sys_permission_resource where enabled = 1 order by id")
@ResultMap("BaseResultMap")
List<PermissionResourceEntity> findAllEnabled();
 
Example 22
@Select("select * from sys_permission_resource where type='menu' and enabled = 1 and (uri='' or uri is null) order by id")
@ResultMap("BaseResultMap")
List<PermissionResourceEntity> findNotLeafMenus();
 
Example 23
@Select("select * from sys_permission_resource where platform_type=#{platformType} and type=#{type} and name=#{name} limit 1")
@ResultMap("BaseResultMap")
PermissionResourceEntity findByTypeAndName(@Param("platformType") String platformType,@Param("type") String type,@Param("name") String name);
 
Example 24
@Select("select * from sys_permission_resource where type='api' and module_id=#{moduleId} and uri=#{uri} limit 1")
@ResultMap("BaseResultMap")
PermissionResourceEntity findApiResourceByUri(@Param("moduleId") Integer moduleId,@Param("uri") String uri);
 
Example 25
@Select("select * from sys_permission_resource where type='menu' and module_id=#{moduleId} and parent_id = 0 limit 1")
@ResultMap("BaseResultMap")
PermissionResourceEntity findModuleTopMenu(@Param("moduleId") Integer moduleId);
 
Example 26
Source Project: oneplatform   Source File: AccountEntityMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Select("select * from sys_account where username = #{name} or email = #{email} or mobile = #{mobile} limit 1")
@ResultMap("BaseResultMap")
AccountEntity findByLoginName(String name);
 
Example 27
Source Project: jeesuite-config   Source File: AppEntityMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Select("SELECT * FROM apps  where name=#{name}")
@ResultMap("BaseResultMap")
AppEntity findByName(String name);
 
Example 28
Source Project: jeesuite-config   Source File: AppEntityMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Select("SELECT app.* FROM apps app join user_permissions up on app.id=up.app_id where up.user_id=#{userId} and up.env=#{env}")
@ResultMap("BaseResultMap")
List<AppEntity> findByUserPermission(@Param("userId")Integer userId,@Param("env") String env);
 
Example 29
Source Project: jeesuite-config   Source File: AppEntityMapper.java    License: Apache License 2.0 4 votes vote down vote up
@Select("SELECT app.* FROM apps app join user_permissions up on app.id=up.app_id where up.user_id=#{userId} and up.env=#{env} and up.operate=#{operate}")
@ResultMap("BaseResultMap")
List<AppEntity> findByUserPermissionWithOperate(@Param("userId")Integer userId,@Param("env") String env,@Param("operate") String operate);
 
Example 30
@Select("SELECT * FROM user_permissions  where user_id=#{userId} and env=#{env}")
@ResultMap("BaseResultMap")
List<UserPermissionEntity> findByUserIdAndEnv(@Param("userId") Integer userId,@Param("env") String env);