You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
3.1 KiB
69 lines
3.1 KiB
<?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.flowable.ui.modeler.domain.ModelRelation">
|
|
|
|
<resultMap id="modelRelationResultMap" type="org.flowable.ui.modeler.domain.ModelRelation">
|
|
<id property="id" column="id" jdbcType="VARCHAR" />
|
|
<result property="parentModelId" column="parent_model_id" jdbcType="VARCHAR" />
|
|
<result property="modelId" column="model_id" jdbcType="VARCHAR" />
|
|
<result property="type" column="relation_type" jdbcType="VARCHAR" />
|
|
</resultMap>
|
|
|
|
<resultMap id="modelInformationResultMap" type="org.flowable.ui.modeler.domain.ModelInformation">
|
|
<id property="id" column="id" jdbcType="VARCHAR" />
|
|
<result property="name" column="name" jdbcType="VARCHAR" />
|
|
<result property="type" column="model_type" jdbcType="INTEGER" />
|
|
</resultMap>
|
|
|
|
<insert id="insertModelRelation" parameterType="org.flowable.ui.modeler.domain.ModelRelation">
|
|
insert into ACT_DE_MODEL_RELATION (
|
|
id,
|
|
parent_model_id,
|
|
model_id,
|
|
relation_type)
|
|
values (
|
|
#{id, jdbcType=VARCHAR},
|
|
#{parentModelId, jdbcType=VARCHAR},
|
|
#{modelId, jdbcType=VARCHAR},
|
|
#{type, jdbcType=VARCHAR}
|
|
)
|
|
</insert>
|
|
|
|
<update id="updateModelRelation" parameterType="org.flowable.ui.modeler.domain.ModelRelation">
|
|
update ACT_DE_MODEL_RELATION
|
|
<set>
|
|
parent_model_id = #{parentModelId, jdbcType=VARCHAR},
|
|
model_id = #{modelId, jdbcType=VARCHAR},
|
|
relation_type = #{type, jdbcType=VARCHAR}
|
|
</set>
|
|
where id = #{id, jdbcType=VARCHAR}
|
|
</update>
|
|
|
|
<select id="selectModelRelationByParentModelIdAndType" parameterType="map" resultMap="modelRelationResultMap">
|
|
select * from ACT_DE_MODEL_RELATION
|
|
where parent_model_id = #{parentModelId, jdbcType=VARCHAR} and relation_type = #{type, jdbcType=VARCHAR}
|
|
</select>
|
|
|
|
<select id="selectModelInformationByParentModelId" parameterType="string" resultMap="modelInformationResultMap">
|
|
select m.id as id, m.name as name, m.model_type as model_type
|
|
from ACT_DE_MODEL_RELATION mr inner join ACT_DE_MODEL m on mr.model_id = m.id
|
|
where mr.parent_model_id = #{parentModelId, jdbcType=VARCHAR}
|
|
</select>
|
|
|
|
<select id="selectModelInformationModelId" parameterType="string" resultMap="modelInformationResultMap">
|
|
select m.id as id, m.name as name, m.model_type as model_type
|
|
from ACT_DE_MODEL_RELATION mr inner join ACT_DE_MODEL m on mr.parent_model_id = m.id
|
|
where mr.model_id = #{modelId, jdbcType=VARCHAR}
|
|
</select>
|
|
|
|
<delete id="deleteModelRelation" parameterType="org.flowable.ui.modeler.domain.ModelRelation">
|
|
delete from ACT_DE_MODEL_RELATION where id = #{id, jdbcType=VARCHAR}
|
|
</delete>
|
|
|
|
<delete id="deleteModelRelationByParentModelId" parameterType="string">
|
|
delete from ACT_DE_MODEL_RELATION where parent_model_id = #{parentModelId, jdbcType=VARCHAR}
|
|
</delete>
|
|
|
|
</mapper> |