SELECT
sr.id as registrationId,
sr.name as name,
sr.idcard as idcard,
sr.times as times,
sr.specialty as specialty,
if(poo.id=226, CONCAT(poo.`NAME`,'/',po.`NAME`), CONCAT(pooo.`NAME`,'/',poo.`NAME`,'/',po.`NAME`)) as specialtyName
FROM
sz_registration sr
LEFT JOIN pm_organization po ON po.ID = sr.specialty
LEFT JOIN pm_organization poo ON poo.ID = po.PARENT_ID
LEFT JOIN pm_organization pooo ON pooo.ID = poo.PARENT_ID
update sz_registration
set is_active = 1
where idcard = #{loginName}
update sz_registration
times = #{param.times},
exam_id = #{param.examId}
where idcard = #{param.idcard} and del_flag = 0
update sz_registration
set is_active = 0
where idcard = #{idcard} and del_flag = 0
INSERT INTO sz_enroll(name, idcard, photo, temperature, date_now,ifexam_people)
VALUES (#{name}, #{idcard}, #{picture},#{temperature}, #{dateNow},#{ifexamPeople})
insert into exam_profess(exam_id, profess_id, difficult_id)
values(#{examId}, #{specialty}, 1)
insert into
sz_registration (
name
,idcard
,times
,specialty
)
values (
#{name}
,#{idcard}
,#{times}
,#{specialty}
)
insert into sz_missingtest(exam_id, idcard)
values(#{examId}, #{idcard})
update
sz_enroll
photo = #{picture},
template = #{temperature},
date_now =#{dateNow},
name = #{name}
where
idcard = #{idcard} and is_active='1'
update
sz_enroll
photo = #{picture},
temperature = #{temperature},
date_now = #{dateNow},
name = #{name}
where
idcard = #{idcard} and is_active='1'
update
sz_registration
set
exam_id = #{examId}
where
del_flag = 0
AND
idcard = #{idcard}
update
sz_registration
name = #{name},
idcard = #{idcard},
times = #{times},
specialty = #{specialty},
where
id = #{registrationId}
update sz_registration
set del_flag = 1
where id = #{registrationId}