diff options
author | hekeguang <hekeguang@chinamobile.com> | 2022-08-22 21:16:25 +0800 |
---|---|---|
committer | hekeguang <hekeguang@chinamobile.com> | 2022-08-22 21:16:44 +0800 |
commit | 6433005256513ec2943ee2ea52f2844711e4d62f (patch) | |
tree | 779e80ca6f3e812a6d1c4fecb7ce577f6ab9fe88 /intentanalysis/src/main/resources/mybatis/sql/ConditionMapper.xml | |
parent | 235aa1c823235f98ee9564e717e77ca068c2b1f1 (diff) |
Add database code.
Issue-ID: USECASEUI-696
Change-Id: I1c8ce807ca1f2aaeebc8646d8a14df9f4b27a436
Signed-off-by: hekeguang <hekeguang@chinamobile.com>
Diffstat (limited to 'intentanalysis/src/main/resources/mybatis/sql/ConditionMapper.xml')
-rw-r--r-- | intentanalysis/src/main/resources/mybatis/sql/ConditionMapper.xml | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/intentanalysis/src/main/resources/mybatis/sql/ConditionMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/ConditionMapper.xml new file mode 100644 index 0000000..d77c06a --- /dev/null +++ b/intentanalysis/src/main/resources/mybatis/sql/ConditionMapper.xml @@ -0,0 +1,30 @@ +<?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.ConditionMapper"> + + <insert id="insertConditionList"> + insert into condition(condition_id, condition_name, operator_type, condition_value) + values + <foreach collection="contextList" index="index" item="item" separator=","> + (#{item.conditionId}, #{item.conditionName}, #{item.operatorType}, #{item.conditionValue}) + </foreach> + </insert> + + <insert id="insertConditionParentList"> + insert into condition_mapping(condition_id, parent_type, parent_id) + values + <foreach collection="conditionList" index="index" item="item" separator=","> + (#{item.conditionId}, #{parentType}, #{parentId}) + </foreach> + </insert> + +<!-- 这里的查询有问题--> + <select id="selectConditionByParentId" resultType="org.onap.usecaseui.intentanalysis.bean.models.Context"> + select condition_id conditionId, condition_name conditiontName, operator_type operatorType + from condition + where condition_id = #{parentId} + </select> + +</mapper>
\ No newline at end of file |