You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
244 lines
8.3 KiB
244 lines
8.3 KiB
SELECT * FROM TImpMember
|
|
|
|
SELECT * FROM TImpMember ORDER BY »áÔ±¿¨ºÅ
|
|
WHERE CUSTNO NOT IN (SELECT CUSTNO FROM TImpMember)
|
|
|
|
|
|
INSERT INTO TMemberCardType(FId,FNo,FName,FValueType,FMaterial,FPrice,FCardFeeAmt,FAcctId,FDeposit,FAcctId2,FDeposit2,
|
|
FAcctId3,FDeposit3,FTimes,FAlertBalance,FPaySmsFee,FTimeCard,FValidityPeriod,FValidityPeriodUnit,FExpiredDate,
|
|
FDefaultMemo,FCreateTime,FAllowSale,FAllowRchg,FEnabled,FOrder,FDeptId)
|
|
SELECT dbo.FNNewId() AS FId,FCardTypeName AS FNo,FCardTypeName AS FName,1 AS ValueType,1 AS FMaterial,0 AS FPrice,0 AS FCardFeeAmt,0 AS FAcctId,0 AS FDeposit,0 AS FAcctId2,0 AS FDeposit2,0 AS FAcctId3,0 AS FDeposit3,0 AS FTimes,0 AS FAlertBalance,0 AS FPaySmsFee,0 AS FTimeCard,0 AS FValidityPeriod,0 AS FValidityPeriodUnit,'' AS FExpiredDate,'' AS FDefaultMemo,'' AS FCreateTime,0 AS FAllowSale,0 AS FAllowRchg,1 AS FEnabled,0 AS FOrder,0 AS FDeptId
|
|
FROM TImpMember
|
|
GROUP BY FCardTypeName
|
|
|
|
|
|
SELECT * FROM TMemberCardType
|
|
|
|
UPDATE TMemberCardType SET FSalePointValue = 0,FRchgPointValue = 0 ,FAllowSale=1,FAllowRchg = 1,FMaterial = 2
|
|
|
|
|
|
|
|
ALTER TABLE TImpMember ADD FMemId BIGINT
|
|
ALTER TABLE TImpMember ADD FCardNo VARCHAR(50)
|
|
ALTER TABLE TImpMember ADD FMemNo VARCHAR(50)
|
|
ALTER TABLE TImpMember ADD FName VARCHAR(50)
|
|
ALTER TABLE TImpMember ADD FGender INT
|
|
ALTER TABLE TImpMember ADD FMobile VARCHAR(50)
|
|
ALTER TABLE TImpMember ADD FCardTypeId BIGINT
|
|
ALTER TABLE TImpMember ADD FCourseId BIGINT
|
|
ALTER TABLE TImpMember ADD FDeposit DECIMAL(18,6)
|
|
ALTER TABLE TImpMember ADD FBalance DECIMAL(18,6)
|
|
ALTER TABLE TImpMember ADD FRemainTimes INT
|
|
ALTER TABLE TImpMember ADD FPurTimes INT
|
|
ALTER TABLE TImpMember ADD FPurAmount DECIMAL(18,6)
|
|
ALTER TABLE TImpMember ADD FItemId BIGINT
|
|
ALTER TABLE TImpMember ADD FCreateDate DATETIME
|
|
ALTER TABLE TImpMember ADD FExpiredDate DATETIME
|
|
ALTER TABLE TImpMember ADD FCompId BIGINT
|
|
ALTER TABLE TImpMember ADD FCardId BIGINT
|
|
ALTER TABLE TImpMember ADD FMemo VARCHAR(1000)
|
|
ALTER TABLE TImpMember ADD FArrear DECIMAL(18,6)
|
|
ALTER TABLE TImpMember ADD FPoint DECIMAL(18,6)
|
|
ALTER TABLE TImpMember ADD FBirthday DATETIME
|
|
ALTER TABLE TImpMember ADD FBirthdayType CHAR
|
|
ALTER TABLE TImpMember ADD FTotalTimes INT
|
|
ALTER TABLE TImpMember ADD FUsedTimes INT
|
|
ALTER TABLE TImpMember ADD FDeleted BIT
|
|
ALTER TABLE TImpMember ADD FState INT
|
|
|
|
DELETE TImpMember WHERE ¿¨ÀàÐÍ= '·Ç»áԱɢ¿Í' OR »áÔ±¿¨ºÅ = 'ºÏ¼Æ£º'
|
|
SELECT * FROM TImpMember WHERE ¿¨ÀàÐÍ= '·Ç»áԱɢ¿Í' OR »áÔ±¿¨ºÅ IS NULL OR »áÔ±¿¨ºÅ = 'ºÏ¼Æ£º'
|
|
|
|
UPDATE TImpMember SET FMemId = dbo.FNNewId() WHERE FMemid IS NULL
|
|
UPDATE TImpMember SET FCardId = dbo.FNNewId() WHERE FCardId IS NULL
|
|
UPDATE TImpMember SET FMemNo = »áÔ±¿¨ºÅ
|
|
UPDATE TImpMember SET FCardNo = »áÔ±¿¨ºÅ
|
|
UPDATE TImpMember SET FMemo = µØÖ· + ' ' + ϲºÃ
|
|
UPDATE TImpMember SET FCreateDate = °ì¿¨ÈÕÆÚ
|
|
UPDATE TImpMember SET FExpiredDate = ÓÐЧÆÚÖÁ
|
|
UPDATE TImpMember SET FExpiredDate =DATEADD(YEAR,1000,°ì¿¨ÈÕÆÚ) WHERE FExpiredDate IS NULL
|
|
UPDATE TImpMember SET FGender = 0
|
|
UPDATE TImpMember SET FMobile = µç»°
|
|
UPDATE TImpMember SET FName = »áÔ±ÐÕÃû
|
|
UPDATE TImpMember SET FMobile = left(µç»°,11) WHERE LEN(µç»°) > 20
|
|
|
|
UPDATE TImpMember SET FBalance = ´¢Öµ¿¨Óà¶î
|
|
UPDATE TImpMember SET FBirthday = »áÔ±ÉúÈÕ
|
|
UPDATE TImpMember SET FMemNo = FName,FCardNO = FName WHERE FMemNo = ''
|
|
|
|
|
|
UPDATE TImpMember SET FCardTypeId = (SELECT FId FROM TMemberCardType WHERE FName = '1000Ôª7ÕÛ¿¨') WHERE ¿¨ÀàÐÍ= '1000'
|
|
UPDATE TImpMember SET FCardTypeId = (SELECT FId FROM TMemberCardType WHERE FName = '500Ôª8ÕÛ¿¨') WHERE ¿¨ÀàÐÍ= '500'
|
|
UPDATE TImpMember SET FCardTypeId = (SELECT FId FROM TMemberCardType WHERE FName = '300Ôª8ÕÛ¼ô·¢¿¨') WHERE ¿¨ÀàÐÍ= '300'
|
|
UPDATE TImpMember SET FCardTypeId = (SELECT FId FROM TMemberCardType WHERE FName = '2000Ôª6ÕÛ¿¨') WHERE ¿¨ÀàÐÍ= '2000'
|
|
UPDATE TImpMember SET FCardTypeId = (SELECT FId FROM TMemberCardType WHERE FName = '3000Ôª5.5ÕÛ') WHERE ¿¨ÀàÐÍ= '3000'
|
|
UPDATE TImpMember SET FCardTypeId = (SELECT FId FROM TMemberCardType WHERE FName = '9800Ôª5ÕÛ¿¨') WHERE ¿¨ÀàÐÍ= '9800'
|
|
UPDATE TImpMember SET FCardTypeId = (SELECT FId FROM TMemberCardType WHERE FName = '7000') WHERE ¿¨ÀàÐÍ= '7000'
|
|
UPDATE TImpMember SET FCardTypeId = (SELECT FId FROM TMemberCardType WHERE FName = '4200') WHERE ¿¨ÀàÐÍ= '4200'
|
|
UPDATE TImpMember SET FCardTypeId = (SELECT FId FROM TMemberCardType WHERE FName = '1300') WHERE ¿¨ÀàÐÍ= '1300'
|
|
UPDATE TImpMember SET FCardTypeId = (SELECT FId FROM TMemberCardType WHERE FName = '800') WHERE ¿¨ÀàÐÍ= '800'
|
|
UPDATE TImpMember SET FCardTypeId = (SELECT FId FROM TMemberCardType WHERE FName = '400') WHERE ¿¨ÀàÐÍ= '400'
|
|
UPDATE TImpMember SET FCardTypeId = (SELECT FId FROM TMemberCardType WHERE FName = '2800') WHERE ¿¨ÀàÐÍ= '2800'
|
|
|
|
SELECT * FROM TImpMember WHERE FCardTypeId IS NULL
|
|
|
|
|
|
|
|
SELECT * FROM TMemberCardType
|
|
|
|
UPDATE T
|
|
|
|
SELECT FMemNo ,SUM(1)
|
|
FROM TImpMember
|
|
GROUP BY FMemNO ORDER BY SUM(1) DESC
|
|
|
|
|
|
UPDATE TImpMember SET FGender = 0
|
|
|
|
UPDATE TImpMember SET FExpiredDate = DATEADD(YEAR,100,FCreateDate)
|
|
|
|
|
|
SELECT * FROM TImpMember
|
|
|
|
|
|
DROP TABLE TImpMember
|
|
|
|
UPDATE TMember SET FMemo = ''
|
|
|
|
INSERT INTO TMember(
|
|
FMemId,
|
|
FMemNo,
|
|
FName,
|
|
FBriefCode,
|
|
FTypeId,
|
|
FCompId,
|
|
FCreateDate,
|
|
FGender,
|
|
FBirthdayType,
|
|
FBirthday,FTelephone,FMobilePhone,FQQ,FWeChat,FIdCard,FEmail,FAddress,FProId,FCPW,FQPW,
|
|
FChargeEmpId,FPoint,FRecvConsSMS,FRecvBulkSMS,FMemo,FCustom1,FCustom2,FCustom3,FCustom4,FCustom5)
|
|
SELECT FMemId AS FMemId,
|
|
FMemNo AS FMemNo,
|
|
ISNULL(ISNULL(FName,FMobile),FMemNo) AS FName,
|
|
dbo.FNGetFirstPinYin(FName),
|
|
0 AS FTypeId,
|
|
1 AS FCompId,
|
|
FCreateDate AS FCreateDate,
|
|
FGender AS FGender,
|
|
'G' AS FBirthdayType,
|
|
FBirthday AS FBirthday,
|
|
'' AS FTelephone,
|
|
ISNULL(FMobile,'') AS FMobilePhone,
|
|
'' AS FQQ,
|
|
'' AS FWeChat,
|
|
'' AS FIdCard,
|
|
'' AS FEmail,
|
|
'' AS FAddress,
|
|
0 AS FProId,
|
|
'' AS FCPW,
|
|
'' AS FQPW,
|
|
0 AS FChargeEmpId,
|
|
ISNULL( FPoint,0) AS FPoint,
|
|
1 AS FRecvConsSMS,
|
|
1 AS FRecvBulkSMS,
|
|
ISNULL(FMemo,'') AS FMemo,
|
|
'' AS FCustom1,'' AS FCustom2,'' AS FCustom3,'' AS FCustom4,'' AS FCustom5
|
|
from TImpMember
|
|
|
|
|
|
SELECT * FROM TImpMember
|
|
WHERE LEN(FMobile) > 20
|
|
|
|
|
|
|
|
INSERT INTO TMemberCard(
|
|
FCardId,
|
|
FCardNo,
|
|
FCardFaceNo,
|
|
FTypeId,
|
|
FValueType,
|
|
FCompId,
|
|
FMemId,
|
|
FState,
|
|
FCreateDate,
|
|
FExpiredDate,
|
|
FTotalTimes,
|
|
FUsedTimes,
|
|
FSaleCompId,
|
|
FSaleBillId,
|
|
FMemo,FDeleted)
|
|
SELECT
|
|
FCardId AS FId,
|
|
FMemNo AS FNo,
|
|
FMemno AS FFaceNo,
|
|
FCardTypeId AS FTypeId,
|
|
(SELECT FValueType FROM TMemberCardType WHERE FId = FCardTypeId) AS FValueType,
|
|
1 AS FCompId,
|
|
FMemId AS FMemId,
|
|
1 AS FState,
|
|
FCreateDate AS FCreateDate,
|
|
FExpiredDate,
|
|
0 AS FTotalTimes,
|
|
0 AS FUsedTimes,
|
|
1 AS FSaleCompId,
|
|
0 AS FSaleBillId,
|
|
FMemo AS FMemo,0
|
|
FROM TImpMember
|
|
|
|
|
|
INSERT TMemberCardAccount(FMemId,FId,FCardId,FAcctId,FDeposit,FBalance,FArrear,FCreateDate,FExpiredDate,FMemo)
|
|
SELECT FMemId,dbo.FNNewId(),FCardId AS FCardId,3,FBalance,FBalance,0,FCreateDate,NULL AS FExpiredDate,''
|
|
FROM TImpMember AS A
|
|
|
|
|
|
WHERE FCardTypeId IS NOT NULL
|
|
|
|
INSERT TMemberCardAcctHist(FId,FMemId,FCardId,FAcctId,FTime,FCardTypeId,FCompId,FBillType,FBizType,FTransId,FTransNo,FInAmount,FOutAmount,FBalance,FArrear,FRecordTime,FMemo)
|
|
select dbo.FNNewId(),A.FMemId,A.FCardId,3,getdate(),A.FCardTypeId,1,'DR','Import',0,'',A.FBalance,0,A.FBalance,0,getdate(),'´ÓÀÏϵͳÖе¼Èë'
|
|
FROM TImpMember AS A
|
|
|
|
|
|
SELECT * FROM TImpTransLog WHERE ¿Í»§±àºÅ = 'A020935'
|
|
|
|
update A
|
|
SET A.FMemId
|
|
|
|
SELECT * FROM TMemberCard WHERE FId = 5494058162892437466
|
|
|
|
|
|
UPDATE A
|
|
SET A.FExpiredDate = B.FExpiredDate
|
|
FROM TMemberCard AS A,TImpMember AS B
|
|
WHERE A.FCardId = B.FCardId
|
|
|
|
|
|
SELECT * FROM TImpMember
|
|
|
|
UPDATE A
|
|
SET A.FMemo = B.Rem
|
|
FROM TMemberCard AS A,TImpMember AS B
|
|
WHERE A.FCardId = B.FCardId
|
|
AND B.Rem IS NOT NULL
|
|
|
|
SELECT * FROM TMemberCardType
|
|
|
|
|
|
UPDATE TMemberCardType SET FId = FNo + 1000 WHERE FId > 0
|
|
|
|
UPDATE TMemberCard SET FTypeId = 0
|
|
|
|
DELETE TMemberCardTypeSUB
|
|
|
|
|
|
UPDATE A
|
|
SET A.FTypeId = B.CType + 1000
|
|
FROM TMemberCard AS A,TImpMember AS B
|
|
WHERE A.FCardId = B.FCardId
|
|
|
|
UPDATE TImpMember SET FCardTypeId = CType + 1000
|
|
|
|
SELECT * FROM TMemberCard WHERE FMemo != ''
|
|
|
|
delete TImpMember where CUSTNO IN(SELECT CUSTNO FROM TImpMember2)
|
|
|
|
|