diff options
Diffstat (limited to 'intentanalysis/src/main/resources/mybatis/sql/ContextMapper.xml')
-rw-r--r-- | intentanalysis/src/main/resources/mybatis/sql/ContextMapper.xml | 26 |
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 |