summaryrefslogtreecommitdiffstats
path: root/intentanalysis/src/main/resources/mybatis/sql/StateMapper.xml
blob: 987c75fa625f0336b654c695c97d1effb278350e (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.server.mapper.StateMapper">

    <select id="selectStateByExpectation" resultType="org.onap.usecaseui.intentanalysis.bean.po.StatePo">
        select state_id stateId, state_name stateName, expectation_id expectationId,
               is_satisfied isSatisfied, condition
        from state
        where expectation_id = #{expectationId}
    </select>

    <insert id="insertState" parameterType="java.util.ArrayList">
        insert into state(state_id, state_name, expectation_id, is_satisfied, condition)
        values
        <foreach collection="list" index="index" item="item" separator=",">
            (#{item.stateId}, #{item.stateName}, #{item.expectationId}, #{item.isSatisfied}, #{item.condition})
        </foreach>
    </insert>

    <delete id="deleteStateByExpectationId">
        delete from state
        where expectation_id = #{expectationId}
    </delete>

</mapper>