CREATE PROCEDURE sp_Use
(
name nvachar(20),
type int,
time datetime
)
as
begin
select *from a as c
left outer join b as d
on c.id=d.id
end
ALTER PROC [dbo].[TmpCdInOutInfoHis_GetNewPhotoList_Ma]
@cdCode varchar(50), --卡编号
@inDevName varchar(10), --入场口
@inTmBgTm datetime, --人场时间开始时间
@inTmEndTm datetime, --人场时间截止时间
@outDevName varchar(10), --出场口
@outTmBgTm datetime, --出场时间开始时间
@outTmEndTm datetime --出场时间截止时间
AS
SELECT
serNum,--交易流水
code,--卡编号
inTm,--入场时间
inDevName,--入场口
inUName,--入场员工
inPic,--入场照片
outTm,--出场时间
outDevName,--出场口
outUName,--出场员工
outPic--出场照片
FROM (
SELECT
serialNum serNum,--交易流水
cdCode code,--卡编号
inTm,--入场时间
inDevName,--入场口
inUName,--入场员工
inPic,--入场照片
outTm,--出场时间
outDevName,--出场口
outUName,--出场员工
outPic--出场照片
FROM TmpCdInOutInforHis_View_Ma)T
WHERE (@cdCode='' or @cdCode is null or code=@cdCode)
and(@inDevName ='' or @inDevName is null or inDevName=@inDevName)
and (@inTmBgTm is null or inTm >= '' +CONVERT(VARCHAR(100),@inTmBgTm,120)+'')
and (@inTmEndTm is null or inTm <= '' +CONVERT(VARCHAR(100),@inTmEndTm,120)+'' )
and (@outTMBgTm is null or outTm >= '' +CONVERT(VARCHAR(100),@outTMBgTm,120)+'')
and (@outTmEndTm is null or outTm <= '' +CONVERT(VARCHAR(100),@outTmEndTm,120)+'' )
and (@outDevName ='' or @outDevName is null or outDevName=@outDevName)