aboutsummaryrefslogtreecommitdiffstats
path: root/intentanalysis/src/main/resources/mybatis/sql/ContextMapper.xml
diff options
context:
space:
mode:
authorzhuguanyu <zhuguanyu5@huawei.com>2022-08-16 16:14:56 +0800
committerzhuguanyu <zhuguanyu5@huawei.com>2022-08-26 16:34:02 +0800
commita6a29c67cbb22b9b120d08fe5310a45a16d987c6 (patch)
treeab4941a0309a835b111dadd9fc8d2f9056f21f9f /intentanalysis/src/main/resources/mybatis/sql/ContextMapper.xml
parent9643136574c0c06909ebe9af120c022fbb951b6d (diff)
Update intent module and intent API of retrieval
Issue-ID: USECASEUI-710 Signed-off-by: zhuguanyu <zhuguanyu5@huawei.com> Change-Id: I1d6e19db2a4c78f07b907f51fa3c9cf904eff4aa
Diffstat (limited to 'intentanalysis/src/main/resources/mybatis/sql/ContextMapper.xml')
-rw-r--r--intentanalysis/src/main/resources/mybatis/sql/ContextMapper.xml26
1 files changed, 10 insertions, 16 deletions
diff --git a/intentanalysis/src/main/resources/mybatis/sql/ContextMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/ContextMapper.xml
index 56569e4..975bd03 100644
--- a/intentanalysis/src/main/resources/mybatis/sql/ContextMapper.xml
+++ b/intentanalysis/src/main/resources/mybatis/sql/ContextMapper.xml
@@ -6,25 +6,19 @@
<insert id="insertContextList">
- insert into context(context_id, context_name)
- values
- <foreach collection="contextList" index="index" item="item" separator=",">
- (#{item.contextId}, #{item.contextName})
- </foreach>
- </insert>
-
- <insert id="insertContextParentList">
- insert into context_mapping(context_id, parent_type, parent_id)
- values
- <foreach collection="contextList" index="index" item="item" separator=",">
- (#{item.contextId}, #{parentType}, #{parentId})
- </foreach>
+ <if test="contextList != null">
+ insert into context(context_id, context_name, parent_id)
+ values
+ <foreach collection="contextList" index="index" item="item" separator=",">
+ (#{item.contextId}, #{item.contextName}, #{parentId})
+ </foreach>
+ </if>
</insert>
<select id="selectContextByParentId" resultType="org.onap.usecaseui.intentanalysis.bean.models.Context">
- select context_id contextId, context_name contextName
+ select context_id contextId, context_name contextName, context_condition contextCondition
from context
- where intent_id = #{parentId}
+ where parent_id = #{parentId}
</select>
-</mapper>
+</mapper> \ No newline at end of file