Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
cxt104926
Stusystem
提交
3b74b945
S
Stusystem
项目概览
cxt104926
/
Stusystem
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Stusystem
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
3b74b945
编写于
6月 29, 2021
作者:
cxt104926
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化
上级
3c1c3ed0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
50 addition
and
18 deletion
+50
-18
src/main/java/com/stu/stusystem/service/system/UserManagerService.java
.../com/stu/stusystem/service/system/UserManagerService.java
+5
-0
src/main/java/com/stu/stusystem/service/system/vo/StuUserVO.java
...n/java/com/stu/stusystem/service/system/vo/StuUserVO.java
+3
-0
src/main/java/com/stu/stusystem/util/StrUtil.java
src/main/java/com/stu/stusystem/util/StrUtil.java
+23
-0
src/main/resources/mapper/StuMapper.xml
src/main/resources/mapper/StuMapper.xml
+19
-18
未找到文件。
src/main/java/com/stu/stusystem/service/system/UserManagerService.java
浏览文件 @
3b74b945
...
@@ -9,6 +9,7 @@ import com.stu.stusystem.service.system.dto.UserManagerDTO;
...
@@ -9,6 +9,7 @@ import com.stu.stusystem.service.system.dto.UserManagerDTO;
import
com.stu.stusystem.service.system.dto.UserManagerQuery
;
import
com.stu.stusystem.service.system.dto.UserManagerQuery
;
import
com.stu.stusystem.service.system.vo.StuUserVO
;
import
com.stu.stusystem.service.system.vo.StuUserVO
;
import
com.stu.stusystem.util.CopyBeanUtil
;
import
com.stu.stusystem.util.CopyBeanUtil
;
import
com.stu.stusystem.util.StrUtil
;
import
org.apache.shiro.SecurityUtils
;
import
org.apache.shiro.SecurityUtils
;
import
org.apache.shiro.crypto.hash.Sha1Hash
;
import
org.apache.shiro.crypto.hash.Sha1Hash
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -38,6 +39,10 @@ public class UserManagerService {
...
@@ -38,6 +39,10 @@ public class UserManagerService {
public
PageInfo
<
StuUserVO
>
getStuMangerPage
(
UserManagerQuery
query
)
{
public
PageInfo
<
StuUserVO
>
getStuMangerPage
(
UserManagerQuery
query
)
{
PageHelper
.
startPage
(
query
.
getPage
(),
query
.
getLimit
());
PageHelper
.
startPage
(
query
.
getPage
(),
query
.
getLimit
());
List
<
StuUserVO
>
stuMangerPage
=
this
.
stuMapper
.
getStuMangerPage
(
query
);
List
<
StuUserVO
>
stuMangerPage
=
this
.
stuMapper
.
getStuMangerPage
(
query
);
for
(
StuUserVO
vo
:
stuMangerPage
)
{
String
s
=
StrUtil
.
hideSix
(
vo
.
getIdCard
());
vo
.
setIdCard
(
s
);
}
return
new
PageInfo
<>(
stuMangerPage
);
return
new
PageInfo
<>(
stuMangerPage
);
}
}
...
...
src/main/java/com/stu/stusystem/service/system/vo/StuUserVO.java
浏览文件 @
3b74b945
...
@@ -21,6 +21,9 @@ public class StuUserVO {
...
@@ -21,6 +21,9 @@ public class StuUserVO {
@ApiModelProperty
(
"班级id"
)
@ApiModelProperty
(
"班级id"
)
private
String
classId
;
private
String
classId
;
@ApiModelProperty
(
"班级id"
)
private
String
className
;
@ApiModelProperty
(
"联系电话"
)
@ApiModelProperty
(
"联系电话"
)
private
String
phone
;
private
String
phone
;
...
...
src/main/java/com/stu/stusystem/util/StrUtil.java
0 → 100644
浏览文件 @
3b74b945
package
com.stu.stusystem.util
;
/**
* @author: cxt
* @time: 2021/6/29
* 简单的字符串工具类
*/
public
class
StrUtil
{
/**
* 隐藏身份证号中间6位
*/
public
static
String
hideSix
(
String
str
)
{
if
(
str
.
equals
(
""
))
{
return
""
;
}
if
(
str
.
length
()
==
18
){
return
str
.
replaceAll
(
"(\\d{6})\\d{6}(\\w{6})"
,
"$1******$2"
);
}
else
{
return
str
.
replaceAll
(
"(\\d{5})\\d{5}(\\w{5})"
,
"$1*****$2"
);
}
}
}
\ No newline at end of file
src/main/resources/mapper/StuMapper.xml
浏览文件 @
3b74b945
...
@@ -2,24 +2,25 @@
...
@@ -2,24 +2,25 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.stu.stusystem.mapper.system.StuMapper"
>
<mapper
namespace=
"com.stu.stusystem.mapper.system.StuMapper"
>
<select
id=
"getStuMangerPage"
resultType=
"com.stu.stusystem.service.system.vo.StuUserVO"
>
<select
id=
"getStuMangerPage"
resultType=
"com.stu.stusystem.service.system.vo.StuUserVO"
>
SELECT id,
SELECT su.id,
name,
su.name,
account,
su.account,
class_id AS classId,
su.class_id AS classId,
phone,
su.phone,
id_card AS idCard
su.id_card AS idCard,
FROM stu_user
sc.name AS className
<where>
FROM stu_user su
<if
test=
"query.name != null and query.name != ''"
>
LEFT JOIN stu_class sc ON sc.id = su.class_id
name like concat('%', #{query.name}, '%')
WHERE su.account != 'admin'
</if>
<if
test=
"query.name != null and query.name != ''"
>
<if
test=
"param1.classId != null and param1.classId != ''"
>
AND su.name like concat('%', #{query.name}, '%')
AND class_id = #{query.classId}
</if>
</if>
<if
test=
"param1.classId != null and param1.classId != ''"
>
<if
test=
"query.phone != null and query.phone != ''"
>
AND su.class_id = #{query.classId}
AND phone = #{query.phone}
</if>
</if>
<if
test=
"query.phone != null and query.phone != ''"
>
</where>
AND su.phone = #{query.phone}
</if>
</select>
</select>
<resultMap
id=
"getWhole"
type=
"java.util.Map"
>
<resultMap
id=
"getWhole"
type=
"java.util.Map"
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录