org.apache.ibatis.annotations.Lang Java Examples

The following examples show how to use org.apache.ibatis.annotations.Lang. 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 File: PermissionTeamMapper.java    From shepher with Apache License 2.0 5 votes vote down vote up
@Select("SELECT permission_team.id AS id, permission_id, team_id, status AS status_value, permission_team.time AS time, " +
        "permission.cluster AS cluster, permission.path AS path, team.name AS team_name " +
        "FROM permission_team, permission, team " +
        "WHERE permission_team.permission_id = permission.id AND permission_team.team_id = team.id " +
        "AND cluster = #{cluster} AND path IN (#{paths}) AND status = #{status}")
@Lang(MybatisExtendedLanguageDriver.class)
List<PermissionTeam> listByPaths(@Param("cluster") String cluster, @Param("paths") List<String> paths, @Param("status") int status);
 
Example #2
Source File: MapperAnnotationBuilder.java    From mybaties with Apache License 2.0 5 votes vote down vote up
private LanguageDriver getLanguageDriver(Method method) {
  Lang lang = method.getAnnotation(Lang.class);
  Class<?> langClass = null;
  if (lang != null) {
    langClass = lang.value();
  }
  return assistant.getLanguageDriver(langClass);
}
 
Example #3
Source File: MapperAnnotationBuilder.java    From mybatis with Apache License 2.0 5 votes vote down vote up
private LanguageDriver getLanguageDriver(Method method) {
  Lang lang = method.getAnnotation(Lang.class);
  Class<?> langClass = null;
  if (lang != null) {
    langClass = lang.value();
  }
  return assistant.getLanguageDriver(langClass);
}
 
Example #4
Source File: UserMapper.java    From shepher with Apache License 2.0 4 votes vote down vote up
@Lang(MybatisExtendedLanguageDriver.class)
@Select("SELECT DISTINCT user.id, user.name, user.time FROM user, user_team WHERE user_team.team_id IN (#{teams}) " +
        "AND user_team.user_id = user.id AND user_team.status >= #{status} AND user_team.role >= #{role}")
List<User> list(@Param("teams") Set<Long> teams, @Param("status") int status, @Param("role") int role);
 
Example #5
Source File: Mapper.java    From mybaties with Apache License 2.0 4 votes vote down vote up
@Lang(RawLanguageDriver.class)
@Select("SELECT firstName, lastName FROM names WHERE lastName LIKE #{name}")
List<Name> selectRawWithMapper(Parameter p);
 
Example #6
Source File: Mapper.java    From mybaties with Apache License 2.0 4 votes vote down vote up
@Lang(XMLLanguageDriver.class)
@Select("<script>SELECT firstName <if test=\"includeLastName != null\">, lastName</if> FROM names WHERE lastName LIKE #{name}</script>")
List<Name> selectXmlWithMapper(Parameter p);
 
Example #7
Source File: Mapper.java    From mybaties with Apache License 2.0 4 votes vote down vote up
@Lang(XMLLanguageDriver.class)
@Select("SELECT firstName, lastName FROM names WHERE lastName LIKE #{name} and 0 < 1")
List<Name> selectXmlWithMapperAndSqlSymbols(Parameter p);
 
Example #8
Source File: Mapper.java    From mybatis with Apache License 2.0 4 votes vote down vote up
@Lang(RawLanguageDriver.class)
@Select("SELECT firstName, lastName FROM names WHERE lastName LIKE #{name}")
List<Name> selectRawWithMapper(Parameter p);
 
Example #9
Source File: Mapper.java    From mybatis with Apache License 2.0 4 votes vote down vote up
@Lang(XMLLanguageDriver.class)
@Select("<script>SELECT firstName <if test=\"includeLastName != null\">, lastName</if> FROM names WHERE lastName LIKE #{name}</script>")
List<Name> selectXmlWithMapper(Parameter p);
 
Example #10
Source File: Mapper.java    From mybatis with Apache License 2.0 4 votes vote down vote up
@Lang(XMLLanguageDriver.class)
@Select("SELECT firstName, lastName FROM names WHERE lastName LIKE #{name} and 0 < 1")
List<Name> selectXmlWithMapperAndSqlSymbols(Parameter p);
 
Example #11
Source File: DynamicSqlDao.java    From tutorial with MIT License 2 votes vote down vote up
/**
 * 使用自定义LanguageDriver的例子,@Lang注解声明使用自定义的LanaguageDriver; 三个参数在自定义LanguageDriver中可以读取到,然后动态生成SQL
 * @param tableName
 * @param columns
 * @param param
 * @return
 */
@Lang(DynamicTableLanguageDriver.class)
@Select("")
public List<Map<String, Object>> getByConditions(@Param("tableName") String tableName,
                                      @Param("columns") List<String> columns,
                                      @Param("conditions") Map<String, Object> param);