/* IntentManageMapper.insertIntentMaster */
INSERT INTO TB_INTENT_MASTER (
OPR_MNG_CODE
, INTENT_NAME
, CATEGORY
, REGIST_ID
, REGIST_DATE
, UPDATE_ID
, UPDATE_DATE
, USE_YN
, IF_MAPPING_ID
) VALUES (
#{oprMngCode},
#{intentName},
#{category},
#{registId},
NOW(),
#{registId},
NOW(),
'Y',
#{mappingId}
)
SELECT LAST_INSERT_ID()
/* IntentManageMapper.insertIntent */
INSERT INTO TB_INTENT_EXAMPLE (
INTENT_SEQ
, EXAMPLE_TEXT
, IF_MAPPING_ID
, REGIST_ID
, REGIST_DATE
, UPDATE_ID
, UPDATE_DATE
, USE_YN
) VALUES
(
(SELECT IFNULL(MAX(SEQ), 0) FROM TB_INTENT_MASTER),
#{intentSeq},
#{item.exampleText},
#{mappingId},
#{registId},
NOW(),
#{registId},
NOW(),
'Y'
)
(
(SELECT IFNULL(MAX(SEQ), 0) FROM TB_INTENT_MASTER) A,
#{intentSeq},
#{exampleText},
#{registId},
NOW(),
#{registId},
NOW(),
'Y'
)
SELECT LAST_INSERT_ID()
/* IntentManageMapper.updateIntentMaster */
UPDATE TB_INTENT_MASTER
UPDATE_ID = #{updateId},
UPDATE_DATE = NOW(),
INTENT_NAME = #{intentName},
CATEGORY = #{category},
USE_YN = #{useYn}
AND SEQ = #{seq}
/* IntentManageMapper.deleteIntentMaster */
UPDATE TB_INTENT_MASTER
AND SEQ = #{seq}
/* IntentManageMapper.deleteIntentExample */
DELETE FROM TB_INTENT_EXAMPLE
AND INTENT_SEQ = #{intentSeq}
AND SEQ NOT IN (
#{item.seq}
)
/* IntentManageMapper.deleteIntentExample_one */
DELETE FROM TB_INTENT_EXAMPLE
WHERE SEQ = #{seq}
/* IntentManageMapper.updateDeleteIntentExample */
UPDATE TB_INTENT_EXAMPLE
USE_YN = #{useYn},
AND INTENT_SEQ = #{seq}
AND SEQ NOT IN (
#{item.seq}
)