田源
2023-05-09 549ecbf13b14a4deb74e42828abcd46ccb68a7c0
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?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.code.mapper.CodeClstemplateMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="plCodeClstemplateResultMap" type="com.vci.ubcs.code.entity.CodeClstemplateEntity">
        <result column="OID" property="oid"/>
        <result column="REVISIONOID" property="revisionOid"/>
        <result column="NAMEOID" property="nameOid"/>
        <result column="BTMNAME" property="btmname"/>
        <result column="LASTR" property="lastR"/>
        <result column="FIRSTR" property="firstR"/>
        <result column="LASTV" property="lastV"/>
        <result column="FIRSTV" property="firstV"/>
        <result column="CREATOR" property="creator"/>
        <result column="CREATETIME" property="createTime"/>
        <result column="LASTMODIFIER" property="lastModifier"/>
        <result column="LASTMODIFYTIME" property="lastModifyTime"/>
        <result column="REVISIONRULE" property="revisionRule"/>
        <result column="VERSIONRULE" property="versionRule"/>
        <result column="REVISIONSEQ" property="revisionSeq"/>
        <result column="REVISIONVALUE" property="revisionValue"/>
        <result column="VERSIONSEQ" property="versionSeq"/>
        <result column="VERSIONVALUE" property="versionValue"/>
        <result column="LCTID" property="lctid"/>
        <result column="LCSTATUS" property="lcStatus"/>
        <result column="TS" property="ts"/>
        <result column="ID" property="id"/>
        <result column="NAME" property="name"/>
        <result column="DESCRIPTION" property="description"/>
        <result column="OWNER" property="owner"/>
        <result column="COPYFROMVERSION" property="copyFromVersion"/>
        <result column="CODECLASSIFYOID" property="codeClassifyOid"/>
        <result column="BTMTYPEID" property="btmTypeId"/>
        <result column="BTMTYPENAME" property="btmTypeName"/>
    </resultMap>
 
 
    <select id="selectPlCodeClstemplatePage" resultMap="plCodeClstemplateResultMap">
        select * from PL_CODE_CLSTEMPLATE where is_deleted = 0 order by revisionSeq
    </select>
 
    <select id="selectAllLevelChildOid" resultType="java.lang.String" >
        select oid from PL_CODE_CLSTEMPLATE START WITH codeClassifyOid = #{oid} CONNECT BY PRIOR codeClassifyOid= OID
    </select>
 
    <select id="countAllLevelChildOid" resultType="java.lang.Integer" >
        select count(OID) countsize from PL_CODE_CLSTEMPLATE START WITH codeClassifyOid = #{oid} CONNECT BY PRIOR codeClassifyOid = OID
    </select>
    <select id="getNextRevision" resultType="map" >
        select max(revisionSeq) + 1 revisionSeq,
               max(revisionSeq) + 1 revisionVal,
               max(VersionSeq) + 1 VersionSeq,
               max(VersionSeq) + 1 VersionVal
        from PL_CODE_CLSTEMPLATE
        where nameoid = #{nameoid}
    </select>
 
    <select id="selectCodeClassifyTemplateDOByTree" resultMap="plCodeClstemplateResultMap">
        SELECT codeclstemplate0.CODECLASSIFYOID AS codeclassifyoid,
               codeclstemplate0.LASTMODIFIER    AS lastmodifier,
               codeclstemplate0.REVISIONSEQ     AS revisionseq,
               codeclstemplate0.VERSIONVALUE    AS versionvalue,
               codeclstemplate0.DESCRIPTION     AS description,
               codeclstemplate0.OID             AS oid,
               codeclstemplate0.VERSIONSEQ      AS versionseq,
               --codeclstemplate0.CHECKINBY       AS checkinby,
               codeclstemplate0.BTMTYPENAME     AS btmtypename,
               codeclstemplate0.REVISIONRULE    AS revisionrule,
               codeclstemplate0.ID              AS id,
               codeclstemplate0.OWNER           AS owner,
               --codeclstemplate0.CHECKOUTBY      AS checkoutby,
               codeclstemplate0.BTMTYPEID       AS btmtypeid,
               codeclstemplate0.CREATOR         AS creator,
               codeclstemplate0.CREATETIME      AS createtime,
               codeclstemplate0.FIRSTV        AS isfirstv,
               codeclstemplate0.REVISIONOID     AS revisionoid,
               codeclstemplate0.BTMNAME         AS btmname,
               --codeclstemplate0.CHECKOUTTIME    AS checkouttime,
               codeclstemplate0.REVISIONVALUE   AS revisionvalue,
               codeclstemplate0.VERSIONRULE     AS versionrule,
               codeclstemplate0.NAME            AS name,
               codeclstemplate0.LASTR         AS islastr,
               codeclstemplate0.LASTMODIFYTIME  AS lastmodifytime,
               codeclstemplate0.COPYFROMVERSION AS copyfromversion,
               codeclstemplate0.NAMEOID         AS nameoid,
               codeclstemplate0.LCSTATUS        AS lcstatus,
               codeclstemplate0.LASTV         AS islastv,
               --codeclstemplate0.CHECKINTIME     AS checkintime,
               codeclstemplate0.FIRSTR        AS isfirstr,
               codeclstemplate0.TS              AS ts,
               codeclassifyoid.name             AS codeClassifyOidName
        FROM PL_CODE_CLSTEMPLATE codeclstemplate0
                 LEFT JOIN PL_CODE_CLASSIFY codeclassifyoid
                           ON codeclstemplate0.codeClassifyOid = codeclassifyoid.oid
        WHERE codeclstemplate0.codeclassifyoid = #{codeclassifyoid}
          and codeclstemplate0.lcstatus = #{lcstatus}
          AND (codeclstemplate0.lastr = '1' AND codeclstemplate0.lastv = '1')
    </select>
 
 
 
    <select id="selectChildHasReleaseTemplate" resultType="list">
        select t.oid as oid, cls.oid as clsoid
        from platformbtm_codeclstemplate t
                 left join (select oid
                            from platformbtm_codeclassify
                            where lcstatus = #{lcstatus}
                                start with oid = #{classifyoid}
                            connect by prior oid = parentcodeclassifyoid) cls
                           on t.codeclassifyoid = cls.oid
        where t.lcstatus = #{templatelcstatus}
          and cls.oid is not null
    </select>
 
</mapper>