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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?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.AttributeMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="baseResultMap" type="com.vci.ubcs.omd.entity.Attribute">
        <id column="oid" property="oid"/>
        <result column="id" property="id"/>
        <result column="name" property="name"/>
        <result column="type_code" property="typeCode"/>
        <result column="type_key" property="typeKey"/>
        <result column="hashtag" property="hashtag" jdbcType="VARCHAR"/>
        <result column="description" property="description" jdbcType="VARCHAR"/>
        <result column="nullable" property="nullable"/>
        <result column="max_length" property="maxLength"/>
        <result column="precision" property="precision"/>
        <result column="refer_type_code" property="referTypeCode"/>
        <result column="refer_type_key" property="referTypeKey"/>
        <result column="refer_to_id" property="referToId" jdbcType="VARCHAR"/>
        <result column="refer_to_name" property="referToName"/>
        <result column="using_dict" property="usingDict"/>
        <result column="dict_code" property="dictCode"/>
        <result column="dict_key" property="dictKey"/>
        <result column="default_value" property="defaultValue"/>
        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
        <result column="creator" property="creator" jdbcType="VARCHAR"/>
        <result column="owner" property="owner" jdbcType="VARCHAR"/>
        <result column="last_modifier" property="lastModifier" jdbcType="VARCHAR"/>
        <result column="last_modify_time" property="lastModifyTime" jdbcType="TIMESTAMP"/>
        <result column="btm_name" property="btmName" jdbcType="TIMESTAMP"/>
        <result column="ts" property="ts" jdbcType="TIMESTAMP"/>
    </resultMap>
 
    <resultMap id="extraResultMap" type="com.vci.ubcs.omd.entity.Attribute">
 
    </resultMap>
 
    <sql id="base_query_column">
        oid, id, name, type_code, type_key, hashtag, description, nullable, max_length, precision,
            refer_type_code, refer_type_key, refer_to_id, refer_to_name, using_dict, dict_code, dict_key,
            default_value, create_time, creator, owner, last_modifier, last_modify_time, btm_name, ts
    </sql>
    <sql id="tableName">
        pl_omd_attribute
    </sql>
    <select id="selectAll" resultMap="baseResultMap">
        select
        <include refid="base_query_column"/>
        from
        <include refid="tableName"/>
    </select>
    <select id="selectApplyRange" resultType="com.vci.ubcs.omd.entity.BtmType">
        select
            btm.name,
            btm.ID
        from pl_omd_btm_type btm
        join pl_omd_btm_type_attribute btmAttr on btmAttr.pk_btm_type = btm.oid
        join <include refid="tableName"/> attr on attr.id = btmAttr.id
        where attr.oid = #{oid}
    </select>
 
</mapper>