关于报表
来源:互联网 发布:mac软件商店 编辑:程序博客网 时间:2024/06/03 17:48
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER proc [dbo].[PRptsys_dongli]
@beginTime varchar(100),
@endTime varchar(100),
@storename varchar(100),
@username varchar(100),
@usernumber varchar(100),
@saleareacode VARCHAR(100),
@xwPageIndex int, --开始页码
@xwPageSize int --行数
as
declare @sql varchar(8000)
declare @where varchar(2000)
set @where=' where 1=1 '
if @beginTime is not null and @beginTime <>''
set @where = @where + ' and convert(varchar(10),visittime,120) >= '''+@beginTime+''' '
if @endTime is not null and @endTime <>''
set @where = @where + ' and convert(varchar(10),visittime,120) <= '''+@endTime+''''
if @storename is not null and @storename <>''
set @where = @where + ' and storename like ''%'+@storename+'%'' '
if @username is not null and @username <>''
set @where = @where + ' and username like ''%'+@username+'%'' '
if @usernumber is not null and @usernumber <>''
set @where = @where + ' and UserNumber like ''%'+@usernumber+'%'' '
if @saleareacode IS NOT NULL AND @saleareacode <>''
set @where = @where + ' and (SaleAreacode ='''+@saleareacode+'''' +'or saleareacode like '''+@saleareacode+'.%'')'
set @sql='(SELECT t1.id,t2.StoreName,t4.saleareacode,t4.saleareaname
,t1.miaoshu1,t1.img_photo1,t1.miaoshu2,t1.img_photo2,t1.miaoshu3,t1.img_photo3,t3.usernumber,CONVERT(VARCHAR(100),t1.visittime,20) AS visittime,t3.UserName,t3.mobilephone,t1.col1,t1.col2,t1.col3,t1.col4
FROM dbo.sys_dongli t1 LEFT JOIN dbo.TBasStore t2 ON t1.storeguid = t2.Guid
LEFT JOIN dbo.TBasUserInfo t3 ON t1.usernumber = t3.UserNumber
left join tbassalearea t4 on t2.saleareaid = t4.saleareaid
) aa'
EXEC dbo.PSysPager_Rpt1
@Tables = @sql,
@PK = 'visittime',
@countFields = 'null as id,
null as storename ,
null as saleareacode,
null as saleareaname,
null as miaoshu1 ,
null as img_photo1 ,
null as miaoshu2 ,
null as img_photo2 ,
null as miaoshu3,
null as img_photo3 ,
null as usernumber,
null as visittime,
null as username ,
null as mobilephone,
null as col1,
null as col2,
null as col3,
null as col4 ',
@Fields = 'id,storename,saleareacode,saleareaname,miaoshu1,img_photo1,miaoshu2,img_photo2,miaoshu3,img_photo3,usernumber,
visittime,username,mobilephone,col1,col2,col3,col4',
@Filter = @where ,--Where条件
@xwPageIndex = @xwPageIndex, --开始页码
@xwPageSize = @xwPageSize --行数
- 关于报表
- 关于报表
- 关于报表
- 关于报表
- 关于水晶报表
- 关于dot net 报表
- --关于报表打印
- 关于 Excel 制作报表
- SAP关于smartforms报表
- 关于报表以及finereport报表软软件
- 关于使用EZgen 报表 手册
- guan关于报表后台运行
- 关于水晶报表的问题
- 关于水晶报表打印格式
- 关于rdlc报表的数据源
- 关于Birt报表的设计
- 关于“水晶报表”直连
- 关于报表变量的实质
- mysql学习
- ubuntu 使用中遇到的问题总结
- android binder机制
- 无头单链表逆序(法一)
- 最近的Fibonacci数
- 关于报表
- 无头单链表逆序(法二)
- 简单定制chkconfig
- 创业公司的股权分配
- 螺旋遍历二叉树 Spiral-order traversal
- leetcode Add Binary
- leetcode Merge Two Sorted Lists
- 程序员学习能力提升三要素
- Android开发系列七:怎么定时刷新界面