aboutsummaryrefslogtreecommitdiffstats
path: root/intentanalysis/src/main/resources/mybatis/sql/ExpectationObjectMapper.xml
diff options
context:
space:
mode:
Diffstat (limited to 'intentanalysis/src/main/resources/mybatis/sql/ExpectationObjectMapper.xml')
-rw-r--r--intentanalysis/src/main/resources/mybatis/sql/ExpectationObjectMapper.xml20
1 files changed, 17 insertions, 3 deletions
diff --git a/intentanalysis/src/main/resources/mybatis/sql/ExpectationObjectMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/ExpectationObjectMapper.xml
index d67b9bf..b158eb2 100644
--- a/intentanalysis/src/main/resources/mybatis/sql/ExpectationObjectMapper.xml
+++ b/intentanalysis/src/main/resources/mybatis/sql/ExpectationObjectMapper.xml
@@ -6,9 +6,23 @@
<insert id="insertExpectationObject">
- insert into expectation_object(expectation_id, object_type, object_instance)
- values
- (#{expectationId}, #{expectationObject.objectType}, #{expectationObject.objectInstance})
+ <if test="expectationObject != null">
+ insert into expectation_object(object_type, object_instance, expectation_id)
+ values
+ (#{expectationObject.objectType}, #{expectationObject.objectInstance}, #{expectationId})
+ </if>
</insert>
+ <select id="selectIntentExpectationObjectByExpectationId" resultType="org.onap.usecaseui.intentanalysis.bean.models.ExpectationObject">
+ select object_type objectType, object_instance objectInstance
+ from expectation_object
+ where expectation_id = #{expectationId}
+ </select>
+
+ <select id="selectExpectationObjectId" resultType="java.lang.String">
+ select object_id
+ from expectation_object
+ where expectation_id = #{expectationId}
+ </select>
+
</mapper>