a.id AS "id", a.tests_id AS "tests.id", a.question_title AS "questionTitle", a.question_points AS "questionPoints", a.question_option AS "questionOption", a.results AS "results", a.types AS "types", a.question_id AS "questionId" LEFT JOIN edu_user_tests b ON b.id = a.tests_id INSERT INTO edu_user_tests_detail( id, tests_id, question_title, question_points, question_option, results, types, question_id ) VALUES ( #{id}, #{tests.id}, #{questionTitle}, #{questionPoints}, #{questionOption}, #{results}, #{types}, #{questionId} ) UPDATE edu_user_tests_detail SET tests_id = #{tests.id}, question_title = #{questionTitle}, question_points = #{questionPoints}, question_option = #{questionOption}, results = #{results}, types=#{types}, question_id=#{questionId} WHERE id = #{id} DELETE FROM edu_user_tests_detail WHERE id = #{id} WHERE tests_id = #{tests.id} UPDATE edu_user_tests_detail SET del_flag = #{DEL_FLAG_DELETE} WHERE id = #{id} WHERE tests_id = #{tests.id}