diff options
Diffstat (limited to 'intentanalysis/src/main/resources/mybatis/sql/StateMapper.xml')
-rw-r--r-- | intentanalysis/src/main/resources/mybatis/sql/StateMapper.xml | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/intentanalysis/src/main/resources/mybatis/sql/StateMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/StateMapper.xml new file mode 100644 index 0000000..987c75f --- /dev/null +++ b/intentanalysis/src/main/resources/mybatis/sql/StateMapper.xml @@ -0,0 +1,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>
\ No newline at end of file |