Commit 5c1272d0 by 叶立庆

在同步表中已完成的人员,且在计划中,才会更新为已完成并且放开锁单

1 parent e395fcfa
...@@ -34,12 +34,14 @@ ...@@ -34,12 +34,14 @@
inner join dj_car_life_learning_center_training_plan tp on tpp.plan_id = tp.id and tp.deleted_flag = 'N' inner join dj_car_life_learning_center_training_plan tp on tpp.plan_id = tp.id and tp.deleted_flag = 'N'
set tpp.is_completed = 1, tpp.open_order_status = 1, tpp.updated_by = 'Job', tpp.updated_date = now() set tpp.is_completed = 1, tpp.open_order_status = 1, tpp.updated_by = 'Job', tpp.updated_date = now()
where tpp.deleted_flag = 'N' and tpp.is_completed = 0 and tp.status = 1 where tpp.deleted_flag = 'N' and tpp.is_completed = 0 and tp.status = 1
and not exists ( and exists (
<!-- and not exists (-->
select 1 from dj_car_life_learning_center_training_plan_course tpc select 1 from dj_car_life_learning_center_training_plan_course tpc
inner join dj_beisen_course bc on tpc.course_id = bc.id and bc.deleted_flag = 'N' and bc.course_status = '40' inner join dj_beisen_course bc on tpc.course_id = bc.id and bc.deleted_flag = 'N' and bc.course_status = '40'
left join dj_beisen_course_staff bcs on tpc.course_id = bcs.course_id and bcs.deleted_flag = 'N' left join dj_beisen_course_staff bcs on tpc.course_id = bcs.course_id and bcs.deleted_flag = 'N'
where tpc.deleted_flag = 'N' and tpc.plan_id = tp.id and tpc.exam_level_id = tpp.exam_level_id and tpc.type = 1 where tpc.deleted_flag = 'N' and tpc.plan_id = tp.id and tpc.exam_level_id = tpp.exam_level_id and tpc.type = 1
and ((bcs.learn_status != '50' and bcs.user_id = tpp.person_id) or (bcs.learn_status is null and bcs.user_id is null)) and bcs.learn_status = '50' and bcs.user_id = tpp.person_id
<!-- and ((bcs.learn_status != '50' and bcs.user_id = tpp.person_id) or (bcs.learn_status is null and bcs.user_id is null))-->
) )
</update> </update>
<update id="autoLockOpenOrder"> <update id="autoLockOpenOrder">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!