UPDATE wkwke.tbTeachingV3 teaching SET teaching.fdSubjectID = (
SELECT fdValue FROM
(SELECT teaching1.id, subtype.fdValue
FROM wkwke.tbTeachingV3 teaching1
LEFT JOIN wkctn.tbContent content
ON teaching1.fdPrepareID=content.id
LEFT JOIN wkctn.tbInteger subtype
ON subtype.fdContentID = content.id
WHERE subtype.fdAttributeID = 36
) newSubject WHERE newSubject.id = teaching.id
)
update wkwke.tbTeachingV3 teaching left join wkctn.tbContent prepares on prepares.id = teaching.fdPrepareID left join wkctn.tbInteger subject on subject.fdAttributeID = 36 and subject.fdContentID =
prepares.id set teaching.fdSubjectID = subject.fdValue
更新班测记录
UPDATE wkwke.tbScanExam scan LEFT JOIN wkwke.tbExam exam ON exam.id = scan.fdExamID LEFT JOIN wkctn.tbContent content ON content.id = exam.fdContentID LEFT JOIN wkctn.tbInteger subject ON subject.fdAttributeID = 36 AND subject.fdContentID = content.id SET scan.fdSubjectID = subject.fdValue
更新没有属性的学科年级组长
UPDATE `tbPositionUserMap` usermap
LEFT JOIN `tbPositionUserAttributeMap` attribute ON
usermap.id = attribute.fdPositionUserMapID
SET usermap.fdStatus = 1
WHERE usermap.fdPositionID IN ( 4, 5 )
AND usermap.fdStatus =0
AND attribute.id IS NULL
LEFT JOIN `tbPositionUserAttributeMap` attribute ON
usermap.id = attribute.fdPositionUserMapID
SET usermap.fdStatus = 1
WHERE usermap.fdPositionID IN ( 4, 5 )
AND usermap.fdStatus =0
AND attribute.id IS NULL