Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xzxt-shiro
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
常超
xzxt-shiro
Commits
c8c6a156
Commit
c8c6a156
authored
Jan 08, 2019
by
wushanyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
系统管理权限查询页面,地市县级管理员sql进行优化,将公共查询条件进行提取
parent
def9f362
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
34 deletions
+32
-34
src/main/java/com/xzxtshiro/mapper/SearchUserMapper.xml
+32
-34
No files found.
src/main/java/com/xzxtshiro/mapper/SearchUserMapper.xml
View file @
c8c6a156
...
...
@@ -38,14 +38,6 @@
<result
column=
"TQYHBZ"
property=
"tqyhbz"
jdbcType=
"VARCHAR"
/>
</resultMap>
<!--地市县级管理员公共sql-->
<sql
id=
"Base_Column_List"
>
ID, UNITCODE, USERNAME, PASSWORD, TRUE_NAME, OPEN_FLAG, DEFAULT_MODEL, REMARK, LRR,
LRSJ, GXR, GXSJ, LRDWDM, LRDWMC, IDENTITYCARD, SEX, BIRTHDAY, TELEPHONE, UNITNAME,
SCBZ, IP, GRADE, POLICEMANID, DEFAULT_DESKTOP, THEME, LASTLOGINTIME, LASTCHECKTIME,
XXZYURL, GZZM_ZHY, GZZM_YPY, GZZM_ZCY, GZZM_PLAY, GLYBZ, TQYHBZ
</sql>
<!--查询地市级管理员-->
<!--其他省份-->
<select
id=
"selectDsxjglyListByCondition"
resultMap=
"BaseResultMap"
>
...
...
@@ -60,16 +52,7 @@
from sys_role r join sys_user_role u on r.id=u.role_id where u.scbz='0' and r.scbz='0' GROUP BY u.user_id) tt
on t.id=tt.user_id
where scbz='0' and t.username != 'admin'
<if
test=
"countycode !=null"
>
and REGEXP_LIKE (UNITCODE, '^'||#{countycode})
</if>
<if
test=
"trueName !=null"
>
and true_name like '%'||#{trueName}||'%'
</if>
<if
test=
"policemanid !=null"
>
and policemanid like '%'||#{policemanid}||'%'
</if>
<if
test=
"unitcode !=null"
>
and UNITCODE like '%'||#{unitcode}||'%'
<if
test=
"unitcode == '61'"
>
and rolename like '%省市县管理员%'
</if>
<if
test=
"unitcode != '61'"
>
and rolename like '%地市管理员%'
</if>
</if>
<if
test=
"telephone !=null"
>
and telephone like '%'||#{telephone}||'%'
</if>
<if
test=
"grade !=null"
>
and grade = #{grade}
</if>
<if
test=
"grade ==null"
>
and grade = 'D'
</if>
<include
refid=
"query_condition_qtsf"
/>
) t where ROWNUM
<![CDATA[<=]]>
${limit*page}
) where rn > ${(page-1)*limit}
...
...
@@ -84,15 +67,7 @@
from sys_role r join sys_user_role u on r.id=u.role_id where u.scbz='0' and r.scbz='0' GROUP BY u.user_id) tt
on t.id=tt.user_id
where scbz='0' and t.username != 'admin'
<if
test=
"trueName !=null"
>
and true_name like '%'||#{trueName}||'%'
</if>
<if
test=
"policemanid !=null"
>
and policemanid like '%'||#{policemanid}||'%'
</if>
<if
test=
"unitcode !=null"
>
and UNITCODE like '%'||#{unitcode}||'%'
<if
test=
"unitcode == '61'"
>
and rolename like '%省市县管理员%'
</if>
<if
test=
"unitcode != '61'"
>
and rolename like '%地市管理员%'
</if>
</if>
<if
test=
"telephone !=null"
>
and telephone like '%'||#{telephone}||'%'
</if>
<if
test=
"grade !=null"
>
and grade = #{grade}
</if>
<if
test=
"grade ==null"
>
and grade = 'D'
</if>
<include
refid=
"query_condition_qtsf"
/>
</select>
<!--山西特殊情况-->
...
...
@@ -108,12 +83,7 @@
from sys_role r join sys_user_role u on r.id=u.role_id where u.scbz='0' and r.scbz='0' GROUP BY u.user_id) tt
on t.id=tt.user_id
where scbz='0' and t.username != 'admin' and rolename like '%地市级管理员%'
<if
test=
"trueName !=null"
>
and true_name like '%'||#{trueName}||'%'
</if>
<if
test=
"policemanid !=null"
>
and policemanid like '%'||#{policemanid}||'%'
</if>
<if
test=
"unitcode !=null"
>
and UNITCODE like '%'||#{unitcode}||'%'
</if>
<if
test=
"telephone !=null"
>
and telephone like '%'||#{telephone}||'%'
</if>
<if
test=
"grade !=null"
>
and grade = #{grade}
</if>
<if
test=
"grade ==null"
>
and grade = 'D'
</if>
<include
refid=
"query_condition_sx"
/>
) t where ROWNUM
<![CDATA[<=]]>
${limit*page}
) where rn > ${(page-1)*limit}
...
...
@@ -128,13 +98,41 @@
from sys_role r join sys_user_role u on r.id=u.role_id where u.scbz='0' and r.scbz='0' GROUP BY u.user_id) tt
on t.id=tt.user_id
where scbz='0' and t.username != 'admin' and rolename like '%地市级管理员%'
<include
refid=
"query_condition_sx"
/>
</select>
<!--地市县级管理员公共Column-->
<sql
id=
"Base_Column_List"
>
ID, UNITCODE, USERNAME, PASSWORD, TRUE_NAME, OPEN_FLAG, DEFAULT_MODEL, REMARK, LRR,
LRSJ, GXR, GXSJ, LRDWDM, LRDWMC, IDENTITYCARD, SEX, BIRTHDAY, TELEPHONE, UNITNAME,
SCBZ, IP, GRADE, POLICEMANID, DEFAULT_DESKTOP, THEME, LASTLOGINTIME, LASTCHECKTIME,
XXZYURL, GZZM_ZHY, GZZM_YPY, GZZM_ZCY, GZZM_PLAY, GLYBZ, TQYHBZ
</sql>
<!--其他省份地市县级管理员查询条件-->
<sql
id=
"query_condition_qtsf"
>
<if
test=
"countycode !=null"
>
and REGEXP_LIKE (UNITCODE, '^'||#{countycode})
</if>
<if
test=
"trueName !=null"
>
and true_name like '%'||#{trueName}||'%'
</if>
<if
test=
"policemanid !=null"
>
and policemanid like '%'||#{policemanid}||'%'
</if>
<if
test=
"unitcode !=null"
>
and UNITCODE like '%'||#{unitcode}||'%'
<if
test=
"unitcode == '61'"
>
and rolename like '%省市县管理员%'
</if>
<if
test=
"unitcode != '61'"
>
and rolename like '%地市管理员%'
</if>
</if>
<if
test=
"telephone !=null"
>
and telephone like '%'||#{telephone}||'%'
</if>
<if
test=
"grade !=null"
>
and grade = #{grade}
</if>
<if
test=
"grade ==null"
>
and grade = 'D'
</if>
</sql>
<!--山西省地市县级管理员查询条件-->
<sql
id=
"query_condition_sx"
>
<if
test=
"countycode !=null"
>
and REGEXP_LIKE (UNITCODE, '^'||#{countycode})
</if>
<if
test=
"trueName !=null"
>
and true_name like '%'||#{trueName}||'%'
</if>
<if
test=
"policemanid !=null"
>
and policemanid like '%'||#{policemanid}||'%'
</if>
<if
test=
"unitcode !=null"
>
and UNITCODE like '%'||#{unitcode}||'%'
</if>
<if
test=
"telephone !=null"
>
and telephone like '%'||#{telephone}||'%'
</if>
<if
test=
"grade !=null"
>
and grade = #{grade}
</if>
<if
test=
"grade ==null"
>
and grade = 'D'
</if>
</s
elect
>
</s
ql
>
<!-- 专项案件省厅负责人审批-->
<select
id=
"selectZxajstfzrUserByCondition"
resultType=
"com.xzxtshiro.pojo.SysUser"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment