INSERT INTO problem ( prblm_id, prblm_expln, prblm_scr, prblm_hint, prblm_cmmt, file_mng_id, prblm_type_id, prblm_ctgry_id, user_id, book_id, unit_id ) VALUES ( #{prblmId}, #{prblmExpln}, #{prblmScr}, #{prblmHint}, #{prblmCmmt}, #{fileMngId}, #{prblmTypeId}, #{prblmCtgryId}, #{userId}, #{bookId}, #{unitId} ) INSERT INTO problem_detail ( prblm_dtl_id, prblm_id, prblm_dtl_expln, prblm_yn, file_mng_id ) VALUES ( #{prblmDtlId}, #{prblmId}, #{prblmDtlExpln}, #{prblmYn}, #{fileMngId} ) UPDATE problem SET prblm_expln = #{prblmExpln}, prblm_scr = #{prblmScr}, prblm_hint = #{prblmHint}, prblm_cmmt = #{prblmCmmt}, file_mng_id = #{fileMngId}, prblm_type_id = #{prblmTypeId}, prblm_ctgry_id = #{prblmCtgryId}, user_id = #{userId}, book_id = #{bookId}, unit_id = #{unitId} WHERE prblm_id = #{prblmId} UPDATE problem_detail SET prblm_dtl_expln = #{prblmDtlExpln}, prblm_yn = #{prblmYn}, file_mng_id = #{fileMngId} WHERE prblm_dtl_id = #{prblmDtlId} DELETE FROM problem WHERE prblm_id = #{prblmId}