diff options
Diffstat (limited to 'intentanalysis/src/main/resources/mybatis/sql')
5 files changed, 98 insertions, 21 deletions
diff --git a/intentanalysis/src/main/resources/mybatis/sql/ContextMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/ContextMapper.xml new file mode 100644 index 0000000..450721d --- /dev/null +++ b/intentanalysis/src/main/resources/mybatis/sql/ContextMapper.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="org.onap.usecaseui.intentanalysis.mapper.ContextMapper"> + + + <insert id="insertContextList"> + insert into context(context_id, context_name, context_type, context_condition) + values + <foreach collection="contextList" index="index" item="item" separator=","> + (#{item.contextId}, #{item.contextName}, #{item.contextType}, #{item.contextCondition}) + </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> + </insert> + + <select id="selectContextByParentId" resultType="org.onap.usecaseui.intentanalysis.bean.models.Context"> + select context_id contextId, context_name contextName, context_type contextType, context_condition contextCondition + from context + where intent_id = #{parentId} + </select> + +</mapper> diff --git a/intentanalysis/src/main/resources/mybatis/sql/ExpectationMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/ExpectationMapper.xml index 3b0923f..98aa3dd 100644 --- a/intentanalysis/src/main/resources/mybatis/sql/ExpectationMapper.xml +++ b/intentanalysis/src/main/resources/mybatis/sql/ExpectationMapper.xml @@ -5,27 +5,27 @@ <mapper namespace="org.onap.usecaseui.intentanalysis.mapper.ExpectationMapper"> - <select id="selectExpectationByIntentId" resultType="org.onap.usecaseui.intentanalysis.bean.models.Expectation"> - select expectation_id expectationId, expectation_name expectationName, - target_moi targetMOI, intent_id intentId - from expectation - where intent_id = #{intentId} - </select> - - <insert id="insertExpectationList"> - insert into expectation(expectation_id, expectation_name, target_moi, intent_id) + <insert id="insertIntentExpectations"> + insert into expectation(expectation_id, expectation_name, expectation_type, intent_id) values - <foreach collection="expectationList" index="index" item="item" separator=","> - (#{item.expectationId}, #{item.expectationName}, #{item.targetMOI}, #{intentId}) + <foreach collection="intentExpectations" index="index" item="item" separator=","> + (#{item.expectationId}, #{item.expectationName}, #{item.expectationType}, #{intentId}) </foreach> </insert> - <delete id="deleteExpectationByIntentId"> - delete from expectation + <insert id="insertIntentExpectation"> + insert into expectation(expectation_id, expectation_name, expectation_type, intent_id) + values (#{expectation.expectationId}, #{expectation.expectationName}, #{expectation.expectationType}, #{intentId}) + </insert> + + <select id="selectIntentExpectationsByIntentId" resultType="org.onap.usecaseui.intentanalysis.bean.models.Expectation"> + select expectation_id expectationId, expectation_name expectationName, + target_moi targetMOI, intent_id intentId + from expectation where intent_id = #{intentId} - </delete> + </select> - <update id="updateExpectation"> + <update id="updateIntentExpectation"> update expectation <trim prefix="set" suffixOverrides=","> <if test="expectationName != null">expectation_name = #{expectationName},</if> @@ -34,15 +34,15 @@ where expectation_id = #{expectationId} </update> - <insert id="insertExpectation"> - insert into expectation(expectation_id, expectation_name, target_moi, intent_id) - values (#{expectation.expectationId}, #{expectation.expectationName}, #{expectation.targetMOI}, #{intentId}) - </insert> + <delete id="deleteIntentExpectationsByIntentId"> + delete from expectation + where intent_id = #{intentId} + </delete> - <delete id="deleteExpectationById"> + <delete id="deleteIntentExpectationById"> delete from expectation where expectation_id = #{expectationId} </delete> -</mapper>
\ No newline at end of file +</mapper> diff --git a/intentanalysis/src/main/resources/mybatis/sql/ExpectationObjectMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/ExpectationObjectMapper.xml new file mode 100644 index 0000000..d67b9bf --- /dev/null +++ b/intentanalysis/src/main/resources/mybatis/sql/ExpectationObjectMapper.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="org.onap.usecaseui.intentanalysis.mapper.ExpectationObjectMapper"> + + + <insert id="insertExpectationObject"> + insert into expectation_object(expectation_id, object_type, object_instance) + values + (#{expectationId}, #{expectationObject.objectType}, #{expectationObject.objectInstance}) + </insert> + +</mapper> diff --git a/intentanalysis/src/main/resources/mybatis/sql/ExpectationTargetMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/ExpectationTargetMapper.xml new file mode 100644 index 0000000..0a915bf --- /dev/null +++ b/intentanalysis/src/main/resources/mybatis/sql/ExpectationTargetMapper.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="org.onap.usecaseui.intentanalysis.mapper.ExpectationTargetMapper"> + + + <insert id="insertExpectationTarget"> + insert into expectation_target(target_id, target_name, target_condition, expectation_id) + values + (#{expectationTarget.targetId}, #{expectationTarget.targetName}, #{expectationTarget.targetCondition}, #{expectationId}) + </insert> + +</mapper> diff --git a/intentanalysis/src/main/resources/mybatis/sql/FulfilmentInfoMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/FulfilmentInfoMapper.xml new file mode 100644 index 0000000..e5a9668 --- /dev/null +++ b/intentanalysis/src/main/resources/mybatis/sql/FulfilmentInfoMapper.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="org.onap.usecaseui.intentanalysis.mapper.FulfilmentInfoMapper"> + + + <insert id="insertFulfilmentInfo"> + insert into fulfilment_info(fulfilment_info_id, fulfilment_info_status, not_fulfilled_state, not_fulfilled_reason) + values (#{parentId}, #{fulfilmentInfo.fulfilmentStatus}, #{fulfilmentInfo.notFulfilledState}, #{fulfilmentInfo.notFulfilledReason}) + </insert> + + <select id="selectFulfilmentInfoById" resultType="org.onap.usecaseui.intentanalysis.bean.models.FulfilmentInfo"> + select fulfilment_info_status fulfilmentStatus, not_fulfilled_state notFulfilledState, + not_fulfilled_reason notFulfilledReason from fulfilment_info + where parent_id = #{parentId} + </select> + +</mapper> |