aboutsummaryrefslogtreecommitdiffstats
path: root/intentanalysis/src/main/resources/mybatis/sql/ExpectationObjectMapper.xml
blob: 21244c2fe1557d7255ddbaae26387e399147d93b (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
29
30
31
32
33
34
35
36
37
38
39
40
<?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">
        <if test="expectationObject != null">
            insert into expectation_object(object_type, expectation_id)
            values
            (#{expectationObject.objectType}, #{expectationId})
        </if>
    </insert>

    <select id="selectExpectationObject" resultType="org.onap.usecaseui.intentanalysis.bean.models.ExpectationObject">
        select object_type objectType
        from expectation_object
        where expectation_id = #{expectationId}
    </select>

    <select id="selectExpectationObjectId" resultType="java.lang.String">
        select object_id
        from expectation_object
        where expectation_id = #{expectationId}
    </select>

    <update id="updateExpectationObject">
        update expectation_object
        <trim prefix="set" suffixOverrides=",">
            <if test="expectationObject.objectType != null">object_type = #{expectationObject.objectType},</if>
        </trim>
        where expectation_id = #{expectationId}
    </update>

    <delete id="deleteExpectationObject">
        delete from expectation_object
        where expectation_id = #{expectationId}
    </delete>
</mapper>