|
|
|
|
|
|
|
|
|
USE QingDao_ShaXuan
|
|
|
|
|
GO
|
|
|
|
|
|
|
|
|
|
SELECT * FROM TUser
|
|
|
|
|
/*
|
|
|
|
|
SELECT * FROM TMember WHERE FMemNo = '00101096'
|
|
|
|
|
UPDATE TConsumeBill SET FMemID = 8148641139645296588 WHERE FMemNo = '00101096'
|
|
|
|
|
|
|
|
|
|
SELECT * FROM TMemberCard WHERE FCardId in(4638846115086199622,
|
|
|
|
|
5402991836228192347,
|
|
|
|
|
5530833927484260303,
|
|
|
|
|
6298360195710560250,
|
|
|
|
|
8704514538916062315,
|
|
|
|
|
9100361356189603986)
|
|
|
|
|
|
|
|
|
|
UPDATE A
|
|
|
|
|
SET A.FMemId = B.FMemId
|
|
|
|
|
FROM
|
|
|
|
|
TConsumeBill AS A,TMemberCard AS B
|
|
|
|
|
WHERE A.FCardId = B.FCardId
|
|
|
|
|
AND A.FCardId in(4638846115086199622,
|
|
|
|
|
5402991836228192347,
|
|
|
|
|
5530833927484260303,
|
|
|
|
|
6298360195710560250,
|
|
|
|
|
8704514538916062315,
|
|
|
|
|
9100361356189603986)
|
|
|
|
|
SELECT * FROM TMemberCardAcctHist WHERE FCardId = 0
|
|
|
|
|
|
|
|
|
|
UPDATE TMemberCardAcctHist SET FMemId = 0 WHERE FCardId = 0
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
5578810805401765696
|
|
|
|
|
|
|
|
|
|
UPDATE TMember SET FMemNo = 'ɢ<EFBFBD><EFBFBD>',FName = '',FMobilePhone = '' WHERE FMemId = 0
|
|
|
|
|
|
|
|
|
|
SELECT * FROM TMember WHERE FMemId = 0
|
|
|
|
|
SELECT * FROM TMemberCard WHERE FMemId = 0
|
|
|
|
|
SELECT * FROM TMemberCourse WHERE FMemId = 0
|
|
|
|
|
SELECT * FROM TMemberTransHist WHERE FMemId = 0
|
|
|
|
|
SELECT * FROM TMemberCardAccount WHERE FMemId = 0
|
|
|
|
|
SELECT * FROM TMemberCardAcctHist WHERE FMemId = 0
|
|
|
|
|
SELECT * FROM TConsumeBill WHERE FMemId = 0 AND FMemNo != 'ɢ<EFBFBD><EFBFBD>'
|
|
|
|
|
SELECT * FROM TMemberSaleBill WHERE FMemId = 0
|
|
|
|
|
|
|
|
|
|
DELETE TMember WHERE FMemId = 0
|
|
|
|
|
|
|
|
|
|
INSERT TMember(FMemId,FMemNo,FName,FCompId,FTypeId,FCreateDate,FGender,FBirthdayType,FBirthday,FTelephone,FMobilePhone,FQQ,FWeChat,FIdCard,FEmail,FAddress,FProId,FChargeEmpId,FPoint,FRecvConsSMS,FRecvBulkSMS,FMemo,FCPW,FQPW)
|
|
|
|
|
VALUES (0,'ɢ<EFBFBD><EFBFBD>','ɢ<EFBFBD><EFBFBD>',1,0,'1753-01-01',0,1,0,'','','','','','','',0,0,0,0,0,'','','')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UPDATE TMemberCard SET FMemId = 22 WHERE FMemId = 0
|
|
|
|
|
UPDATE TMemberCourse SET FMemId = 22 WHERE FMemId = 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UPDATE TMember SET FMemId = 5578810805401765696 WHERE FMemId = 0
|
|
|
|
|
UPDATE TMemberCard SET FMemId = 5578810805401765696 WHERE FMemId = 22
|
|
|
|
|
UPDATE TMemberCourse SET FMemId = 5578810805401765696 WHERE FMemId = 22
|
|
|
|
|
|
|
|
|
|
UPDATE TMember SET FMemId = 0 WHERE FMemId = 22
|
|
|
|
|
|
|
|
|
|
UPDATE A
|
|
|
|
|
SET A.FMemId = B.FMemId
|
|
|
|
|
FROM TMemberCardAccount AS A,TMemberCard AS B
|
|
|
|
|
WHERE A.FCardId = B.FCardId
|
|
|
|
|
AND A.FMemId = 0
|
|
|
|
|
|
|
|
|
|
UPDATE TMemberSaleBill SET FMemId = 5578810805401765696 WHERE FMemId = 0
|
|
|
|
|
UPDATE TConsumeBill SET FMemId = 5578810805401765696 WHERE FMemId = 0 AND FMemNo != 'ɢ<EFBFBD><EFBFBD>'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UPDATE TMemberTransHist SET FMemId = 5578810805401765696 WHERE FMemId = 0
|
|
|
|
|
UPDATE TMemberCourseHist SET FMemId = 5578810805401765696 WHERE FMemId = 0
|
|
|
|
|
UPDATE TMemberCardAcctHist SET FMemId = 5578810805401765696 WHERE FMemId = 0
|
|
|
|
|
|
|
|
|
|
SELECT * FROM TMember WHERE FMemId = 5578810805401765696
|
|
|
|
|
|
|
|
|
|
select * FROM TMemberSaleBill WHERE FMemId = 5578810805401765696
|
|
|
|
|
SELECT * FROM TConsumeBill WHERE FMemId = 5578810805401765696
|
|
|
|
|
|
|
|
|
|
SELECT * FROM TMemberCardAccount WHERE FMemId = 5578810805401765696
|
|
|
|
|
SELECT * FROM TMemberCardAcctHist WHERE FMemId = 5578810805401765696
|
|
|
|
|
SELECT * FROM TMemberTransHist WHERE FMemId = 5578810805401765696
|
|
|
|
|
|
|
|
|
|
DELETE TMemberCardAcctHist WHERE FCardId = 4724732528808117699
|
|
|
|
|
SELECT * FROM TConsumeBill WHERE FCardId = 4724732528808117699
|
|
|
|
|
|
|
|
|
|
SELECT * FROM TMemberCardAcctHist WHERE FMemId = 5022202462946528304
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SELECT * FROM TMemberSaleBill WHERE FMemNo = '314'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
select dbo.FNNewId()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SELECT * FROM TMember WHERE FMemId = 5578810805401765696
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--<EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʷ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DECLARE @BillId BIGINT
|
|
|
|
|
SELECT @Billid = 4943641433720225154
|
|
|
|
|
|
|
|
|
|
DECLARE @CompId BIGINT
|
|
|
|
|
DECLARE @MemId BIGINT
|
|
|
|
|
DECLARE @CardId BIGINT
|
|
|
|
|
DECLARE @BillMemo VARCHAR(1000)
|
|
|
|
|
DECLARE @BillTime DATETIME
|
|
|
|
|
DECLARE @BillNo VARCHAR(30)
|
|
|
|
|
|
|
|
|
|
SELECT @CompId = FCompId,
|
|
|
|
|
@MemId = FMemId,
|
|
|
|
|
@CardId = FCardId,
|
|
|
|
|
@BillMemo = FBillMemo,
|
|
|
|
|
@BillTime = FBillTime,
|
|
|
|
|
@BillNo = FBillNo
|
|
|
|
|
FROM TConsumeBill
|
|
|
|
|
WHERE FBillId= @Billid
|
|
|
|
|
|
|
|
|
|
SELECT A.FId, A.FItemId ,A.FOrigPrice,FDiscount,FAmount,FDctPrice,A.FSequence, A.FQuantity,
|
|
|
|
|
A.FMemCourseId, A.FMemComboItemId, A.FUseFreeCourse, A.FDeptId,A.FPoint,
|
|
|
|
|
IDENTITY(int) FIndex
|
|
|
|
|
INTO #Item
|
|
|
|
|
FROM TConsumeItem AS A
|
|
|
|
|
WHERE A.FBillId = @Billid
|
|
|
|
|
|
|
|
|
|
--<EFBFBD><EFBFBD>Ʒ<EFBFBD><EFBFBD>
|
|
|
|
|
SELECT A.FId, A.FGoodsId ,A.FOrigPrice,FDiscount,FAmount,FDctPrice,A.FSequence, A.FQuantity, A.FUnitId,FStoreId,
|
|
|
|
|
A.FMemComboGoodsId, A.FDeptId,A.FPoint,
|
|
|
|
|
IDENTITY(int) FIndex
|
|
|
|
|
INTO #Goods
|
|
|
|
|
FROM TConsumeGoods AS A
|
|
|
|
|
WHERE A.FBillId = @Billid
|
|
|
|
|
|
|
|
|
|
--<EFBFBD><EFBFBD>Ŀ֧<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ
|
|
|
|
|
SELECT FDetailId,FPayTypeId,FPayAmt
|
|
|
|
|
INTO #ItemPayment
|
|
|
|
|
FROM TConsumeItemPayment WITH(NOLOCK)
|
|
|
|
|
WHERE FBillId = @Billid
|
|
|
|
|
|
|
|
|
|
--<EFBFBD><EFBFBD>Ʒ֧<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ
|
|
|
|
|
SELECT FDetailId,FPayTypeId,FPayAmt
|
|
|
|
|
INTO #GoodsPayment
|
|
|
|
|
FROM TConsumeGoodsPayment WITH(NOLOCK)
|
|
|
|
|
WHERE FBillId = @Billid
|
|
|
|
|
|
|
|
|
|
EXEC PAuditConsumeMemberTransHist
|
|
|
|
|
@BillId = @Billid, --<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID
|
|
|
|
|
@CompId = @CompId, --<EFBFBD><EFBFBD>˾ID
|
|
|
|
|
@BillNo = @BillNo, --<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
@BillTime =@BillTime, --<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>
|
|
|
|
|
@BillType ='XF', --<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
@MemId = @MemId, --<EFBFBD><EFBFBD>Աid
|
|
|
|
|
@CardId = @CardId, --<EFBFBD><EFBFBD>ID
|
|
|
|
|
@BillMemo = @BillMemo --<EFBFBD><EFBFBD><EFBFBD>ݱ<EFBFBD>ע
|
|
|
|
|
|
|
|
|
|
DROP TABLE #Item
|
|
|
|
|
DROP TABLE #Goods
|
|
|
|
|
DROP TABLE #ItemPayment
|
|
|
|
|
DROP TABLE #GoodsPayment
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SELECT * FROM TBizLog WHERE FUserNo = 'ADMIN' ORDER BY FTime desc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DELETE TBizLog WHERE FId = 25448
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UPDATE TMember SET FMemId = 0 WHERE FMemId = 22
|
|
|
|
|
|
|
|
|
|
SELECT * FROM TMember where FMemId = 5578810805401765696
|
|
|
|
|
SELECT * FROM TMemberCard where FMemId = 5578810805401765696
|
|
|
|
|
SELECT * FROM TMemberCardAccount where FMemId = 5578810805401765696
|
|
|
|
|
SELECT * FROM TMemberSaleBill where FMemId = 5578810805401765696
|
|
|
|
|
|
|
|
|
|
SELECT * FROM TMemberCourseHist WHERE FMemId = 7529966415005117122
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UPDATE TMembreCard SET
|
|
|
|
|
|
|
|
|
|
UPDATE TM
|
|
|
|
|
|
|
|
|
|
SELECT * FROM TMemberCard WHERE FCardNo = '314'
|
|
|
|
|
|
|
|
|
|
SELECT * FROM TMember WHERE FName LIKE '%<EFBFBD><EFBFBD><EFBFBD><EFBFBD>%'
|
|
|
|
|
|
|
|
|
|
SELECT * FROM TMemberCard WHERE FMemId = 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SELECT * FROM TConsumeBill WHERE FBillId = 5022202462946528304
|
|
|
|
|
SELECT * FROM TConsumeBill WHERE FMemId = 0 and fcARDnO != ''
|
|
|
|
|
|
|
|
|
|
UPDATE TConsumeBill SET FMemId = 5022202462946528304 WHERE FMemId = 0 AND FMemNo = '20302'
|
|
|
|
|
|
|
|
|
|
SELECT * FROM TCompany
|