SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: eapp
-- Create date: 2010-12-2 12:30
-- Description: 客户发展趋势统计表,根据参数,计算本年到现在为止的客户发展趋势
-- =============================================
CREATE PROCEDURE [Proc_AnalyseByTrend]
@date datetime
,@UserId int
AS
BEGIN
declare @mm int
declare @yyyy int
set @mm = month(@date)
set @yyyy = year(@date)
declare @tem int --循环变量
set @tem = 1 --初始为1
declare @sql varchar(4000)
set @sql = 'select * from ('
while(@tem <= @mm)
begin
set @sql = @sql + 'select isnull(Count(enterDate),0) as [Count]
,'''+ cast(@yyyy as varchar(10)) +''' as [Year]
, '+ cast(@tem as varchar(10)) +' as [Month] from crm_Customer
where (Deleted=0 and IsShare=0) and (AssignObject=''user''
and (AssignObjectId = ' + cast(@UserId as varchar(100)) + ' or ' + cast(@UserId as varchar(20)) + '=0)
) and (year(enterDate) = '+ cast(@yyyy as varchar(10)) +' and month(enterdate)='+cast(@tem as varchar(10))+')
union '
set @tem = @tem + 1
end
set @sql = substring(@sql,0,len(@sql)-5)
set @sql = @sql + ') as tab order by tab.[Month]'
exec(@sql)
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
CREATE PROCEDURE [Proc_Analyse]
@AssignObject varchar(20) = 'user'
,@AssignObjectId int = 0
,@Type int
AS
BEGIN
declare @strWhere varchar(1000) --主查询条件
declare @strSql varchar(2000) --完整查询语句
if(@AssignObject='')
set @AssignObject = 'user'
set @strWhere = 'where 1=1 and (IsShare=0 and Deleted=0)'
if(@AssignObjectId <> 0)
set @strWhere = @strWhere + ' and (AssignObject = ''' + @AssignObject + ''' and AssignObjectId = ' + cast(@AssignObjectId as varchar(10)) + ')'
else
set @strWhere = @strWhere + ' and (AssignObject = ''' + @AssignObject + ''')'
--{0} id {1} name {2} 表
set @strSql = 'select count({0}) as [Count],isnull((select {1} from {2} where {2}.{0} = crm_Customer.{0}) ,''其他'') as [DisplayName] from crm_Customer ' + @strWhere + ' group by crm_Customer.{0}'
if(@Type=0)
begin
set @strSql = REPLACE(@strSql,'{0}','SourceId')
set @strSql = REPLACE(@strSql,'{1}','Source')
set @strSql = REPLACE(@strSql,'{2}','crm_CustomerSource')
end
else if(@Type=1)
begin
set @strSql = REPLACE(@strSql,'{0}','StateId')
set @strSql = REPLACE(@strSql,'{1}','Name')
set @strSql = REPLACE(@strSql,'{2}','crm_CustomerState')
end
else if(@Type=2)
begin
set @strSql = REPLACE(@strSql,'{0}','TypeId')
set @strSql = REPLACE(@strSql,'{1}','TypeName')
set @strSql = REPLACE(@strSql,'{2}','crm_CustomerType')
end
else if(@Type=3)
begin
set @strSql = REPLACE(@strSql,'{0}','TradeId')
set @strSql = REPLACE(@strSql,'{1}','TradeName')
set @strSql = REPLACE(@strSql,'{2}','crm_Trade')
end
--print @strSql
execute(@strSql)
end
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
Create PROCEDURE [Proc_CommonSelect]
(
@Top varchar(5),
@Columns varchar(2000),
@Table varchar(50),
@Where varchar(1000),
@Order varchar(100)
)
AS
begin
declare @sql varchar(4000)
set @sql = 'select '
if ''<>@Top and @Top <> '0'
set @sql = @sql + ' top ' + @Top + ' '
if ''=@Columns
set @sql = @sql + ' * '
else
set @sql = @sql + ' ' + @Columns + ' '
set @sql = @sql + ' from ' + @Table + ' '
If @Where <> ''
set @sql = @sql + ' where ' + @Where + ' '
If @Order <> ''
set @sql = @sql + ' Order By ' + @Order + ' '
execute(@sql)
end
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: eapp
-- Create date: 2010-11-17 14:46
-- Description: 根据表名和条件删除指定表的一条或多条记录。
-- ==========================�
没有合适的资源?快使用搜索试试~ 我知道了~
大型CRM系统.rar
共2000个文件
js:540个
css:324个
gif:316个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 185 浏览量
2024-04-14
10:00:05
上传
评论
收藏 9.9MB RAR 举报
温馨提示
大型CRM系统.rar大型CRM系统.rar大型CRM系统.rar大型CRM系统.rar
资源推荐
资源详情
资源评论
收起资源包目录
大型CRM系统.rar (2000个子文件)
Area.ascx 793B
Area.ascx 793B
Area.ascx 793B
CustomerCombine.aspx 32KB
CustomerCombine.aspx 32KB
CustomerList.aspx 22KB
CustomerList.aspx 22KB
AddCustomer.aspx 18KB
AddCustomer.aspx 18KB
AddCustomer.aspx 18KB
Customer.aspx 16KB
Customer.aspx 16KB
Customer.aspx 16KB
EditCustomer.aspx 13KB
EditCustomer.aspx 13KB
EditUser.aspx 11KB
EditUser.aspx 11KB
AddUser.aspx 10KB
AddUser.aspx 10KB
AddUser.aspx 10KB
Popedom.aspx 10KB
Popedom.aspx 10KB
Popedom.aspx 10KB
EditFllowUpPlan.aspx 9KB
EditFllowUpPlan.aspx 9KB
EditFllowUpPlan.aspx 9KB
AddContacts.aspx 8KB
AddContacts.aspx 8KB
AddContacts.aspx 8KB
EditContacts.aspx 8KB
EditContacts.aspx 8KB
EditContacts.aspx 8KB
Area.aspx 8KB
Area.aspx 8KB
Area.aspx 8KB
AddFllowUpPlan.aspx 7KB
AddFllowUpPlan.aspx 7KB
SearchContact.aspx 7KB
SearchContact.aspx 7KB
SendMail.aspx 6KB
SendMail.aspx 6KB
SendMail.aspx 6KB
CustomerState.aspx 6KB
CustomerState.aspx 6KB
CustomerState.aspx 6KB
CustomerSource.aspx 6KB
CustomerSource.aspx 6KB
CustomerSource.aspx 6KB
CustomerTrade.aspx 6KB
CustomerTrade.aspx 6KB
CustomerTrade.aspx 6KB
Role.aspx 6KB
Role.aspx 6KB
User.aspx 5KB
User.aspx 5KB
CustomerType.aspx 5KB
CustomerType.aspx 5KB
CustomerType.aspx 5KB
Department.aspx 5KB
Department.aspx 5KB
Department.aspx 5KB
SmtpConfig.aspx 5KB
SmtpConfig.aspx 5KB
ChangePassWord.aspx 5KB
ChangePassWord.aspx 5KB
Report.aspx 4KB
Report.aspx 4KB
Report.aspx 4KB
Main.aspx 4KB
Main.aspx 4KB
Main.aspx 4KB
Assigning.aspx 3KB
Assigning.aspx 3KB
Assigning.aspx 3KB
PartArea.aspx 2KB
PartArea.aspx 2KB
PartArea.aspx 2KB
Login.aspx 2KB
Login.aspx 2KB
SmtpConfit.aspx 2KB
Settings.aspx 2KB
Settings.aspx 2KB
SearchCustomer.aspx 481B
SearchCustomer.aspx 481B
SearchCustomer.aspx 481B
Logout.aspx 456B
Logout.aspx 456B
ResolveAssemblyReference.cache 161KB
EAPP.CRM.Web.csprojResolveAssemblyReference.cache 154KB
ResolveAssemblyReference.cache 128KB
DesignTimeResolveAssemblyReferencesInput.cache 70KB
DesignTimeResolveAssemblyReferencesInput.cache 62KB
ResolveAssemblyReference.cache 38KB
EAPP.CRM.BLL.csprojResolveAssemblyReference.cache 28KB
ResolveAssemblyReference.cache 25KB
ResolveAssemblyReference.cache 24KB
EAPP.CRM.DAL.csprojResolveAssemblyReference.cache 21KB
ResolveAssemblyReference.cache 18KB
ResolveAssemblyReference.cache 18KB
EAPP.CRM.Config.csprojResolveAssemblyReference.cache 17KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
依星net188.com
- 粉丝: 7858
- 资源: 2094
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功