summaryrefslogtreecommitdiffstats
path: root/intentanalysis/src/main/resources/mybatis/sql/IntentMapper.xml
blob: 643c19363b536b9a52527220725e73ca1dacb897 (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
35
36
37
38
39
40
41
42
<?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.IntentMapper">

    <select id="selectIntentById" resultType="org.onap.usecaseui.intentanalysis.bean.models.Intent">
        select intent_id intentId, intent_name intentName
        from intent
        where intent_id = #{intentId}
    </select>

    <select id="selectIntentList" resultType="org.onap.usecaseui.intentanalysis.bean.models.Intent">
        select intent_id intentId, intent_name intentName
        from intent
    </select>

    <insert id="insertIntent" >
        insert into Intent(intent_id, intent_name)
        values(#{intent.intentId}, #{intent.intentName})
    </insert>

    <update id="updateIntent" parameterType="org.onap.usecaseui.intentanalysis.bean.models.Intent">
        update intent
        <trim prefix="set" suffixOverrides=",">
            <if test="intentName != null">intent_name = #{intentName},</if>
        </trim>
        where intent_id = #{intentId}
    </update>

    <delete id="deleteIntentById" parameterType="string">
        delete
        from intent
        where intent_id = #{intentId}
    </delete>

    <select id="getIntentByName" resultType="org.onap.usecaseui.intentanalysis.bean.models.Intent">
        select intent_id intentId, intent_name intentName from intent
        where intent_name like  "%"#{intentName}"%"
    </select>

</mapper>