本文整理汇总了Java中org.apache.ibatis.annotations.Select类的典型用法代码示例。如果您正苦于以下问题:Java Select类的具体用法?Java Select怎么用?Java Select使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Select类属于org.apache.ibatis.annotations包,在下文中一共展示了Select类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSqlCommandType
import org.apache.ibatis.annotations.Select; //导入依赖的package包/类
private SqlCommandType getSqlCommandType(Method method) {
Class<? extends Annotation> type = getSqlAnnotationType(method);
if (type == null) {
type = getSqlProviderAnnotationType(method);
if (type == null) {
return SqlCommandType.UNKNOWN;
}
if (type == SelectProvider.class) {
type = Select.class;
} else if (type == InsertProvider.class) {
type = Insert.class;
} else if (type == UpdateProvider.class) {
type = Update.class;
} else if (type == DeleteProvider.class) {
type = Delete.class;
}
}
return SqlCommandType.valueOf(type.getSimpleName().toUpperCase(Locale.ENGLISH));
}
示例2: IN
import org.apache.ibatis.annotations.Select; //导入依赖的package包/类
@Select("<script>SELECT ID, COMPANY, SYSTEM, SYSTEM_INSTANCE, TYPE, VALUE "
+ "FROM OBJECT_REFERENCE "
+ "<where>"
+ "<if test='company != null'>AND COMPANY IN(<foreach item='item' collection='company' separator=',' >#{item}</foreach>)</if> "
+ "<if test='system != null'>AND SYSTEM IN(<foreach item='item' collection='system' separator=',' >#{item}</foreach>)</if> "
+ "<if test='systemInstance != null'>AND SYSTEM_INSTANCE IN(<foreach item='item' collection='systemInstance' separator=',' >#{item}</foreach>)</if> "
+ "<if test='type != null'>AND TYPE IN(<foreach item='item' collection='type' separator=',' >#{item}</foreach>)</if> "
+ "<if test='value != null'>AND VALUE IN(<foreach item='item' collection='value' separator=',' >#{item}</foreach>)</if> "
+ "</where>"
+ "</script>")
@Results({
@Result(property = "id", column = "ID"),
@Result(property = "company", column = "COMPANY"),
@Result(property = "system", column = "SYSTEM"),
@Result(property = "systemInstance", column = "SYSTEM_INSTANCE"),
@Result(property = "type", column = "TYPE"),
@Result(property = "value", column = "VALUE")})
List<ObjectReference> queryObjectReference(ObjectReferenceQueryImpl objectReference);
示例3: findById
import org.apache.ibatis.annotations.Select; //导入依赖的package包/类
@Select("SELECT ID, WORKBASKET_KEY, ACCESS_ID, PERM_READ, PERM_OPEN, PERM_APPEND, PERM_TRANSFER, PERM_DISTRIBUTE, PERM_CUSTOM_1, PERM_CUSTOM_2, PERM_CUSTOM_3, PERM_CUSTOM_4, PERM_CUSTOM_5, PERM_CUSTOM_6, PERM_CUSTOM_7, PERM_CUSTOM_8 FROM WORKBASKET_ACCESS_LIST WHERE ID = #{id}")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "workbasketKey", column = "WORKBASKET_KEY"),
@Result(property = "accessId", column = "ACCESS_ID"),
@Result(property = "permRead", column = "PERM_READ"),
@Result(property = "permOpen", column = "PERM_OPEN"),
@Result(property = "permAppend", column = "PERM_APPEND"),
@Result(property = "permTransfer", column = "PERM_TRANSFER"),
@Result(property = "permDistribute", column = "PERM_DISTRIBUTE"),
@Result(property = "permCustom1", column = "PERM_CUSTOM_1"),
@Result(property = "permCustom2", column = "PERM_CUSTOM_2"),
@Result(property = "permCustom3", column = "PERM_CUSTOM_3"),
@Result(property = "permCustom4", column = "PERM_CUSTOM_4"),
@Result(property = "permCustom5", column = "PERM_CUSTOM_5"),
@Result(property = "permCustom6", column = "PERM_CUSTOM_6"),
@Result(property = "permCustom7", column = "PERM_CUSTOM_7"),
@Result(property = "permCustom8", column = "PERM_CUSTOM_8")})
WorkbasketAccessItem findById(@Param("id") String id);
示例4: findByWorkbasketKey
import org.apache.ibatis.annotations.Select; //导入依赖的package包/类
@Select("SELECT ID, WORKBASKET_KEY, ACCESS_ID, PERM_READ, PERM_OPEN, PERM_APPEND, PERM_TRANSFER, PERM_DISTRIBUTE, PERM_CUSTOM_1, PERM_CUSTOM_2, PERM_CUSTOM_3, PERM_CUSTOM_4, PERM_CUSTOM_5, PERM_CUSTOM_6, PERM_CUSTOM_7, PERM_CUSTOM_8 FROM WORKBASKET_ACCESS_LIST WHERE WORKBASKET_KEY = #{key}")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "workbasketKey", column = "WORKBASKET_KEY"),
@Result(property = "accessId", column = "ACCESS_ID"),
@Result(property = "permRead", column = "PERM_READ"),
@Result(property = "permOpen", column = "PERM_OPEN"),
@Result(property = "permAppend", column = "PERM_APPEND"),
@Result(property = "permTransfer", column = "PERM_TRANSFER"),
@Result(property = "permDistribute", column = "PERM_DISTRIBUTE"),
@Result(property = "permCustom1", column = "PERM_CUSTOM_1"),
@Result(property = "permCustom2", column = "PERM_CUSTOM_2"),
@Result(property = "permCustom3", column = "PERM_CUSTOM_3"),
@Result(property = "permCustom4", column = "PERM_CUSTOM_4"),
@Result(property = "permCustom5", column = "PERM_CUSTOM_5"),
@Result(property = "permCustom6", column = "PERM_CUSTOM_6"),
@Result(property = "permCustom7", column = "PERM_CUSTOM_7"),
@Result(property = "permCustom8", column = "PERM_CUSTOM_8")})
List<WorkbasketAccessItem> findByWorkbasketKey(@Param("key") String key);
示例5: findAll
import org.apache.ibatis.annotations.Select; //导入依赖的package包/类
@Select("SELECT ID, WORKBASKET_KEY, ACCESS_ID, PERM_READ, PERM_OPEN, PERM_APPEND, PERM_TRANSFER, PERM_DISTRIBUTE, PERM_CUSTOM_1, PERM_CUSTOM_2, PERM_CUSTOM_3, PERM_CUSTOM_4, PERM_CUSTOM_5, PERM_CUSTOM_6, PERM_CUSTOM_7, PERM_CUSTOM_8 FROM WORKBASKET_ACCESS_LIST ORDER BY ID")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "workbasketKey", column = "WORKBASKET_KEY"),
@Result(property = "accessId", column = "ACCESS_ID"),
@Result(property = "permRead", column = "PERM_READ"),
@Result(property = "permOpen", column = "PERM_OPEN"),
@Result(property = "permAppend", column = "PERM_APPEND"),
@Result(property = "permTransfer", column = "PERM_TRANSFER"),
@Result(property = "permDistribute", column = "PERM_DISTRIBUTE"),
@Result(property = "permCustom1", column = "PERM_CUSTOM_1"),
@Result(property = "permCustom2", column = "PERM_CUSTOM_2"),
@Result(property = "permCustom3", column = "PERM_CUSTOM_3"),
@Result(property = "permCustom4", column = "PERM_CUSTOM_4"),
@Result(property = "permCustom5", column = "PERM_CUSTOM_5"),
@Result(property = "permCustom6", column = "PERM_CUSTOM_6"),
@Result(property = "permCustom7", column = "PERM_CUSTOM_7"),
@Result(property = "permCustom8", column = "PERM_CUSTOM_8")})
List<WorkbasketAccessItem> findAll();
示例6: findByKey
import org.apache.ibatis.annotations.Select; //导入依赖的package包/类
@Select("SELECT ID, KEY, CREATED, MODIFIED, NAME, DOMAIN, TYPE, DESCRIPTION, OWNER, CUSTOM_1 ,CUSTOM_2 ,CUSTOM_3 ,CUSTOM_4 ,ORG_LEVEL_1 ,ORG_LEVEL_2 ,ORG_LEVEL_3 ,ORG_LEVEL_4 FROM WORKBASKET WHERE KEY = #{key}")
@Results(value = { @Result(property = "id", column = "ID"),
@Result(property = "key", column = "KEY"),
@Result(property = "created", column = "CREATED"),
@Result(property = "modified", column = "MODIFIED"),
@Result(property = "name", column = "NAME"),
@Result(property = "domain", column = "DOMAIN"),
@Result(property = "type", column = "TYPE"),
@Result(property = "description", column = "DESCRIPTION"),
@Result(property = "owner", column = "OWNER"),
@Result(property = "distributionTargets", column = "ID", javaType = List.class,
many = @Many(fetchType = FetchType.DEFAULT, select = "findByDistributionTargets")),
@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 = "orgLevel1", column = "ORG_LEVEL_1"),
@Result(property = "orgLevel2", column = "ORG_LEVEL_2"),
@Result(property = "orgLevel3", column = "ORG_LEVEL_3"),
@Result(property = "orgLevel4", column = "ORG_LEVEL_4")})
WorkbasketImpl findByKey(@Param("key") String key);
示例7: IN
import org.apache.ibatis.annotations.Select; //导入依赖的package包/类
@Select("SELECT * FROM WORKBASKET WHERE id IN (SELECT TARGET_ID FROM DISTRIBUTION_TARGETS WHERE SOURCE_ID = #{id})")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "key", column = "KEY"),
@Result(property = "name", column = "NAME"),
@Result(property = "description", column = "DESCRIPTION"),
@Result(property = "owner", column = "OWNER"),
@Result(property = "domain", column = "DOMAIN"),
@Result(property = "type", column = "TYPE"),
@Result(property = "orgLevel1", column = "ORG_LEVEL_1"),
@Result(property = "orgLevel2", column = "ORG_LEVEL_2"),
@Result(property = "orgLevel3", column = "ORG_LEVEL_3"),
@Result(property = "orgLevel4", column = "ORG_LEVEL_4")})
List<WorkbasketSummary> findByDistributionTargets(@Param("id") String id);
示例8: getTaskCountForWorkbasketByDaysInPastAndState
import org.apache.ibatis.annotations.Select; //导入依赖的package包/类
@Select("<script>"
+ "SELECT COUNT (*) "
+ "FROM TASK "
+ "WHERE WORKBASKETID = #{workbasketId} "
+ "AND DUE >= #{fromDate} "
+ "AND STATE IN (<foreach collection='status' item='state' separator=','>#{state}</foreach>)"
+ "</script>")
long getTaskCountForWorkbasketByDaysInPastAndState(@Param("workbasketId") String workbasketId,
@Param("fromDate") Date fromDate, @Param("status") List<TaskState> states);
示例9: findByObjectReference
import org.apache.ibatis.annotations.Select; //导入依赖的package包/类
@Select("SELECT ID, COMPANY, SYSTEM, SYSTEM_INSTANCE, TYPE, VALUE "
+ "FROM OBJECT_REFERENCE "
+ "WHERE COMPANY = #{objectReference.company} "
+ "AND SYSTEM = #{objectReference.system} "
+ "AND SYSTEM_INSTANCE = #{objectReference.systemInstance} "
+ "AND TYPE = #{objectReference.type} "
+ "AND VALUE = #{objectReference.value}")
@Results({
@Result(property = "id", column = "ID"),
@Result(property = "company", column = "COMPANY"),
@Result(property = "system", column = "SYSTEM"),
@Result(property = "systemInstance", column = "SYSTEM_INSTANCE"),
@Result(property = "type", column = "TYPE"),
@Result(property = "value", column = "VALUE") })
ObjectReference findByObjectReference(@Param("objectReference") ObjectReference objectReference);
示例10: findAll
import org.apache.ibatis.annotations.Select; //导入依赖的package包/类
@Select("SELECT * FROM WORKBASKET ORDER BY id")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "key", column = "KEY"),
@Result(property = "name", column = "NAME"),
@Result(property = "description", column = "DESCRIPTION"),
@Result(property = "owner", column = "OWNER"),
@Result(property = "domain", column = "DOMAIN"),
@Result(property = "type", column = "TYPE"),
@Result(property = "orgLevel1", column = "ORG_LEVEL_1"),
@Result(property = "orgLevel2", column = "ORG_LEVEL_2"),
@Result(property = "orgLevel3", column = "ORG_LEVEL_3"),
@Result(property = "orgLevel4", column = "ORG_LEVEL_4")})
List<WorkbasketSummary> findAll();
示例11: findByPermission
import org.apache.ibatis.annotations.Select; //导入依赖的package包/类
@Select("<script>SELECT W.ID, W.KEY, W.NAME, W.DESCRIPTION, W.OWNER, W.DOMAIN, W.TYPE, W.ORG_LEVEL_1, W.ORG_LEVEL_2, W.ORG_LEVEL_3, W.ORG_LEVEL_4 FROM WORKBASKET AS W "
+ "INNER JOIN WORKBASKET_ACCESS_LIST AS ACL "
+ "ON (W.KEY = ACL.WORKBASKET_KEY AND ACL.ACCESS_ID = #{accessId}) "
+ "WHERE <foreach collection='authorizations' item='authorization' separator=' AND '>"
+ "<if test=\"authorization.name() == 'OPEN'\">PERM_OPEN</if>"
+ "<if test=\"authorization.name() == 'READ'\">PERM_READ</if>"
+ "<if test=\"authorization.name() == 'APPEND'\">PERM_APPEND</if>"
+ "<if test=\"authorization.name() == 'TRANSFER'\">PERM_TRANSFER</if>"
+ "<if test=\"authorization.name() == 'DISTRIBUTE'\">PERM_DISTRIBUTE</if>"
+ "<if test=\"authorization.name() == 'CUSTOM_1'\">PERM_CUSTOM_1</if>"
+ "<if test=\"authorization.name() == 'CUSTOM_2'\">PERM_CUSTOM_2</if>"
+ "<if test=\"authorization.name() == 'CUSTOM_3'\">PERM_CUSTOM_3</if>"
+ "<if test=\"authorization.name() == 'CUSTOM_4'\">PERM_CUSTOM_4</if>"
+ "<if test=\"authorization.name() == 'CUSTOM_5'\">PERM_CUSTOM_5</if>"
+ "<if test=\"authorization.name() == 'CUSTOM_6'\">PERM_CUSTOM_6</if>"
+ "<if test=\"authorization.name() == 'CUSTOM_7'\">PERM_CUSTOM_7</if>"
+ "<if test=\"authorization.name() == 'CUSTOM_8'\">PERM_CUSTOM_8</if> = 1 </foreach> "
+ "ORDER BY id</script>")
@Results(value = {
@Result(property = "id", column = "ID"),
@Result(property = "key", column = "KEY"),
@Result(property = "modified", column = "MODIFIED"),
@Result(property = "name", column = "NAME"),
@Result(property = "description", column = "DESCRIPTION"),
@Result(property = "owner", column = "OWNER"),
@Result(property = "domain", column = "DOMAIN"),
@Result(property = "type", column = "TYPE"),
@Result(property = "orgLevel1", column = "ORG_LEVEL_1"),
@Result(property = "orgLevel2", column = "ORG_LEVEL_2"),
@Result(property = "orgLevel3", column = "ORG_LEVEL_3"),
@Result(property = "orgLevel4", column = "ORG_LEVEL_4")})
List<WorkbasketSummary> findByPermission(@Param("authorizations") List<WorkbasketAuthorization> authorizations,
@Param("accessId") String accessId);
示例12: findByKeyAndDomain
import org.apache.ibatis.annotations.Select; //导入依赖的package包/类
@Select("SELECT ID, KEY, PARENT_CLASSIFICATION_KEY, CATEGORY, TYPE, DOMAIN, VALID_IN_DOMAIN, CREATED, NAME, DESCRIPTION, PRIORITY, SERVICE_LEVEL, APPLICATION_ENTRY_POINT, CUSTOM_1, CUSTOM_2, CUSTOM_3, CUSTOM_4, CUSTOM_5, CUSTOM_6, CUSTOM_7, CUSTOM_8, VALID_FROM, VALID_UNTIL "
+ "FROM CLASSIFICATION "
+ "WHERE KEY = #{key}"
+ "AND DOMAIN = #{domain}"
+ "AND VALID_UNTIL = #{valid_until}")
@Results({ @Result(property = "id", column = "ID"),
@Result(property = "key", column = "KEY"),
@Result(property = "parentClassificationKey", column = "PARENT_CLASSIFICATION_KEY"),
@Result(property = "category", column = "CATEGORY"),
@Result(property = "type", column = "TYPE"),
@Result(property = "domain", column = "DOMAIN"),
@Result(property = "isValidInDomain", column = "VALID_IN_DOMAIN"),
@Result(property = "created", column = "CREATED"),
@Result(property = "name", column = "NAME"),
@Result(property = "description", column = "DESCRIPTION"),
@Result(property = "priority", column = "PRIORITY"),
@Result(property = "serviceLevel", column = "SERVICE_LEVEL"),
@Result(property = "applicationEntryPoint", column = "APPLICATION_ENTRY_POINT"),
@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 = "validFrom", column = "VALID_FROM"),
@Result(property = "validUntil", column = "VALID_UNTIL") })
ClassificationImpl findByKeyAndDomain(@Param("key") String key, @Param("domain") String domain,
@Param("valid_until") Date validUntil);
示例13: selectByPrimaryKey
import org.apache.ibatis.annotations.Select; //导入依赖的package包/类
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table SysCode
*
* @mbggenerated Wed Jul 12 20:57:03 CST 2017
*/
@Select({
"select",
"codeId, codeTypeId, codeName, parentCodeId",
"from SysCode",
"where codeId = #{codeId,jdbcType=INTEGER}"
})
@Results({
@Result(column="codeId", property="codeId", jdbcType=JdbcType.INTEGER, id=true),
@Result(column="codeTypeId", property="codeTypeId", jdbcType=JdbcType.INTEGER),
@Result(column="codeName", property="codeName", jdbcType=JdbcType.VARCHAR),
@Result(column="parentCodeId", property="parentCodeId", jdbcType=JdbcType.INTEGER)
})
SysCode selectByPrimaryKey(Integer codeId);
示例14: getInfoByName
import org.apache.ibatis.annotations.Select; //导入依赖的package包/类
@Select("select `id`, `name`, `age`, `score` from demo_table where name = #{name}")
DemoInfo getInfoByName(@Param("name") String name);
示例15: getUserInfo
import org.apache.ibatis.annotations.Select; //导入依赖的package包/类
/**
* 查询用户信息
* @param openId
* @return
*/
@Select("select * from userinfo t where t.openId = #{openId}")
@Results({
@Result(property = "id", column = "id"),
@Result(property = "openId", column = "openId"),
@Result(property = "nickName", column = "nickname"),
@Result(property = "sex", column = "sex"),
@Result(property = "language", column = "language"),
@Result(property = "city", column = "city"),
@Result(property = "provience", column = "provience"),
@Result(property = "country", column = "country"),
@Result(property = "headImgUrl", column = "headImgUrl"),
@Result(property = "privilege", column = "privilege"),
})
UserInfo getUserInfo(String openId);