/*添加表字段*/
ALTER TABLE `hplus_standard_1_1hjzyy`.`br_patient`
ADD COLUMN `cardType` VARCHAR(6) NULL AFTER `patientID` ,
ADD COLUMN `name` VARCHAR(50) NULL AFTER `cardType` ,
ADD COLUMN `administrativeGender` VARCHAR(16) NULL AFTER `name` ,
ADD COLUMN `cardNo` VARCHAR(50) NULL AFTER `administrativeGender` ,
ADD COLUMN `pinyinOfName` VARCHAR(32) NULL AFTER `cardNo` ,
ADD COLUMN `firstPinYinOfName` VARCHAR(32) NULL AFTER `pinyinOfName` ,
ADD COLUMN `societyGuaranteeNo` VARCHAR(50) NULL AFTER `firstPinYinOfName` ,
ADD COLUMN `hospitalizeCard` VARCHAR(30) NULL AFTER `societyGuaranteeNo` ,
ADD COLUMN `birthday` VARCHAR(50) NULL AFTER `hospitalizeCard`;
/*更新就诊卡的冗余数据*/
update be_person p,be_card c
set p.hospitalizeCard=c.cardCode
where p.person_ID=c.person_ID;
/*数据的更新person冗余数据*/
update br_patient t,be_person p
set t.cardType=p.cardType,
t.name=p.cardType,
t.administrativeGender=p.administrativeGender,
t.cardNo=p.cardNo,
t.pinyinOfName=p.pinyinOfName,
t.firstPinYinOfName=p.firstPinYinOfName,
t.societyGuaranteeNo=p.societyGuaranteeNo,
t.hospitalizeCard=p.hospitalizeCard,
t.birthday=p.birthday
where t.person_ID=p.person_ID;