aboutsummaryrefslogtreecommitdiffstats
path: root/intentanalysis/src/main/resources/mybatis/sql/FulfilmentInfoMapper.xml
blob: d9b9f7f4793d3aeb6ca6cbcdcebbaf06ff8077f4 (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.FulfilmentInfoMapper">


    <insert id="insertFulfilmentInfo">
        insert into fulfilment_info(fulfilment_info_id, fulfilment_info_status, not_fulfilled_state, not_fulfilled_reason)
        values (#{parentId}, #{fulfilmentInfo.fulfilmentStatus}, #{fulfilmentInfo.notFulfilledState}, #{fulfilmentInfo.notFulfilledReason})
    </insert>

    <select id="selectFulfilmentInfo" resultType="org.onap.usecaseui.intentanalysis.bean.models.FulfilmentInfo">
        select fulfilment_info_status fulfilmentStatus, not_fulfilled_state notFulfilledState,
               not_fulfilled_reason notFulfilledReason
        from fulfilment_info
        where fulfilment_info_id = #{parentId}
    </select>

    <update id="updateFulfilmentInfo">
        update fulfilment_info
        <trim prefix="set" suffixOverrides=",">
            <if test="fulfilmentInfo.fulfilmentStatus != null">fulfilment_info_status = #{fulfilmentInfo.fulfilmentStatus},</if>
            <if test="fulfilmentInfo.notFulfilledState != null">not_fulfilled_state = #{fulfilmentInfo.notFulfilledState},</if>
            <if test="fulfilmentInfo.notFulfilledReason != null">not_fulfilled_reason = #{fulfilmentInfo.notFulfilledReason},</if>
        </trim>
        where fulfilment_info_id = #{parentId}
    </update>

    <delete id="deleteFulfilmentInfo" parameterType="string">
        delete from fulfilment_info
        where fulfilment_info_id = #{parentId}
    </delete>
</mapper>