aboutsummaryrefslogtreecommitdiffstats
path: root/intentanalysis/src/main/resources/mybatis/sql/ContextMapper.xml
blob: 975bd03b202fc236984611978801920e1e2e3564 (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
<?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.ContextMapper">


    <insert id="insertContextList">
        <if test="contextList != null">
            insert into context(context_id, context_name, parent_id)
            values
            <foreach collection="contextList" index="index" item="item" separator=",">
                (#{item.contextId}, #{item.contextName}, #{parentId})
            </foreach>
        </if>
    </insert>

    <select id="selectContextByParentId" resultType="org.onap.usecaseui.intentanalysis.bean.models.Context">
        select context_id contextId, context_name contextName, context_condition contextCondition
        from context
        where parent_id = #{parentId}
    </select>

</mapper>