1.备份模板表:
create table t_repttempback1 as select * from t_repttemp
2.查询US模态的所有模板
select r.* from t_bodypart b join t_repttempcategory c on c.bodypartid = b.bodypartid join t_repttemp r on c.categoryid = r.categoryid where b.modality='US'
3.作废US模态的所有模板
update t_repttemp p set p.deleted = '1' where p.repttempid in (select r.repttempid from t_bodypart b join t_repttempcategory c on c.bodypartid = b.bodypartid join t_repttemp r on c.categoryid = r.categoryid where b.modality = 'US')
4.清空US模态的所有模板的所见
update t_repttemp p set p.studyresult='' ,p.bstudyresult = null, p.cstudyresult = '' where p.repttempid in (select r.repttempid from t_bodypart b join t_repttempcategory c on c.bodypartid = b.bodypartid join t_repttemp r on c.categoryid = r.categoryid where b.modality = 'US')
5.清空US模态的所有模板的诊断
update t_repttemp p set p.diagresult='' ,p.bdiagresult = null, p.cdiagresult = '' where p.repttempid in (select r.repttempid from t_bodypart b join t_repttempcategory c on c.bodypartid = b.bodypartid join t_repttemp r on c.categoryid = r.categoryid where b.modality = 'US')
6.清空US模态的所有模板的所见和诊断
update t_repttemp p set p.diagresult = '', p.bdiagresult = null, p.cdiagresult = '', p.studyresult = '', p.bstudyresult = null, p.cstudyresult = '' where p.repttempid in (select r.repttempid from t_bodypart b join t_repttempcategory c on c.bodypartid = b.bodypartid join t_repttemp r on c.categoryid = r.categoryid where b.modality = 'US')