select convert(char(10),c_au_dt,120) as 日期, c_id as 单据号, c_au_userno+u.c_name as 操作员, t.node.value('c_col1[1]','varchar(1000)') as 沃尔玛卡号, t.node.value('c_col2[1]','varchar(1000)') as 新象城卡号, t.node.value('c_col3[1]','varchar(1000)') as 类型, t.node.value('c_col4[1]','varchar(1000)') as 面值, t.node.value('c_col5[1]','varchar(1000)') as 手续费, t.node.value('c_col6[1]','varchar(1000)') as 合计, t.node.value('c_col7[1]','varchar(1000)') as 现金, t.node.value('c_col8[1]','varchar(1000)') as 银行卡, t.node.value('c_col9[1]','varchar(1000)') as 付款合计, t.node.value('c_col10[1]','varchar(1000)') as 备注 from tbc_eform_data td cross apply c_data.nodes('/rows/row/DateList/drows/drow') as t(node),tb_user u where td.c_au_userno=u.c_userno and c_eform_guid='770831CD-5A88-4C4F-B70D-A9A681E1FF25' and td.c_status='已审核' and (@操作员=''or @操作员 is null or c_au_userno=@操作员) and (@类型 is null or @类型='' or c_data.value('(/rows/row/DateList/drows/drow/c_col3)[1]','nvarchar(max)')=@类型) and t.node.value('c_col1[1]','varchar(1000)')<>'' and td.c_status='已审核' and datediff(day,c_au_dt,@开始日期)<=0 and datediff(day,c_au_dt,@结束日期)>=0
|