summaryrefslogtreecommitdiffstats
path: root/intentanalysis/src/main/resources/mybatis/sql/ExpectationMapper.xml
blob: 5c5ac06a99733bcd026005b7e8d9b3f5b6ce3540 (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
28
<?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.server.mapper.ExpectationMapper">


    <select id="selectExpectationByIntentId" resultType="org.onap.usecaseui.intentanalysis.bean.po.ExpectationPo">
        select expectation_id expectationId, expectation_name expectationName,
               target_moi targetMOI, intent_id intentId
        from expectation
        where intent_id = #{intentId}
    </select>

    <insert id="insertExpectation">
        insert into expectation(expectation_id, expectation_name, target_moi, intent_id)
        values
        <foreach collection="list" index="index" item="item" separator=",">
            (#{item.expectationId}, #{item.expectationName}, #{item.targetMOI}, #{item.intentId})
        </foreach>
    </insert>

    <delete id="deleteExpectationByIntentId">
        delete from expectation
        where intent_id = #{intentId}
    </delete>

</mapper>