select id, task_id, type, status, log, completed_date, cost_time, create_by, create_time, update_by, update_time from t_extract_knowledge_sub_task
insert into t_extract_knowledge_sub_task
task_id,type,status,log,completed_date,cost_time,create_by,create_time,#{taskId},#{type},#{status},#{log},#{completedDate},#{costTime},#{createBy},#{createTime},
update t_extract_knowledge_sub_task
task_id = #{taskId},type = #{type},status = #{status},log = #{log},completed_date = #{completedDate},cost_time = #{costTime},update_by = #{updateBy},update_time = #{updateTime},
where id = #{id}
delete from t_extract_knowledge_sub_task where id = #{id}
delete from t_extract_knowledge_sub_task where id in
#{id}
update t_extract_knowledge_sub_task SET status = #{status}, log = #{msg}
, completed_date = #{completedDate}, cost_time = TIMESTAMPDIFF(SECOND, create_time, #{completedDate})
WHERE id = #{subTaskId}
UPDATE t_extract_knowledge_task ekt
SET STATUS = '1'
WHERE
1=1
AND
ekt.id = (SELECT task_id FROM t_extract_knowledge_sub_task ekst WHERE ekst.id = #{subTaskId})
AND
(SELECT count(*) FROM t_extract_knowledge_sub_task ekst WHERE ekst.id = #{subTaskId})
=
(SELECT count(*) FROM t_extract_knowledge_sub_task ekst WHERE ekst.id = #{subTaskId} AND ekst.`status` = '1');
UPDATE t_extract_knowledge_task ekt
SET STATUS = '2'
WHERE
1=1
AND
ekt.id = (SELECT task_id FROM t_extract_knowledge_sub_task ekst WHERE ekst.id = #{subTaskId})
AND
(SELECT count(*) FROM t_extract_knowledge_sub_task ekst WHERE ekst.id = #{subTaskId})
=
(SELECT count(*) FROM t_extract_knowledge_sub_task ekst WHERE ekst.id = #{subTaskId} AND ekst.`status` in ('2','5'));
UPDATE t_extract_knowledge_task ekt
SET STATUS = '3'
WHERE
1=1
AND
ekt.id = (SELECT task_id FROM t_extract_knowledge_sub_task ekst WHERE ekst.id = #{subTaskId})
AND
(SELECT count(*) FROM t_extract_knowledge_sub_task ekst WHERE ekst.id = #{subTaskId})
=
(SELECT count(*) FROM t_extract_knowledge_sub_task ekst WHERE ekst.id = #{subTaskId} AND ekst.`status` in ('3','5'))