|
|
|
|
SELECT * INTO hyxx FROM hyxx
|
|
|
|
|
SELECT * FROM xfxx
|
|
|
|
|
|
|
|
|
|
SELECT * FROM hyxx WHERE klxmc = '<EFBFBD><EFBFBD>ͨ<EFBFBD>˿<EFBFBD>'
|
|
|
|
|
|
|
|
|
|
SELECT klxmc FROM hyxx GROUP BY klxmc
|
|
|
|
|
|
|
|
|
|
SELECT * FROM TCompany WHERE FId = 4734511574699135191
|
|
|
|
|
SELECT * FROM hyxx
|
|
|
|
|
|
|
|
|
|
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID
|
|
|
|
|
ALTER TABLE hyxx ADD FMemId BIGINT
|
|
|
|
|
UPDATE hyxx SET FMemId = '2000' + cast(id as varchar(20))
|
|
|
|
|
|
|
|
|
|
--<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
UPDATE hyxx
|
|
|
|
|
SET hykh = hykh
|
|
|
|
|
|
|
|
|
|
UPDATE hyxx
|
|
|
|
|
SET hykh = REPLACE(REPLACE(REPLACE(REPLACE( REPLACE( REPLACE(Replace(hykh,'<EFBFBD><EFBFBD>',''),'<EFBFBD><EFBFBD>',''),'?',''),';',''),' ',''),'<EFBFBD><EFBFBD>',''),'A','')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SELECT hykh,sum(1)
|
|
|
|
|
FROM hyxx
|
|
|
|
|
group by hykh
|
|
|
|
|
order by sum(1) desc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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,
|
|
|
|
|
hykh AS FNo,
|
|
|
|
|
hyxm AS FName,
|
|
|
|
|
isnull(xmjm,'') AS FBriefCode,
|
|
|
|
|
0 AS FTypeId,
|
|
|
|
|
1 AS FCompId,
|
|
|
|
|
jrrq AS FCreateDate,
|
|
|
|
|
case xb when '<EFBFBD><EFBFBD>' then 1 else 0 end AS FGender,
|
|
|
|
|
'G' AS FBirthdayType,
|
|
|
|
|
csrq AS FBirthday,
|
|
|
|
|
'' AS FTelephone,
|
|
|
|
|
isnull( replace(dbo.FNToDbc(yddh) ,' ',''),'') as FMobilePhone,
|
|
|
|
|
'' AS FQQ,
|
|
|
|
|
'' AS FWeChat,
|
|
|
|
|
'' AS FIdCard,
|
|
|
|
|
'' AS FEmail,
|
|
|
|
|
'' AS FAddress,
|
|
|
|
|
0 AS FProId,
|
|
|
|
|
'' AS FCPW,
|
|
|
|
|
'' AS FQPW,
|
|
|
|
|
0 AS FChargeEmpId,
|
|
|
|
|
0 AS FPoint,
|
|
|
|
|
1 AS FRecvConsSMS,
|
|
|
|
|
1 AS FRecvBulkSMS,
|
|
|
|
|
'' AS FMemo,
|
|
|
|
|
'' AS FCustom1,'' AS FCustom2,'' AS FCustom3,'' AS FCustom4,'' AS FCustom5
|
|
|
|
|
from hyxx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SELECT * FROM hyczk
|
|
|
|
|
|
|
|
|
|
select * from hyxx WHERE klxmc = '<EFBFBD>ƴο<EFBFBD>'
|
|
|
|
|
alter table hyxx ADD Times int default 0 not null
|
|
|
|
|
|
|
|
|
|
UPDATE hyxx SET Times = knje,knje = knje * 10 where klxmc = '<EFBFBD>ƴο<EFBFBD>'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
INSERT INTO TMemberCard(
|
|
|
|
|
FId,
|
|
|
|
|
FNo,
|
|
|
|
|
FFaceNo,
|
|
|
|
|
FTypeId,
|
|
|
|
|
FValueType,
|
|
|
|
|
FCompId,
|
|
|
|
|
FMemId,
|
|
|
|
|
FState,
|
|
|
|
|
FCreateDate,
|
|
|
|
|
FExpiredDate,
|
|
|
|
|
FTotalTimes,
|
|
|
|
|
FUsedTimes,
|
|
|
|
|
FSaleCompId,
|
|
|
|
|
FSaleBillId,
|
|
|
|
|
FMemo)
|
|
|
|
|
SELECT
|
|
|
|
|
id AS FId,
|
|
|
|
|
hykh AS FNo,
|
|
|
|
|
hykh AS FFaceNo,
|
|
|
|
|
(SELECT FId FROM TMemberCardType WHERE FName = klxmc) AS FTypeId,
|
|
|
|
|
(SELECT FValueType FROM TMemberCardType WHERE FName = klxmc) AS FValueType,
|
|
|
|
|
1 AS FCompId,
|
|
|
|
|
id AS FMemId,
|
|
|
|
|
1 AS FState,
|
|
|
|
|
jrrq AS FCreateDate,
|
|
|
|
|
dateadd(yy,100,jrrq) AS FExpiredDate,
|
|
|
|
|
Times AS FTotalTimes,
|
|
|
|
|
0 AS FUsedTimes,
|
|
|
|
|
0 AS FSaleCompId,
|
|
|
|
|
0 AS FSaleBillId,
|
|
|
|
|
ISNULL(qtxx,'') AS FMemo
|
|
|
|
|
FROM hyxx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
INSERT TMemberCardAccount(FId,FCardId,FAcctId,FDeposit,FBalance,FArrear,FCreateDate,FExpiredDate,FMemo)
|
|
|
|
|
SELECT dbo.FNNewId(),id AS FCardId,3,knje,knje,0,jrrq,NULL,''
|
|
|
|
|
FROM hyxx
|
|
|
|
|
|
|
|
|
|
INSERT TMemberCardAcctHist(FId,FMemId,FCardId,FAcctId,FTime,FCardTypeId,FCompId,FBillType,FBizType,FTransId,FTransNo,FInAmount,FOutAmount,FBalance,FArrear,FRecordTime,FMemo)
|
|
|
|
|
select dbo.FNNewId(),C.FMemId,A.FCardId,A.FAcctId,getdate(),C.FTypeId,C.FCompId,'DR','Import',0,'',A.FBalance,0,A.FBalance,0,getdate(),''
|
|
|
|
|
from TMemberCardAccount AS A,TMemberCard AS C,hyxx AS D
|
|
|
|
|
where C.FId = A.FCardId
|
|
|
|
|
AND C.FId = D.id
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
INSERT TMemberOldTransHist(FId,FMemId,FTime,FCardId,FCompId,FBillType,FBizType,FTransNo,FContent,FPrice,FQuantity,FAmount,FPayment,FEmployee,FMemo)
|
|
|
|
|
SELECT dbo.FNNewId(),A.FId,xfrq,A.FId,A.FCompId,'DR','Import','','',cast(dzhje as decimal(18,6)),1,cast(dzhje as decimal(18,6)),'','',''
|
|
|
|
|
FROM xfxx,TMemberCard AS A
|
|
|
|
|
WHERE A.FNo = hykh
|
|
|
|
|
|
|
|
|
|
select * from xfxx2
|
|
|
|
|
update xfxx2 set hykh = 'A' + hykh
|
|
|
|
|
|
|
|
|
|
Truncate table TMemberOldTransHist
|
|
|
|
|
|
|
|
|
|
select * from xfxx
|
|
|
|
|
|
|
|
|
|
SELECT * FROM TMemberOld
|
|
|
|
|
|
|
|
|
|
select dateadd(yy,100,getdate())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UPDATE TMemberCard SET FExpiredDate = dateadd(yy,100,FCreateDate)
|
|
|
|
|
|
|
|
|
|
insert gcm12
|
|
|
|
|
(gcn00c,gcn01c,gcn02c,gcn09f,gcn10i,gcn12d,gcn13d,gcn15c,gcn17c,gcn22i,gcn24i,gcn04c,gcn06i,gcn03c,gcn16f)
|
|
|
|
|
select
|
|
|
|
|
'003',hykh,'0',knje,'0',jrrq,'22000101',hykh,'003','1','1',yddh,xb,hyxm,hyjf
|
|
|
|
|
from gcm12_01
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UPDATE TMemberCard SET FCompId = (SELECT FId FROM TCompany WHERE FNo= '003')
|
|
|
|
|
UPDATE TMember SET FCompId = (SELECT FId FROM TCompany WHERE FNo= '003')
|
|
|
|
|
UPDATE TMemberCardAcctHist SET FCompId = (SELECT FId FROM TCompany WHERE FNo= '003')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SELECT * FROM TMemberSaleDetailPayment
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SELECT FId,FNo INTO #Member FROM TMember WHERE FNo LIKE 'A%'
|
|
|
|
|
AND FCompId = 4734511574699135191
|
|
|
|
|
|
|
|
|
|
SELECT * FROM #Member
|
|
|
|
|
|
|
|
|
|
UPDATE #Member SET FNo = REPLACE(REPLACE(REPLACE(REPLACE( REPLACE( REPLACE(Replace(FNo,'<EFBFBD><EFBFBD>',''),'<EFBFBD><EFBFBD>',''),'?',''),';',''),' ',''),'<EFBFBD><EFBFBD>',''),'','')
|
|
|
|
|
|
|
|
|
|
UPDATE #Member SET FNo = REPLACE(FNo,'A','') WHERE FNo LIKE 'A%'
|
|
|
|
|
|
|
|
|
|
UPDATE #Member SET FNo = 'A' + FNo
|
|
|
|
|
WHERE FNo IN (SELECT FNo FROM TMember WHERE FCompId != 4734511574699135191)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SELECT * FROM #Member WHERE FNo like 'A%'
|
|
|
|
|
|
|
|
|
|
UPDATE B
|
|
|
|
|
SET B.FNo = 'A' + B.FNo
|
|
|
|
|
FROM #Member AS B,
|
|
|
|
|
(
|
|
|
|
|
SELECT FNo, COUNT(1) as cnt,max(FId) as FId FROM #Member
|
|
|
|
|
GROUP BY FNo
|
|
|
|
|
) AS A
|
|
|
|
|
WHERE cnt > 1
|
|
|
|
|
AND B.FId = A.FId
|
|
|
|
|
|
|
|
|
|
UPDATE A
|
|
|
|
|
SET A.FNo = B.FNo
|
|
|
|
|
FROM TMember AS A,#Member AS B
|
|
|
|
|
WHERE A.FId = B.FId
|
|
|
|
|
|
|
|
|
|
SELECT * FROM TMember WHERE FNo like 'A%'
|
|
|
|
|
|
|
|
|
|
UPDATE A
|
|
|
|
|
SET A.FNo = B.FNo,
|
|
|
|
|
A.FFaceNo = B.FNo
|
|
|
|
|
FROM TMemberCard AS A,TMember AS B
|
|
|
|
|
WHERE A.FId = B.FId
|
|
|
|
|
AND B.FCompId = 4734511574699135191
|
|
|
|
|
|
|
|
|
|
SELECT * FROM TMemberCard WHERE FNo like '%801127%'
|