aboutsummaryrefslogtreecommitdiffstats
path: root/intentanalysis/src/main/resources
diff options
context:
space:
mode:
authorkaixiliu <liukaixi@chinamobile.com>2023-05-22 16:00:31 +0800
committerkaixiliu <liukaixi@chinamobile.com>2023-05-22 16:00:55 +0800
commite004e125398130e92119ad4a5809cc0d55c0fc65 (patch)
tree525cdd128bff96bce7a746ea8b1954cfd170b08c /intentanalysis/src/main/resources
parentb436bc418da80472426e2aeaddd2eadf0f8de17b (diff)
Add Intent Report Interface
Issue-ID: USECASEUI-812 Signed-off-by: kaixiliu <liukaixi@chinamobile.com> Change-Id: I9b534efa6161b8cbbdc3f8dafcec4e62660d0235
Diffstat (limited to 'intentanalysis/src/main/resources')
-rw-r--r--intentanalysis/src/main/resources/mybatis/sql/ExpectationMapper.xml6
-rw-r--r--intentanalysis/src/main/resources/mybatis/sql/ExpectationObjectMapper.xml11
-rw-r--r--intentanalysis/src/main/resources/mybatis/sql/FulfillmentInfoMapper.xml8
-rw-r--r--intentanalysis/src/main/resources/mybatis/sql/IntentReportFulfillmentInfoMapper.xml11
-rw-r--r--intentanalysis/src/main/resources/mybatis/sql/IntentReportMapper.xml11
-rw-r--r--intentanalysis/src/main/resources/mybatis/sql/ObjectInstanceMapper.xml18
6 files changed, 61 insertions, 4 deletions
diff --git a/intentanalysis/src/main/resources/mybatis/sql/ExpectationMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/ExpectationMapper.xml
index e6a3b26..e97c915 100644
--- a/intentanalysis/src/main/resources/mybatis/sql/ExpectationMapper.xml
+++ b/intentanalysis/src/main/resources/mybatis/sql/ExpectationMapper.xml
@@ -53,4 +53,10 @@
where expectation_id = #{expectationId}
</delete>
+ <select id="getIntentIdByExpectationId" resultType="java.lang.String">
+ select intent_id
+ from expectation
+ where expectation_id = #{expectationId}
+ and expectation_type = #{expectationType}
+ </select>
</mapper>
diff --git a/intentanalysis/src/main/resources/mybatis/sql/ExpectationObjectMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/ExpectationObjectMapper.xml
index 1c8b513..74a0904 100644
--- a/intentanalysis/src/main/resources/mybatis/sql/ExpectationObjectMapper.xml
+++ b/intentanalysis/src/main/resources/mybatis/sql/ExpectationObjectMapper.xml
@@ -38,4 +38,15 @@
delete from expectation_object
where expectation_id = #{expectationId}
</delete>
+
+ <select id="getExpectationIdByObjectInstance" resultType="java.lang.String">
+ select expectation_id
+ from expectation_object
+ where object_instance = #{objectInstance}
+ </select>
+
+ <select id="getAllObjectInstances" resultType="java.lang.String">
+ select object_instance
+ from expectation_object
+ </select>
</mapper>
diff --git a/intentanalysis/src/main/resources/mybatis/sql/FulfillmentInfoMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/FulfillmentInfoMapper.xml
index 5aa65c5..5ae998d 100644
--- a/intentanalysis/src/main/resources/mybatis/sql/FulfillmentInfoMapper.xml
+++ b/intentanalysis/src/main/resources/mybatis/sql/FulfillmentInfoMapper.xml
@@ -6,13 +6,13 @@
<insert id="insertFulfillmentInfo">
- insert into fulfillment_info(fulfillment_info_id, fulfillment_info_status, not_fulfilled_state, not_fulfilled_reason)
- values (#{parentId}, #{fulfillmentInfo.fulfillmentStatus}, #{fulfillmentInfo.notFulfilledState}, #{fulfillmentInfo.notFulfilledReason})
+ insert into fulfillment_info(fulfillment_info_id, fulfillment_info_status, not_fulfilled_state, not_fulfilled_reason,achieve_value)
+ values (#{parentId}, #{fulfillmentInfo.fulfillmentStatus}, #{fulfillmentInfo.notFulfilledState}, #{fulfillmentInfo.notFulfilledReason},#{fulfillmentInfo.achieveValue})
</insert>
<select id="selectFulfillmentInfo" resultType="org.onap.usecaseui.intentanalysis.bean.models.FulfillmentInfo">
- select fulfillment_info_status fulfillmentStatus, not_fulfilled_state notFulfilledState,
- not_fulfilled_reason notFulfilledReason
+ select fulfillment_info_id fulfillmentId, fulfillment_info_status fulfillmentStatus, not_fulfilled_state notFulfilledState,
+ not_fulfilled_reason notFulfilledReason, achieve_value achieveValue
from fulfillment_info
where fulfillment_info_id = #{parentId}
</select>
diff --git a/intentanalysis/src/main/resources/mybatis/sql/IntentReportFulfillmentInfoMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/IntentReportFulfillmentInfoMapper.xml
new file mode 100644
index 0000000..bfe413e
--- /dev/null
+++ b/intentanalysis/src/main/resources/mybatis/sql/IntentReportFulfillmentInfoMapper.xml
@@ -0,0 +1,11 @@
+<?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.IntentReportFulfillmentInfoMapper">
+
+ <insert id="insertIntentReportFulfillment">
+ insert into intent_report_fulfillment_info(parent_id,fulfillment_info_id, fulfillment_info_status, not_fulfilled_state, not_fulfilled_reason,achieve_value)
+ values (#{parentId},#{fulfillmentInfo.fulfillmentId}, #{fulfillmentInfo.fulfillmentStatus}, #{fulfillmentInfo.notFulfilledState}, #{fulfillmentInfo.notFulfilledReason},#{fulfillmentInfo.achieveValue})
+ </insert>
+</mapper>
diff --git a/intentanalysis/src/main/resources/mybatis/sql/IntentReportMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/IntentReportMapper.xml
new file mode 100644
index 0000000..02a571b
--- /dev/null
+++ b/intentanalysis/src/main/resources/mybatis/sql/IntentReportMapper.xml
@@ -0,0 +1,11 @@
+<?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.IntentReportMapper">
+
+ <insert id="insertIntentReport">
+ insert into intent_report(intent_report_id, intent_reference,report_time)
+ values (#{intentReport.intentReportId},#{intentReport.intentReference},to_timestamp(#{intentReport.reportTime},'yyyy-MM-dd HH24:mi:ss'))
+ </insert>
+</mapper>
diff --git a/intentanalysis/src/main/resources/mybatis/sql/ObjectInstanceMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/ObjectInstanceMapper.xml
new file mode 100644
index 0000000..8cf9b3c
--- /dev/null
+++ b/intentanalysis/src/main/resources/mybatis/sql/ObjectInstanceMapper.xml
@@ -0,0 +1,18 @@
+<?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.ObjectInstanceMapper">
+
+ <insert id="insertObjectInstanceList">
+ insert into object_instance(parent_id, object_instance)
+ values
+ <foreach collection="objectInstances" index="index" item="item" separator=",">
+ (#{parentId}, #{item})
+ </foreach>
+ </insert>
+
+ <select id="getObjectInstances" resultType="java.lang.String">
+ select object_instance from object_instance where parent_id = #{parentId}
+ </select>
+</mapper>