@Query("select business.businessId, business.businessName from Business business where business.isActive = 'Y' and business.businessId >= 0 order by business.businessId")
List<Object[]>findAllBusinessIdAndBusinessName();
//加入isActive=N || add by August 2014-3-27
@Query("select business.businessId, business.businessName from Business business where business.isActive = 'Y' and business.businessId >= 0 order by business.businessId")
//加入isActive=N || add by August 2014-3-27
List<Object[]>findAllBusinessIdAndBusinessName();
//由数据来源和渠道得到业务
@Query("select business.businessId, business.businessName from Business business,ChannelDataSourceMap channelDataSourceMap where business.channelDataSourceMapId=channelDataSourceMap.channelDataSourceMapId and channelDataSourceMap.channelId IN (:channelIdList) and channelDataSourceMap.dataSourceId IN (:datasourceIdList) and business.isActive = 'Y' and business.businessId >= 0 order by business.businessId ")
@Query("select business.businessId, business.businessName from Business business,ChannelDataSourceMap channelDataSourceMap where business.channelDataSourceMapId=channelDataSourceMap.channelDataSourceMapId and channelDataSourceMap.channelId IN (:channelIdList) and channelDataSourceMap.dataSourceId IN (:datasourceIdList) and business.isActive = 'Y' and business.businessId >= 0 order by business.businessId ")
@Query("select business.businessId, business.businessName from Business business,ChannelDataSourceMap channelDataSourceMap where business.channelDataSourceMapId=channelDataSourceMap.channelDataSourceMapId and channelDataSourceMap.channelId IN (:channelIdList) and channelDataSourceMap.dataSourceId IN (:datasourceIdList) and business.isActive = 'Y' and business.businessId >= 0 and business_id<>899 order by business.businessId ")
@Query("select business.businessId, business.businessName from Business business,ChannelDataSourceMap channelDataSourceMap where business.channelDataSourceMapId=channelDataSourceMap.channelDataSourceMapId and channelDataSourceMap.channelId IN (:channelIdList) and channelDataSourceMap.dataSourceId IN (:datasourceIdList) and business.isActive = 'Y' and business.businessId >= 0 and business_id<>899 order by business.businessId ")
@Query("select business.businessId, business.businessName from Business business,ChannelDataSourceMap channelDataSourceMap where business.channelDataSourceMapId=channelDataSourceMap.channelDataSourceMapId and channelDataSourceMap.channelId = :channelIdList and channelDataSourceMap.dataSourceId =:datasourceIdList and business.businessId >= 0 order by business.businessId")
@Query("select business.businessId, business.businessName from Business business,ChannelDataSourceMap channelDataSourceMap where business.channelDataSourceMapId=channelDataSourceMap.channelDataSourceMapId and channelDataSourceMap.channelId = :channelIdList and channelDataSourceMap.dataSourceId =:datasourceIdList and business.businessId >= 0 order by business.businessId")
@Query("select business.businessId, business.businessName from Business business,ChannelDataSourceMap channelDataSourceMap where business.isActive = 'Y' and business.channelDataSourceMapId=channelDataSourceMap.channelDataSourceMapId and channelDataSourceMap.channelId = :channelId and channelDataSourceMap.dataSourceId =:datasourceId and business.businessId >= 0 order by business.businessId")
@Query("select business.businessId, business.businessName from Business business,ChannelDataSourceMap channelDataSourceMap where business.isActive = 'Y' and business.channelDataSourceMapId=channelDataSourceMap.channelDataSourceMapId and channelDataSourceMap.channelId = :channelId and channelDataSourceMap.dataSourceId =:datasourceId and business.businessId >= 0 order by business.businessId")
@Query("select business.businessId, business.businessName from Business business,ChannelDataSourceMap channelDataSourceMap,Channel channel where channel.channelId=channelDataSourceMap.channelId and business.channelDataSourceMapId=channelDataSourceMap.channelDataSourceMapId and channel.channelName=:channelName and business.businessId >= 0 order by business.businessId")
@Query("select business.businessId, business.businessName from Business business,ChannelDataSourceMap channelDataSourceMap,Channel channel where channel.channelId=channelDataSourceMap.channelId and business.channelDataSourceMapId=channelDataSourceMap.channelDataSourceMapId and channel.channelName=:channelName and business.businessId >= 0 order by business.businessId")
@Query("select business.businessId,business.businessName from Business business,ChannelDataSourceMap channelDataSourceMap where business.channelDataSourceMapId=channelDataSourceMap.channelDataSourceMapId and business.ifCompetitionBusiness='Y' and business.isActive = 'Y' and channelDataSourceMap.dataSourceId = '1' and channelDataSourceMap.channelId IN (:channelIdList) and business.businessId >= 0 order by business.businessId")
@Query("select business.businessId, business.businessName from Business business,AnalysisTypeDsCMap analysisTypeDsCMap where business.channelDataSourceMapId=analysisTypeDsCMap.channelDataSourceMapId and analysisTypeDsCMap.channelId IN (:channelIdList) and analysisTypeDsCMap.dataSourceId IN (:datasourceIdList) and business.isActive = 'Y' and business.businessId >= 0 order by business.businessId")
@Query("select business.businessId,business.businessName from Business business,ChannelDataSourceMap channelDataSourceMap where business.channelDataSourceMapId=channelDataSourceMap.channelDataSourceMapId and business.ifCompetitionBusiness='Y' and business.isActive = 'Y' and channelDataSourceMap.dataSourceId = '1' and channelDataSourceMap.channelId IN (:channelIdList) and business.businessId >= 0 order by business.businessId")
@Query("select business.businessId, business.businessName from Business business,AnalysisTypeDsCMap analysisTypeDsCMap where business.channelDataSourceMapId=analysisTypeDsCMap.channelDataSourceMapId and analysisTypeDsCMap.channelId IN (:channelIdList) and analysisTypeDsCMap.dataSourceId IN (:datasourceIdList) and business.isActive = 'Y' and business.businessId >= 0 order by business.businessId")
@Query("select business from Business business where business.isActive = :isActived and business.channelDataSourceMapId in (:channelDataSourceMapIdList)")
@Query("select sourceMap.channelDataSourceMapId from ChannelDataSourceMap sourceMap where sourceMap.channelId = :channelId and sourceMap.dataSourceId = :dataSourceId")
@Query("select sourceMap.channelDataSourceMapId from ChannelDataSourceMap sourceMap where sourceMap.channelId in (:channelList) and sourceMap.dataSourceId in (:dataSourceList)")