<?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="com.vci.ubcs.omd.mapper.BtmTypeMapper">
|
|
|
<resultMap id="BaseResultMap" type="com.vci.ubcs.omd.entity.BtmType">
|
<id column="oid" jdbcType="VARCHAR" property="oid" />
|
<result column="id" jdbcType="VARCHAR" property="id" />
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
<result column="description" jdbcType="VARCHAR" property="description" />
|
<result column="table_name" jdbcType="VARCHAR" property="tableName" />
|
<result column="revision_rule_id" jdbcType="VARCHAR" property="revisionRuleId" />
|
<result column="revision_rule_name" jdbcType="VARCHAR" property="revisionRuleName" />
|
<result column="revision_sep" jdbcType="VARCHAR" property="revisionSep" />
|
<result column="revision_flag" jdbcType="VARCHAR" property="revisionFlag" />
|
<result column="input_revision_flag" jdbcType="VARCHAR" property="inputRevisionFlag" />
|
<result column="secret_flag" jdbcType="VARCHAR" property="secretFlag" />
|
<result column="abstract_flag" jdbcType="VARCHAR" property="abstractFlag" />
|
<result column="impl_class" jdbcType="VARCHAR" property="implClass" />
|
<result column="shape" jdbcType="VARCHAR" property="shape" />
|
<result column="life_cycle_flag" jdbcType="VARCHAR" property="lifeCycleFlag" />
|
<result column="life_cycle_id" jdbcType="VARCHAR" property="lifeCycleId" />
|
<result column="life_cycle_name" jdbcType="VARCHAR" property="lifeCycleName" />
|
<result column="version_rule" jdbcType="VARCHAR" property="versionRule" />
|
<result column="sub_life_cycle_id" jdbcType="VARCHAR" property="subLifeCycleId" />
|
<result column="sub_life_cycle_name" jdbcType="VARCHAR" property="subLifeCycleName" />
|
<result column="view_flag" jdbcType="VARCHAR" property="viewFlag" />
|
<result column="view_create_sql" jdbcType="VARCHAR" property="viewCreateSql" />
|
<result column="btm_name" property="btmName" jdbcType="VARCHAR" />
|
<result column="owner" property="owner" jdbcType="VARCHAR" />
|
<result column="creator" jdbcType="VARCHAR" property="creator" />
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
<result column="last_modifier" jdbcType="VARCHAR" property="lastModifier" />
|
<result column="last_modify_time" jdbcType="TIMESTAMP" property="lastModifyTime" />
|
<result column="ts" jdbcType="TIMESTAMP" property="ts" />
|
<result column="biz_domain" jdbcType="VARCHAR" property="bizDomain" />
|
<result column="consistence" jdbcType="VARCHAR" property="consistence" />
|
</resultMap>
|
|
<sql id="base_query_column">
|
oid, id, name, description, table_name, revision_rule_id, revision_rule_name,revision_flag,
|
revision_sep, input_revision_flag, secret_flag, abstract_flag, impl_class, shape,life_cycle_flag, life_cycle_id,life_cycle_name,
|
version_rule,sub_life_cycle_id,sub_life_cycle_name, view_flag, view_create_sql,btm_name, owner, creator, create_time, last_modifier,
|
last_modify_time, ts,biz_domain,consistence
|
</sql>
|
<sql id="tableName">
|
pl_omd_btm_type
|
</sql>
|
<insert id="batchInsert" useGeneratedKeys="false">
|
insert into <include refid="tableName"/> (
|
<include refid="base_query_column"/>
|
)
|
<foreach collection="records" item="item" separator="union all">
|
(
|
select #{item.oid,jdbcType=VARCHAR},
|
#{item.id,jdbcType=VARCHAR},
|
#{item.name,jdbcType=VARCHAR},
|
#{item.description,jdbcType=VARCHAR},
|
#{item.tableName,jdbcType=VARCHAR},
|
#{item.revisionRuleId,jdbcType=VARCHAR},
|
#{item.revisionRuleName,jdbcType=VARCHAR},
|
#{item.revisionFlag,jdbcType=VARCHAR},
|
#{item.revisionSep,jdbcType=VARCHAR},
|
#{item.inputRevisionFlag,jdbcType=VARCHAR},
|
#{item.secretFlag,jdbcType=VARCHAR},
|
#{item.abstractFlag,jdbcType=VARCHAR},
|
#{item.implClass,jdbcType=VARCHAR},
|
#{item.shape,jdbcType=VARCHAR},
|
#{item.lifeCycleFlag,jdbcType=VARCHAR},
|
#{item.lifeCycleId,jdbcType=VARCHAR},
|
#{item.lifeCycleName,jdbcType=VARCHAR},
|
#{item.versionRule,jdbcType=VARCHAR},
|
#{item.subLifeCycleId,jdbcType=VARCHAR},
|
#{item.subLifeCycleName,jdbcType=VARCHAR},
|
#{item.viewFlag,jdbcType=VARCHAR},
|
#{item.viewCreateSql,jdbcType=VARCHAR},
|
#{item.btmName,jdbcType=VARCHAR },
|
#{item.owner,jdbcType=VARCHAR },
|
#{item.creator,jdbcType=VARCHAR},
|
#{item.createTime,jdbcType=TIMESTAMP},
|
#{item.lastModifier,jdbcType=VARCHAR},
|
#{item.lastModifyTime,jdbcType=TIMESTAMP},
|
#{item.ts,jdbcType=TIMESTAMP},
|
#{item.bizDomain,jdbcType=VARCHAR},
|
#{item.consistence,jdbcType=VARCHAR}
|
from dual
|
)
|
</foreach>
|
</insert>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
delete from <include refid="tableName"/>
|
where OID = #{oid,jdbcType=VARCHAR}
|
</delete>
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
select <include refid="base_query_column"/>
|
from <include refid="tableName" />
|
where OID = #{oid,jdbcType=VARCHAR}
|
</select>
|
|
<select id="selectByPrimaryKeys" resultMap="BaseResultMap">
|
select <include refid="base_query_column" />
|
from <include refid="tableName" />
|
where OID in ( ${oids,jdbcType=VARCHAR})
|
</select>
|
|
<select id="selectByPrimaryKeyCollection" resultMap="BaseResultMap">
|
select <include refid="base_query_column" />
|
from <include refid="tableName" />
|
<where>
|
<foreach collection="oids" item="item" index="arrayindex" open=" OID in ( " close=")" >
|
#{item,jdbcType=VARCHAR}
|
<if test="(arrayindex != oids.size() -1)">
|
,
|
</if>
|
</foreach>
|
</where>
|
</select>
|
|
<select id="selectByIdCollection" resultMap="BaseResultMap">
|
select <include refid="base_query_column" />
|
from <include refid="tableName" />
|
<where>
|
<foreach collection="ids" item="item" index="arrayindex" open=" lower(ID) in ( " close=")" >
|
lower(#{item,jdbcType=VARCHAR})
|
<if test="(arrayindex != ids.size() -1)">
|
,
|
</if>
|
</foreach>
|
</where>
|
</select>
|
|
<select id="selectAll" resultMap="BaseResultMap">
|
select <include refid="base_query_column"/>
|
from <include refid="tableName" />
|
</select>
|
|
<update id="updateByPrimaryKey" parameterType="com.vci.ubcs.omd.entity.BtmType">
|
update <include refid="tableName"/>
|
set id = #{id,jdbcType=VARCHAR},
|
name = #{name,jdbcType=VARCHAR},
|
description = #{description,jdbcType=VARCHAR},
|
table_name = #{tableName,jdbcType=VARCHAR},
|
revision_rule_id = #{revisionRuleId,jdbcType=VARCHAR},
|
revision_flag = #{revisionFlag,jdbcType=VARCHAR},
|
revision_rule_name = #{revisionRuleName,jdbcType=VARCHAR},
|
revision_sep = #{revisionSep,jdbcType=VARCHAR},
|
input_revision_flag = #{inputRevisionFlag,jdbcType=VARCHAR},
|
secret_flag = #{secretFlag,jdbcType=VARCHAR},
|
abstract_flag = #{abstractFlag,jdbcType=VARCHAR},
|
impl_class = #{implClass,jdbcType=VARCHAR},
|
shape = #{shape,jdbcType=VARCHAR},
|
life_cycle_flag = #{lifeCycleFlag,jdbcType=VARCHAR},
|
life_cycle_id = #{lifeCycleId,jdbcType=VARCHAR},
|
life_cycle_name = #{lifeCycleName,jdbcType=VARCHAR},
|
version_rule = #{versionRule,jdbcType=VARCHAR},
|
sub_life_cycle_id = #{subLifeCycleId,jdbcType=VARCHAR},
|
sub_life_cycle_name = #{subLifeCycleName,jdbcType=VARCHAR},
|
view_flag = #{viewFlag,jdbcType=VARCHAR},
|
view_create_sql = #{viewCreateSql,jdbcType=VARCHAR},
|
last_modifier = #{lastModifier,jdbcType=VARCHAR},
|
last_modify_time = #{lastModifyTime,jdbcType=TIMESTAMP},
|
ts = #{ts,jdbcType=TIMESTAMP},
|
biz_domain = #{bizDomain,jdbcType=VARCHAR},
|
consistence = #{consistence,jdbcType=VARCHAR}
|
where OID = #{oid,jdbcType=VARCHAR}
|
</update>
|
|
|
<select id="selectNameByOid" resultType="java.lang.String">
|
select NAME from <include refid="tableName" />
|
where OID = #{oid,jdbcType=VARCHAR}
|
</select>
|
<select id="selectNameById" resultType="java.lang.String">
|
select NAME from <include refid="tableName" />
|
where ID = #{id,jdbcType=VARCHAR}
|
</select>
|
|
|
<select id="selectByAttributeOid" resultMap="BaseResultMap">
|
select <include refid="base_query_column"/>
|
from <include refid="tableName" /> where oid in (
|
select DISTINCT PKBTMTYPE from <include refid="tableName"/>ATTRIBUTE
|
where lower(ATTRIBUTEID) in (select id from vcibt_ATTRIBUTE where oid = #{pkAttribute,jdbcType=VARCHAR} ) )
|
</select>
|
|
|
<select id="selectByRevisionRuleOid" resultMap="BaseResultMap">
|
select <include refid="base_query_column"/>
|
from <include refid="tableName" /> where REVISIONRULEID in
|
(select DISTINCT id from vcibt_REVISIONRULE where oid = #{pkRevisionRule,jdbcType=VARCHAR} )
|
</select>
|
|
|
<select id="selectByLifeCycleOid" resultMap="BaseResultMap">
|
select <include refid="base_query_column"/>
|
from <include refid="tableName" /> where LIFECYCLEID in
|
(select DISTINCT id from vcibt_LIFECYCLE where oid = #{pkLifeCycle,jdbcType=VARCHAR} )
|
</select>
|
|
<delete id="batchDeleteByOids" >
|
delete from <include refid="tableName" />
|
<where>
|
<foreach collection="oids" item="item" index="arrayindex" open=" oid in ( " close=")" >
|
#{item,jdbcType=VARCHAR}
|
<if test="(arrayindex != oids.size() -1)">
|
,
|
</if>
|
</foreach>
|
</where>
|
</delete>
|
|
|
|
|
</mapper>
|