下面列出了org.apache.ibatis.annotations.SelectProvider#org.apache.ibatis.annotations.ResultType 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Cache
@Select("SELECT union_id FROM weixin_bindings where user_id=#{userId} limit 1")
@ResultType(String.class)
String findWxUnionIdByUserId(@Param("userId") int userId);
@Select("select role_id AS roleId from user_role where user_id = #{userId}")
@ResultType(Long.class)
List<Long> selectRoleIdListByUserId(@Param("userId") Long userId);
@Select("SELECT attr_name as key,attr_value as value FROM profile_extr_attrs WHERE profile=#{profile}")
@ResultType(KeyValuePair.class)
List<KeyValuePair> findExtrAttrs(String profile);
@Select("SELECT attr_value FROM profile_extr_attrs WHERE profile=#{profile} and attr_name=#{name}")
@ResultType(String.class)
String findExtrAttr(@Param("profile")String profile,@Param("name") String name);
@SelectProvider(type = CountByExampleProvider.class, method = "countByExample")
@ResultType(Long.class)
long countByExample(T example);
@ResultType(String.class)
@SelectProvider(type = ImpInvtHeadSqlProvide.class, method = "getCopNoListSql")
List<String> getCopNoList(String applyCode);
@ResultType(Long.class)
@SelectProvider(type = ImpPayHeadSqlProvide.class, method = "countImpPayHeadSql")
Long countImpPayHead(ImpPayHead impPayHead);
@ResultType(Long.class)
@SelectProvider(type = InvtListSqlProvide.class, method = "countInvtListSql")
Long countInvtList(String headGuid);
@ResultType(Long.class)
@SelectProvider(type = InvtHeadSqlProvide.class, method = "getInvtHeadCountSql")
Long getInvtHeadCount(String countType);
@ResultType(Integer.class)
@SelectProvider(type = InvtHeadSqlProvide.class, method = "countInvtHeadSql")
Integer countInvtHead(InvtHead invtHead);
@ResultType(Long.class)
@SelectProvider(type = DistBillListSqlProvide.class, method = "countDistBillListSql")
Long countDistBillList(String seqNo);
@ResultType(Long.class)
@SelectProvider(type = PubRtnSqlProvide.class, method = "countPubRtnByBizGuidSql")
Long countPubRtnByBizGuid(String bizGuid);
@ResultType(Long.class)
@SelectProvider(type = OrderListSqlProvide.class, method = "countOrderListSql")
Long countOrderList(String headGuid);
@ResultType(Long.class)
@SelectProvider(type = CustomsSqlProvide.class, method = "countCustomsSql")
Long countCustoms();
@ResultType(Long.class)
@SelectProvider(type = CountrySqlProvide.class, method = "countCountriesSql")
Long countCountries();
@ResultType(Long.class)
@Select("select last_sync_time from last_sync_payment_time where sync_id = 1")
Long getSyncTime();
@Select("select * from users")
@ResultType(User.class)
void getAllUsers(UserResultHandler resultHandler);
@Select("select * from users")
@ResultType(User.class)
void getAllUsers(UserResultHandler resultHandler);
/**
* 根据监管用户ID查找企业
*
* @param userId
* @return
*/
@Select("select t.enterprise_id as enterpriseId from t_sys_user_enterprise t LEFT JOIN t_sys_user t2 on t.user_id=t2.id where t2.id=#{userId}")
@ResultType(String.class)
List<String> selectEnterpriseIdByUserId(@Param("userId") Long userId);
/**
* 根据监管用户名称查找关联的企业
*
* @param loginName
* @return
*/
@Select("select t.enterprise_id as enterpriseId from t_sys_user_enterprise t LEFT JOIN t_sys_user t2 on t.user_id=t2.id where t2.login_name=#{loginName}")
@ResultType(String.class)
List<String> selectEnterpriseIdByUserName(@Param("loginName") String loginName);
/**
* 根据角色查找菜单ID集合
*
* @param roleId
* @return
*/
@Select("select t.resource_id from t_sys_role_resource t where t.role_id=#{roleId}")
@ResultType(Long.class)
List<Long> selectResourceIdListByRoleId(@Param("roleId") Long roleId);
/**
* 根据用户ID查找用户角色ID集合
*
* @param userId
* @return
*/
@Select("select t.role_id from t_sys_user_role t where t.user_id=#{userId}")
@ResultType(Long.class)
List<Long> selectRoleIdListByUserId(@Param("userId") Long userId);
/**
* 条件查询
* 自定议显示字段传入 model.params,为空时为所有字段
* 条件传入model.QueryCriteria
* @param model
* @return
*/
@SelectProvider(method = "selectByCriteria", type = SqlTemplate.class)
@ResultType(value = List.class)
List<Map<String, Object>> selectByCriteria(Table model);
/**
* 主键查询
* 自定议显示字段传入 model.params,为空时为所有字段
* 主键参数传入 model.conditions,不能为空
* @param model
* @return
*/
@SelectProvider(method = "selectByPrimaryKey", type = SqlTemplate.class)
@ResultType(value = Map.class)
Map<String, Object> selectByPrimaryKey(Table model);
/**
* 条件count
* 条件传入model.QueryCriteria
* @param model
* @return
*/
@SelectProvider(method = "countByCriteria", type = SqlTemplate.class)
@ResultType(value = Integer.class)
int countByCriteria(Table model);