aboutsummaryrefslogtreecommitdiffstats
path: root/intentanalysis/src/main/resources
diff options
context:
space:
mode:
Diffstat (limited to 'intentanalysis/src/main/resources')
-rw-r--r--intentanalysis/src/main/resources/intent-analysis-init.sql5
-rw-r--r--intentanalysis/src/main/resources/mybatis/sql/IntentInstanceMapper.xml25
-rw-r--r--intentanalysis/src/main/resources/mybatis/sql/IntentReportMapper.xml6
3 files changed, 36 insertions, 0 deletions
diff --git a/intentanalysis/src/main/resources/intent-analysis-init.sql b/intentanalysis/src/main/resources/intent-analysis-init.sql
index 61ea45b..00bf2cf 100644
--- a/intentanalysis/src/main/resources/intent-analysis-init.sql
+++ b/intentanalysis/src/main/resources/intent-analysis-init.sql
@@ -101,3 +101,8 @@ create table if not exists object_instance(
parent_id varchar(255),
object_instance varchar(255)
);
+
+create table if not exists intent_instance(
+ intent_instance_id varchar(255) primary key,
+ intent_id varchar(255)
+ );
diff --git a/intentanalysis/src/main/resources/mybatis/sql/IntentInstanceMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/IntentInstanceMapper.xml
new file mode 100644
index 0000000..3534e78
--- /dev/null
+++ b/intentanalysis/src/main/resources/mybatis/sql/IntentInstanceMapper.xml
@@ -0,0 +1,25 @@
+<?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.IntentInstanceMapper">
+ <insert id="insertIntentInstance">
+ insert into intent_instance(intent_instance_id,intent_id)
+ values (#{intentInstance.intentInstanceId},#{intentInstance.intentId});
+ </insert>
+
+ <select id="selectIntentInstanceByIntentId" resultType="java.lang.String">
+ select intent_instance_id from intent_instance
+ where intent_id = #{intentId}
+ </select>
+
+ <delete id="deleteIntentInstances">
+ delete from intent_instance where intent_id = #{intentId}
+ </delete>
+
+ <select id="selectIntentInstance"
+ resultType="org.onap.usecaseui.intentanalysis.bean.models.IntentInstance">
+ select intent_instance_id intentInstanceId,intent_id intentId from intent_instance
+ where intent_instance_id = #{intentInstanceId}
+ </select>
+</mapper>
diff --git a/intentanalysis/src/main/resources/mybatis/sql/IntentReportMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/IntentReportMapper.xml
index 02a571b..078ea9b 100644
--- a/intentanalysis/src/main/resources/mybatis/sql/IntentReportMapper.xml
+++ b/intentanalysis/src/main/resources/mybatis/sql/IntentReportMapper.xml
@@ -8,4 +8,10 @@
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>
+
+ <select id="getIntentReportIds" resultType="java.lang.String">
+ select intent_report_id
+ from intent_report
+ where intent_reference = #{intentReference}
+ </select>
</mapper>