aboutsummaryrefslogtreecommitdiffstats
path: root/intentanalysis/src/main/resources/mybatis/sql/StateMapper.xml
diff options
context:
space:
mode:
Diffstat (limited to 'intentanalysis/src/main/resources/mybatis/sql/StateMapper.xml')
-rw-r--r--intentanalysis/src/main/resources/mybatis/sql/StateMapper.xml23
1 files changed, 22 insertions, 1 deletions
diff --git a/intentanalysis/src/main/resources/mybatis/sql/StateMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/StateMapper.xml
index 4850870..9e30981 100644
--- a/intentanalysis/src/main/resources/mybatis/sql/StateMapper.xml
+++ b/intentanalysis/src/main/resources/mybatis/sql/StateMapper.xml
@@ -11,7 +11,7 @@
where expectation_id = #{expectationId}
</select>
- <insert id="insertState" parameterType="java.util.ArrayList">
+ <insert id="insertStateList" parameterType="java.util.ArrayList">
insert into state(state_id, state_name, expectation_id, is_satisfied, condition)
values
<foreach collection="stateList" index="index" item="item" separator=",">
@@ -24,4 +24,25 @@
where expectation_id = #{expectationId}
</delete>
+ <insert id="insertState">
+ insert into state(state_id, state_name, expectation_id, is_satisfied, condition)
+ values (#{state.stateId}, #{state.stateName}, #{expectationId}, #{state.isSatisfied}, #{state.condition})
+ </insert>
+
+ <update id="updateState" parameterType="java.util.List">
+ update state
+ <trim prefix="set" suffixOverrides=",">
+ <if test="stateName != null">state_name = #{stateName},</if>
+ <if test="isSatisfied != null">is_satisfied = #{isSatisfied},</if>
+ <if test="condition != null">condition = #{condition},</if>
+ </trim>
+ where state_id = #{stateId}
+ </update>
+
+ <delete id="deleteStateById">
+ delete
+ from state
+ where state_id = #{stateId}
+ </delete>
+
</mapper> \ No newline at end of file