aboutsummaryrefslogtreecommitdiffstats
path: root/intentanalysis/src/main/resources/mybatis/sql/IntentReportMapper.xml
blob: 901055ef712cf102d18ca5a9fd0f952a4f9a61dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?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>

    <select id="getIntentReportIds" resultType="java.lang.String">
        select intent_report_id
        from intent_report
        where intent_reference = #{intentReference}
    </select>

    <select id="getIntentReportsByTime" resultType="org.onap.usecaseui.intentanalysis.bean.models.IntentReport">
        select intent_report_id intentReportId,
               intent_reference intentReference,
               to_char(report_time,'yyyy-mm-dd HH24:mi:ss') reportTime
        from intent_report
        where report_time &gt;= to_timestamp(#{startTime},'yyyy-MM-dd HH24:mi:ss')
          and report_time &lt; to_timestamp(#{endTime},'yyyy-MM-dd HH24:mi:ss')
          and intent_reference = #{intentInstanceId}
    </select>
</mapper>