IFNULL -> NVL

master
mjkhan21 7 months ago
parent 919c10eb0b
commit 2e7050e02d

@ -31,7 +31,7 @@ SELECT A.*
<insert id="insertMenu" parameterType="map">/* 메뉴 등록(menuMapper.insertMenu) */ <insert id="insertMenu" parameterType="map">/* 메뉴 등록(menuMapper.insertMenu) */
<selectKey order="BEFORE" resultType="map" keyColumn="NEW_NO,NEW_ORD" keyProperty="menu.id,menu.sortOrder"> <selectKey order="BEFORE" resultType="map" keyColumn="NEW_NO,NEW_ORD" keyProperty="menu.id,menu.sortOrder">
SELECT NEW_NO, NEW_ORD SELECT NEW_NO, NEW_ORD
FROM (SELECT IFNULL(MAX(MENU_NO) + 1, 0) NEW_NO FROM TB_MENU) A, FROM (SELECT NVL(MAX(MENU_NO) + 1, 0) NEW_NO FROM TB_MENU) A,
(<include refid="newSortOrder" />) B</selectKey> (<include refid="newSortOrder" />) B</selectKey>
INSERT INTO TB_MENU ( INSERT INTO TB_MENU (
MENU_NO MENU_NO
@ -69,7 +69,7 @@ UPDATE TB_MENU SET
, IMG_CNF = #{menu.imageConf} , IMG_CNF = #{menu.imageConf}
WHERE MENU_NO = #{menu.id}</update> WHERE MENU_NO = #{menu.id}</update>
<sql id="newSortOrder">SELECT IFNULL(MAX(SRT_ORD) + 1, 0) NEW_ORD FROM TB_MENU WHERE PRNT_NO = IFNULL(#{parentID}, IFNULL(#{menu.parentID}, 0))</sql> <sql id="newSortOrder">SELECT NVL(MAX(SRT_ORD) + 1, 0) NEW_ORD FROM TB_MENU WHERE PRNT_NO = NVL(#{parentID}, NVL(#{menu.parentID}, 0))</sql>
<update id="moveMenus" parameterType="map">/* 메뉴 이동(menuMapper.moveMenus) */ <update id="moveMenus" parameterType="map">/* 메뉴 이동(menuMapper.moveMenus) */
UPDATE TB_MENU SET UPDATE TB_MENU SET

Loading…
Cancel
Save