diff options
author | zhangfan345 <zhangfan345@huawei.com> | 2022-08-30 10:47:22 +0800 |
---|---|---|
committer | guanyu zhu <zhuguanyu5@huawei.com> | 2022-08-30 12:20:27 +0000 |
commit | 6331fc23cbe8321150fbcf0f176a1106e3982aa0 (patch) | |
tree | 94d8e38425d30e120f91596e82eb28d766490e9e /intentanalysis/src/main/resources/mybatis/sql/ExpectationTargetMapper.xml | |
parent | a6a29c67cbb22b9b120d08fe5310a45a16d987c6 (diff) |
Update intent module and CRUD APIs
Issue-ID: USECASEUI-710
Signed-off-by: zhangfan345 <zhangfan345@huawei.com>
Change-Id: I3e53e952b3554235e324b87adef2a997bae82d2a
Signed-off-by: zhangfan345 <zhangfan345@huawei.com>
Diffstat (limited to 'intentanalysis/src/main/resources/mybatis/sql/ExpectationTargetMapper.xml')
-rw-r--r-- | intentanalysis/src/main/resources/mybatis/sql/ExpectationTargetMapper.xml | 46 |
1 files changed, 38 insertions, 8 deletions
diff --git a/intentanalysis/src/main/resources/mybatis/sql/ExpectationTargetMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/ExpectationTargetMapper.xml index 1910912..31625c8 100644 --- a/intentanalysis/src/main/resources/mybatis/sql/ExpectationTargetMapper.xml +++ b/intentanalysis/src/main/resources/mybatis/sql/ExpectationTargetMapper.xml @@ -6,17 +6,47 @@ <insert id="insertExpectationTarget"> - <if test="expectationTarget != null"> - insert into expectation_target(target_id, target_name, target_condition, expectation_id) - values - (#{expectationTarget.targetId}, #{expectationTarget.targetName}, #{expectationTarget.targetCondition}, #{expectationId}) - </if> + insert into expectation_target(target_id, target_name, expectation_id) + values + (#{expectationTarget.targetId}, #{expectationTarget.targetName}, #{expectationId}) </insert> - <select id="selectIntentExpectationTargetListByExpectationId" resultType="org.onap.usecaseui.intentanalysis.bean.models.ExpectationTarget"> - select target_id targetId, target_name targetName, target_condition targetCondition + <insert id="insertExpectationTargetList"> + insert into expectation_target(target_id, target_name, expectation_id) + values + <foreach collection="expectationTargetList" index="index" item="item" separator=","> + (#{item.targetId}, #{item.targetName}, #{expectationId}) + </foreach> + </insert> + + <select id="selectExpectationTargetList" resultType="org.onap.usecaseui.intentanalysis.bean.models.ExpectationTarget"> + select target_id targetId, target_name targetName from expectation_target where expectation_id = #{expectationId} </select> -</mapper>
\ No newline at end of file + <select id="selectExpectationTarget" resultType="org.onap.usecaseui.intentanalysis.bean.models.ExpectationTarget"> + select target_id targetId, target_name targetName + from expectation_target + where target_id = #{expectationTargetId} + </select> + + <update id="updateExpectationTarget"> + update expectation_target + <trim prefix="set" suffixOverrides=","> + <if test="expectationTarget.targetName != null">target_name = #{expectationTarget.targetName},</if> + </trim> + where target_id = #{expectationTargetId} + </update> + + <delete id="deleteExpectationTarget"> + delete from expectation_target + where target_id = #{expectationTargetId} + </delete> + + <delete id="deleteExpectationTargetList"> + delete from expectation_target + where expectation_id= #{expectationId} + </delete> + +</mapper> |