<insert id="insertRequestItem" parameterType="requestItemModel"> <selectKey keyProperty="itemId" resultType="String" order="BEFORE"> select max(0 + item_id) + 1 from DUING.M_REQUEST_ITEM where kind_id = #{kindId} </selectKey> INSERT INTO M_REQUEST_ITEM ( item_id, create_datetime, update_datetime ) VALUES ( #{itemId}, now(), now() ) </insert>