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,
prblm_mtr1,
prblm_mtr2,
prblm_mtr3,
prblm_mtr4,
prblm_mtr5,
prblm_mtr6
) VALUES (
#{prblmId},
#{prblmExpln},
#{prblmScr},
#{prblmHint},
#{prblmCmmt},
#{fileMngId},
#{prblmTypeId},
#{prblmCtgryId},
#{userId},
#{bookId},
#{unitId},
#{prblmMtr1},
#{prblmMtr2},
#{prblmMtr3},
#{prblmMtr4},
#{prblmMtr5},
#{prblmMtr6}
)
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},
prblm_mtr1 = #{prblmMtr1},
prblm_mtr2 = #{prblmMtr2},
prblm_mtr3 = #{prblmMtr3},
prblm_mtr4 = #{prblmMtr4},
prblm_mtr5 = #{prblmMtr5},
prblm_mtr6 = #{prblmMtr6}
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}