ny
昨天 b6f169fe43a2b13f351aefc152374fc7f0bc8cb7
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
<?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="jnpf.permission.mapper.AuthorizeMapper">
 
    <resultMap id="ModuleVO" type="jnpf.base.model.module.ModuleModel">
        <id column="f_id" property="id"/>
        <result column="f_parent_id" property="parentId"/>
        <result column="f_full_name" property="fullName"/>
        <result column="f_en_code" property="enCode"/>
        <result column="f_type" property="type"/>
        <result column="f_url_address" property="urlAddress"/>
        <result column="f_page_address" property="pageAddress"/>
        <result column="f_link_target" property="linkTarget"/>
        <result column="f_category" property="category"/>
        <result column="f_icon" property="icon"/>
        <result column="f_sort_code" property="sortCode"/>
        <result column="f_property_json" property="propertyJson"/>
        <result column="f_module_id" property="moduleId"/>
        <result column="f_system_id" property="systemId"/>
        <result column="f_description" property="description"/>
        <result column="f_creator_time" property="creatorTimes"/>
    </resultMap>
 
    <resultMap id="ButtonVO" type="jnpf.base.model.button.ButtonModel">
        <id column="f_id" property="id"/>
        <result column="f_parent_id" property="parentId"/>
        <result column="f_full_name" property="fullName"/>
        <result column="f_en_code" property="enCode"/>
        <result column="f_icon" property="icon"/>
        <result column="f_url_address" property="urlAddress"/>
        <result column="f_module_id" property="moduleId"/>
        <result column="f_creator_time" property="creatorTimes"/>
        <result column="f_sort_code" property="sortCode"/>
    </resultMap>
 
    <resultMap id="ColumnVO" type="jnpf.base.model.column.ColumnModel">
        <id column="f_id" property="id"/>
        <result column="f_parent_id" property="parentId"/>
        <result column="f_full_name" property="fullName"/>
        <result column="f_en_code" property="enCode"/>
        <result column="f_bind_table" property="bindTable"/>
        <result column="f_bind_table_name" property="bindTableName"/>
        <result column="f_module_id" property="moduleId"/>
        <result column="f_creator_time" property="creatorTimes"/>
        <result column="f_sort_code" property="sortCode"/>
    </resultMap>
 
    <resultMap id="ResourceVO" type="jnpf.base.model.resource.ResourceModel">
        <id column="f_id" property="id"/>
        <result column="f_full_name" property="fullName"/>
        <result column="f_en_code" property="enCode"/>
        <result column="f_condition_json" property="conditionJson"/>
        <result column="f_condition_text" property="conditionText"/>
        <result column="f_module_id" property="moduleId"/>
        <result column="f_match_logic" property="matchLogic"/>
        <result column="f_object_id" property="objectId"/>
        <result column="f_creator_time" property="creatorTimes"/>
        <result column="f_sort_code" property="sortCode"/>
    </resultMap>
 
    <resultMap id="FormVO" type="jnpf.base.model.form.ModuleFormModel">
        <id column="f_id" property="id"/>
        <result column="f_parent_id" property="parentId"/>
        <result column="f_full_name" property="fullName"/>
        <result column="f_en_code" property="enCode"/>
        <result column="f_module_id" property="moduleId"/>
        <result column="f_creator_time" property="creatorTimes"/>
        <result column="f_sort_code" property="sortCode"/>
    </resultMap>
 
    <resultMap id="SystemVO" type="jnpf.base.model.base.SystemBaeModel">
        <id column="f_id" property="id"/>
        <result column="f_full_name" property="fullName"/>
        <result column="f_en_code" property="enCode"/>
        <result column="f_icon" property="icon"/>
        <result column="f_property_json" property="propertyJson"/>
        <result column="f_description" property="description"/>
        <result column="f_sort_code" property="sortCode"/>
        <result column="f_enabled_mark" property="enabledMark"/>
        <result column="f_workflow_enabled" property="workflowEnabled"/>
        <result column="f_navigation_icon" property="navigationIcon"/>
        <result column="f_work_logo_icon" property="workLogoIcon"/>
        <result column="f_creator_time" property="creatorTimes"/>
    </resultMap>
 
    <select id="findModule" parameterType="String" resultMap="ModuleVO">
        SELECT * FROM base_module WHERE 1=1
        AND (f_id IN
            <trim suffixOverrides=" OR f_id IN()">
                <foreach collection="objectId" item="id" index="index" open="(" close=")" >
                    <if test="index != 0">
                        <choose>
                            <when test="index % 1000 == 999">) OR f_id IN (</when>
                            <otherwise>,</otherwise>
                        </choose>
                    </if>
                    #{id}
                </foreach>
            </trim>
        )
        <if test="mark == 1">
            and f_enabled_mark = #{mark}
        </if>
        <if test="systemId != null and systemId.size > 0">
            and f_system_id in
            <foreach collection="systemId" item="id" open="(" close=")" separator=",">
                #{id}
            </foreach>
        </if>
        <if test="moduleAuthorize != null and moduleAuthorize.size > 0">
            and f_id not in
            <foreach collection="moduleAuthorize" item="moduleId" open="(" close=")" separator=",">
                #{moduleId}
            </foreach>
        </if>
        <if test="moduleUrlAddressAuthorize != null and moduleUrlAddressAuthorize.size > 0">
            and
            ((f_url_address not in
            <foreach collection="moduleUrlAddressAuthorize" item="urlAddress" open="(" close=")" separator=",">
                #{urlAddress}
            </foreach>
            )
            or f_url_address is null
            )
        </if>
        Order by f_sort_code asc,f_creator_time desc
    </select>
 
    <select id="findButton" parameterType="String" resultMap="ButtonVO">
        SELECT * FROM base_module_button WHERE 1=1
        AND (f_id IN
            <trim suffixOverrides=" OR f_id IN()">
                <foreach collection="objectId" item="id" index="index" open="(" close=")">
                    <if test="index != 0">
                        <choose>
                            <when test="index % 1000 == 999">) OR f_id IN (</when>
                            <otherwise>,</otherwise>
                        </choose>
                    </if>
                    #{id}
                </foreach>
            </trim>
        )
        and f_enabled_mark = 1  Order by f_sort_code asc,f_creator_time desc
    </select>
 
 
    <select id="findColumn" parameterType="String" resultMap="ColumnVO">
        SELECT * FROM base_module_column WHERE 1=1
        AND (f_id IN
            <trim suffixOverrides=" OR f_id IN()">
                <foreach collection="objectId" item="id" index="index" open="(" close=")">
                    <if test="index != 0">
                        <choose>
                            <when test="index % 1000 == 999">) OR f_id IN (</when>
                            <otherwise>,</otherwise>
                        </choose>
                    </if>
                    #{id}
                </foreach>
            </trim>
        )
        and f_enabled_mark = 1  Order by f_sort_code asc,f_creator_time desc
    </select>
 
    <select id="findForms" parameterType="String" resultMap="FormVO">
        SELECT * FROM base_module_form WHERE 1=1
        AND (f_id IN
            <trim suffixOverrides=" OR f_id IN()">
                <foreach collection="objectId" item="id" index="index" open="(" close=")">
                    <if test="index != 0">
                        <choose>
                            <when test="index % 1000 == 999">) OR f_id IN (</when>
                            <otherwise>,</otherwise>
                        </choose>
                    </if>
                    #{id}
                </foreach>
            </trim>
        )
        and f_enabled_mark = 1  Order by f_sort_code asc,f_creator_time desc
    </select>
 
    <select id="findSystem" parameterType="String" resultMap="SystemVO">
        SELECT * FROM base_system WHERE f_id IN
        <foreach collection="objectId" item="id" open="(" close=")" separator=",">
            #{id}
        </foreach>
        <if test="mark == 1">
            and f_enabled_mark = #{mark}
        </if>
        <if test="enCode != null and enCode != ''">
            and f_en_code != #{enCode}
        </if>
        <if test="moduleAuthorize != null and moduleAuthorize.size > 0">
            and f_id not in
                <foreach collection="moduleAuthorize" item="moduleId" open="(" close=")" separator=",">
                    #{moduleId}
                </foreach>
        </if>
         Order by f_sort_code asc,f_creator_time desc
    </select>
 
    <select id="findResource" parameterType="String" resultMap="ResourceVO">
        select s.*, a.f_object_id from base_module_scheme s
        LEFT JOIN base_authorize a on s.f_id = a.f_item_id
        where 1=1
        AND (s.f_id IN
            <trim suffixOverrides=" OR s.f_id IN()">
                <foreach collection="objectId" item="id" index="index" open="(" close=")">
                    <if test="index != 0">
                        <choose>
                            <when test="index % 1000 == 999">) OR s.f_id IN (</when>
                            <otherwise>,</otherwise>
                        </choose>
                    </if>
                    #{id}
                </foreach>
            </trim>
        )
        and s.f_enabled_mark = 1  Order by s.f_sort_code asc,s.f_creator_time desc
    </select>
 
    <select id="findButtonAdmin" parameterType="Integer" resultMap="ButtonVO">
       SELECT * FROM base_module_button WHERE f_enabled_mark = #{mark} Order by f_sort_code asc,f_creator_time desc
    </select>
 
    <select id="findColumnAdmin" parameterType="Integer" resultMap="ColumnVO">
        SELECT * FROM base_module_column WHERE f_enabled_mark = #{mark} Order by f_sort_code asc,f_creator_time desc
    </select>
 
    <select id="findFormsAdmin" parameterType="Integer" resultMap="FormVO">
       SELECT * FROM base_module_form WHERE f_enabled_mark = #{mark} Order by f_sort_code asc,f_creator_time desc
    </select>
 
    <select id="findResourceAdmin" parameterType="Integer" resultMap="ResourceVO">
       SELECT * FROM base_module_scheme WHERE f_enabled_mark = #{mark} Order by f_sort_code asc,f_creator_time desc
    </select>
 
 
</mapper>