多单位版国产化地质资料管理系统
zhai
2025-12-18 3c6f6c1e3016e38146a4c46be6e7b625c35591f2
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<?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.ruili.wcp.dao.config.FlowCategoryRelationMapper">
    <!-- 带流程分类、流程名称返回结果 -->
    <resultMap id="WithFlowResultMap" type="com.ruili.wcp.data.vo.config.FlowCategoryFlowDefinitionVO">
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="flow_category_id" property="flowCategoryId"/>
        <result column="flow_category_name" property="flowCategoryName"/>
        <result column="flow_id" property="flowId"/>
        <result column="flow_name" property="flowName"/>
        <result column="flow_state" property="flowState"/>
    </resultMap>
 
    <resultMap id="FlowRelationMap" type="com.ruili.wcp.data.entity.config.FlowCategoryRelation">
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="flow_category_id" property="flowCategoryId"/>
        <result column="flow_id" property="flowId"/>
    </resultMap>
 
    <resultMap id="flowDefinition" type="com.ruili.wcp.data.vo.management.FlowDefinitionVO">
        <id column="flow_id" jdbcType="BIGINT" property="flowId"/>
        <result column="flow_name" property="flowName"/>
        <result column="module_id" property="moduleId"/>
        <result column="form_id" property="formId"/>
        <result column="flow_state" property="flowState"/>
        <result column="flow_type" property="flowType"/>
        <result column="enable_permission" property="enablePermission"/>
        <result column="permission_name" property="permissionName"/>
    </resultMap>
    <sql id="Base_Column_List">
        id, flow_category_id, flow_id
    </sql>
 
 
    <!-- 查询关联流程信息字段 -->
    <sql id="WithFlow_Column_List">
        a.id,b.flow_category_id,b.flow_category_name,c.flow_id,c.flow_name
    </sql>
 
    <!-- 查询带流程SQL -->
    <select id="selectWithFlow" parameterType="map" resultMap="WithFlowResultMap">
        select
        a.id,a.sort_num,b.flow_category_id,b.flow_category_name,c.flow_id,c.flow_name,c.flow_state
        from cnf_flow_category_relation a,cnf_flow_category b,cnf_flow_definition c
        WHERE a.flow_category_id=b.flow_category_id and a.flow_id=c.flow_id and b.flow_category_id=#{flowCategoryId}
 
        <if test="keyWord!=null">
            AND c.flow_name like concat('%',#{keyWord},'%')
        </if>
        order by a.sort_num asc
        limit #{currIndex} , #{pageSize}
    </select>
 
    <!-- 查询带流程SQL -->
    <select id="selectWithFlow" parameterType="map" resultMap="WithFlowResultMap" databaseId="oracle">
        select * from (
        select rownum as rn,
        a.id,a.sort_num,b.flow_category_id,b.flow_category_name,c.flow_id,c.flow_name,c.flow_state
        from cnf_flow_category_relation a,cnf_flow_category b,cnf_flow_definition c
        WHERE a.flow_category_id=b.flow_category_id and a.flow_id=c.flow_id and b.flow_category_id=#{flowCategoryId}
 
        <if test="keyWord!=null">
            AND c.flow_name like '%' || '${keyWord}' || '%'
        </if>
        order by a.sort_num asc
        ) tt where rn between ${currIndex} and (${currIndex} + ${pageSize})
    </select>
 
    <!-- 查询带流程SQL -->
    <select id="selectWithFlow" parameterType="map" resultMap="WithFlowResultMap" databaseId="kingbasees">
        select * from (
        select rownum as rn,
        a.id,a.sort_num,b.flow_category_id,b.flow_category_name,c.flow_id,c.flow_name,c.flow_state
        from cnf_flow_category_relation a,cnf_flow_category b,cnf_flow_definition c
        WHERE a.flow_category_id=b.flow_category_id and a.flow_id=c.flow_id and b.flow_category_id=#{flowCategoryId}
 
        <if test="keyWord!=null">
            AND c.flow_name like '%' || '${keyWord}' || '%'
        </if>
        order by a.sort_num asc
        ) tt where rn between ${currIndex} and (${currIndex} + ${pageSize})
    </select>
 
    <!-- 查询带流程SQL -->
    <select id="selectWithFlow" parameterType="map" resultMap="WithFlowResultMap" databaseId="sqlServer">
        select * from (
        select ROW_NUMBER() OVER(
        order by a.sort_num asc
        ) AS rn,
        a.id,,a.sort_num,b.flow_category_id,b.flow_category_name,c.flow_id,c.flow_name,c.flow_state
        from cnf_flow_category_relation a,cnf_flow_category b,cnf_flow_definition c
        WHERE a.flow_category_id=b.flow_category_id and a.flow_id=c.flow_id and b.flow_category_id=#{flowCategoryId}
 
        <if test="keyWord!=null">
            AND c.flow_name like '%' || '${keyWord}' || '%'
        </if>
        ) tt where rn between ${currIndex} and (${currIndex} + ${pageSize})
    </select>
 
    <!-- 查询带流程总数量SQL -->
    <select id="selectCountWithFlow" parameterType="map" resultType="Integer">
        select
        count(1)
        from cnf_flow_category_relation a,cnf_flow_category b,cnf_flow_definition c
        WHERE a.flow_category_id=b.flow_category_id and a.flow_id=c.flow_id and b.flow_category_id=#{flowCategoryId}
        <if test="keyWord!=null">
            AND c.flow_name like concat('%',#{keyWord},'%')
        </if>
    </select>
 
    <!-- 查询带流程总数量SQL -->
    <select id="selectCountWithFlow" parameterType="map" resultType="Integer" databaseId="oracle">
        select
        count(1)
        from cnf_flow_category_relation a,cnf_flow_category b,cnf_flow_definition c
        WHERE a.flow_category_id=b.flow_category_id and a.flow_id=c.flow_id and b.flow_category_id=#{flowCategoryId}
        <if test="keyWord!=null">
            AND c.flow_name like '%' || #{keyWord} || '%'
        </if>
    </select>
 
    <!-- 查询带流程总数量SQL -->
    <select id="selectCountWithFlow" parameterType="map" resultType="Integer" databaseId="kingbasees">
        select
        count(1)
        from cnf_flow_category_relation a,cnf_flow_category b,cnf_flow_definition c
        WHERE a.flow_category_id=b.flow_category_id and a.flow_id=c.flow_id and b.flow_category_id=#{flowCategoryId}
        <if test="keyWord!=null">
            AND c.flow_name like '%' || #{keyWord} || '%'
        </if>
    </select>
 
    <!-- 查询带流程SQL -->
    <select id="selectFlowRelaion" resultMap="FlowRelationMap">
        select id,
               flow_category_id,
               flow_id
        from cnf_flow_category_relation
    </select>
 
    <!-- 根据分类id查询流程 -->
    <select id="getFlowDefinitionByCategoryId" parameterType="Long" resultMap="flowDefinition">
        select c.flow_id,
               c.flow_name,
               c.flow_state,
               c.module_id,
               c.form_id,
               c.flow_type,
               c.enable_permission,
               c.permission_name,
               c.flow_icon,
               c.flow_css
        from cnf_flow_category_relation a,
             cnf_flow_category b,
             cnf_flow_definition c
        WHERE a.flow_category_id = b.flow_category_id
          and a.flow_id = c.flow_id
          and b.flow_category_id = #{flowCategoryId}
          and c.flow_state = 1
        order by a.sort_num asc
 
    </select>
</mapper>