summaryrefslogtreecommitdiffstats
path: root/intentanalysis/src/main/resources/mybatis/sql/FulfillmentInfoMapper.xml
blob: 5ae998d5ca5f9d53355685d826f907fdb236eddc (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
28
29
30
31
32
33
34
<?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.FulfillmentInfoMapper">


    <insert id="insertFulfillmentInfo">
        insert into fulfillment_info(fulfillment_info_id, fulfillment_info_status, not_fulfilled_state, not_fulfilled_reason,achieve_value)
        values (#{parentId}, #{fulfillmentInfo.fulfillmentStatus}, #{fulfillmentInfo.notFulfilledState}, #{fulfillmentInfo.notFulfilledReason},#{fulfillmentInfo.achieveValue})
    </insert>

    <select id="selectFulfillmentInfo" resultType="org.onap.usecaseui.intentanalysis.bean.models.FulfillmentInfo">
        select fulfillment_info_id fulfillmentId, fulfillment_info_status fulfillmentStatus, not_fulfilled_state notFulfilledState,
               not_fulfilled_reason notFulfilledReason, achieve_value achieveValue
        from fulfillment_info
        where fulfillment_info_id = #{parentId}
    </select>

    <update id="updateFulfillmentInfo">
        update fulfillment_info
        <trim prefix="set" suffixOverrides=",">
            <if test="fulfillmentInfo.fulfillmentStatus != null">fulfillment_info_status = #{fulfillmentInfo.fulfillmentStatus},</if>
            <if test="fulfillmentInfo.notFulfilledState != null">not_fulfilled_state = #{fulfillmentInfo.notFulfilledState},</if>
            <if test="fulfillmentInfo.notFulfilledReason != null">not_fulfilled_reason = #{fulfillmentInfo.notFulfilledReason},</if>
        </trim>
        where fulfillment_info_id = #{parentId}
    </update>

    <delete id="deleteFulfillmentInfo" parameterType="string">
        delete from fulfillment_info
        where fulfillment_info_id = #{parentId}
    </delete>
</mapper>