Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jilinzhongdianrenqun
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
吴超
jilinzhongdianrenqun
Commits
bb3880d1
Commit
bb3880d1
authored
Dec 29, 2025
by
wangchunyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
前台样式调整及测试问题调整
parent
6f19a0ed
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
388 行增加
和
41 行删除
+388
-41
src/main/java/com/scpyun/platform/jilinsscgsdp/service/impl/KeyDmStatsServiceImpl.java
+3
-0
src/main/java/com/scpyun/platform/jilinsscgsdp/service/impl/KeyDmUserCategoryServiceImpl.java
+119
-0
src/main/java/com/scpyun/platform/jilinsscgsdp/service/impl/KeyDmUserServiceImpl.java
+36
-8
src/main/resources/mybatis/mappers/standard/jilinsscgsdp/KeyDmUserCategoryDao.xml
+206
-1
src/main/resources/mybatis/mappers/standard/jilinsscgsdp/KeyDmUserDao.xml
+24
-32
没有找到文件。
src/main/java/com/scpyun/platform/jilinsscgsdp/service/impl/KeyDmStatsServiceImpl.java
View file @
bb3880d1
...
...
@@ -4,6 +4,7 @@ import com.scpyun.base.core.annotation.Api;
import
com.scpyun.base.core.annotation.ApiOperation
;
import
com.scpyun.base.core.exception.CustomException
;
import
com.scpyun.base.db.service.CommonService
;
import
com.scpyun.platform.jilinsscgsdp.utils.DataScopeUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -22,6 +23,8 @@ public class KeyDmStatsServiceImpl {
@ApiOperation
(
value
=
"使用统计"
,
desc
=
"统计各部门领用量"
)
public
List
<
Map
<
String
,
Object
>>
selectUsageStats
(
Map
<
String
,
Object
>
map
)
{
if
(
map
==
null
)
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
user
=
(
Map
<
String
,
Object
>)
map
.
get
(
"_user"
);
Map
<
String
,
String
>
pos
=
DataScopeUtil
.
getPosition
(
user
);
return
commonService
.
findList
(
namespace
+
"selectUsageStats"
,
map
);
}
...
...
src/main/java/com/scpyun/platform/jilinsscgsdp/service/impl/KeyDmUserCategoryServiceImpl.java
View file @
bb3880d1
...
...
@@ -6,6 +6,7 @@ import com.scpyun.base.core.annotation.ApiOperation;
import
com.scpyun.base.core.exception.CustomException
;
import
com.scpyun.base.core.utils.UUIDUtil
;
import
com.scpyun.base.db.service.CommonService
;
import
com.scpyun.platform.jilinsscgsdp.utils.DataScopeUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -242,4 +243,122 @@ public class KeyDmUserCategoryServiceImpl {
if
(
map
==
null
)
map
=
new
HashMap
<>();
return
commonService
.
findList
(
namespace
+
"selectOrgPermission"
,
map
);
}
// ===== 图表分析 =====
@ApiOperation
(
value
=
"获取汇总统计数据"
,
desc
=
"获取请假、申领、入库次数统计"
)
public
Map
<
String
,
Object
>
getSummaryStats
()
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
// 请假次数
Map
<
String
,
Object
>
leaveCount
=
commonService
.
getObject
(
namespace
+
"getLeaveCount"
,
map
);
result
.
put
(
"leaveCount"
,
leaveCount
!=
null
?
leaveCount
.
get
(
"count"
)
:
0
);
// 申领次数
Map
<
String
,
Object
>
borrowCount
=
commonService
.
getObject
(
namespace
+
"getBorrowCount"
,
map
);
result
.
put
(
"borrowCount"
,
borrowCount
!=
null
?
borrowCount
.
get
(
"count"
)
:
0
);
// 入库次数
Map
<
String
,
Object
>
inboundCount
=
commonService
.
getObject
(
namespace
+
"getInboundCount"
,
map
);
result
.
put
(
"inboundCount"
,
inboundCount
!=
null
?
inboundCount
.
get
(
"count"
)
:
0
);
return
result
;
}
@ApiOperation
(
value
=
"获取请假类型统计"
,
desc
=
"获取各请假类型的占比统计"
)
public
List
<
Map
<
String
,
Object
>>
getLeaveTypeStats
()
{
return
commonService
.
findList
(
namespace
+
"getLeaveTypeStats"
,
null
);
}
@ApiOperation
(
value
=
"获取人员请假统计"
,
desc
=
"获取月度各人员的请假次数统计"
)
public
List
<
Map
<
String
,
Object
>>
getLeaveUserStats
()
{
return
commonService
.
findList
(
namespace
+
"getLeaveUserStats"
,
null
);
}
@ApiOperation
(
value
=
"获取用品领用统计"
,
desc
=
"获取月度各用品的领用量统计"
)
public
List
<
Map
<
String
,
Object
>>
getMaterialUsageStats
()
{
return
commonService
.
findList
(
namespace
+
"getMaterialUsageStats"
,
null
);
}
@ApiOperation
(
value
=
"获取库存预警列表"
,
desc
=
"获取超出或低于阙值的用品信息"
)
public
List
<
Map
<
String
,
Object
>>
getStockWarningList
()
{
return
commonService
.
findList
(
namespace
+
"getStockWarningList"
,
null
);
}
// ===== 部门管理 =====
@ApiOperation
(
value
=
"查询部门列表"
,
desc
=
"分页查询部门"
)
public
Page
<
Map
<
String
,
Object
>>
selectOrgList
(
Page
<
Map
<
String
,
Object
>>
map
)
{
if
(
map
==
null
)
map
=
new
Page
<>();
Map
<
String
,
Object
>
user
=
(
Map
<
String
,
Object
>)
map
.
getParams
().
get
(
"_user"
);
Map
<
String
,
String
>
pos
=
DataScopeUtil
.
getPosition
(
user
);
map
.
getParams
().
put
(
"area_id"
,
pos
.
get
(
"area_id"
));
return
commonService
.
findPage
(
namespace
+
"selectOrgList"
,
map
);
}
@ApiOperation
(
value
=
"保存部门"
,
desc
=
"新增或修改部门"
)
public
String
saveOrg
(
Map
<
String
,
Object
>
map
)
{
if
(
map
==
null
)
{
throw
new
CustomException
(
"参数不能为空"
);
}
Object
id
=
map
.
get
(
"id"
);
if
(
id
==
null
||
String
.
valueOf
(
id
).
trim
().
isEmpty
())
{
Map
<
String
,
Object
>
user
=
(
Map
<
String
,
Object
>)
map
.
get
(
"_user"
);
Map
<
String
,
String
>
pos
=
DataScopeUtil
.
getPosition
(
user
);
// 新增
map
.
put
(
"id"
,
UUIDUtil
.
getUUID
());
map
.
put
(
"source_org"
,
pos
.
get
(
"area_id"
));
map
.
put
(
"org_code"
,
map
.
get
(
"id"
));
if
(
commonService
.
insert
(
namespace
+
"insertOrg"
,
map
)
!=
1
)
{
throw
new
CustomException
(
"保存失败"
);
}
}
else
{
// 修改
int
affected
=
commonService
.
update
(
namespace
+
"updateOrg"
,
map
);
if
(
affected
<
0
)
throw
new
CustomException
(
"保存失败"
);
}
return
SUCCESS
;
}
@ApiOperation
(
value
=
"删除部门"
,
desc
=
"逻辑删除部门"
)
public
String
deleteOrg
(
Map
<
String
,
Object
>
map
)
{
if
(
map
==
null
||
map
.
get
(
"id"
)
==
null
)
{
throw
new
CustomException
(
"参数不能为空"
);
}
int
affected
=
commonService
.
update
(
namespace
+
"deleteOrg"
,
map
);
if
(
affected
<
0
)
throw
new
CustomException
(
"删除失败"
);
return
SUCCESS
;
}
@ApiOperation
(
value
=
"分配用户到部门"
,
desc
=
"将用户分配到指定部门"
)
public
String
assignUsersToOrg
(
Map
<
String
,
Object
>
map
)
{
if
(
map
==
null
||
map
.
get
(
"org_id"
)
==
null
)
{
throw
new
CustomException
(
"参数缺失"
);
}
String
orgId
=
map
.
get
(
"org_id"
).
toString
();
List
<
String
>
userIds
=
(
List
<
String
>)
map
.
get
(
"user_ids"
);
Map
<
String
,
Object
>
user
=
(
Map
<
String
,
Object
>)
map
.
get
(
"_user"
);
Map
<
String
,
String
>
pos
=
DataScopeUtil
.
getPosition
(
user
);
// 先清除该部门的所有用户分配
Map
<
String
,
Object
>
clearParam
=
new
HashMap
<>();
clearParam
.
put
(
"belong_org_id"
,
orgId
);
clearParam
.
put
(
"area_id"
,
pos
.
get
(
"area_id"
));
clearParam
.
put
(
"parent_ids"
,
user
.
get
(
"parent_ids"
)+
","
+
pos
.
get
(
"area_id"
));
commonService
.
update
(
namespace
+
"clearOrgUsers"
,
clearParam
);
// 再分配新用户
if
(
userIds
!=
null
&&
!
userIds
.
isEmpty
())
{
for
(
String
userId
:
userIds
)
{
Map
<
String
,
Object
>
assignParam
=
new
HashMap
<>();
assignParam
.
put
(
"user_id"
,
userId
);
assignParam
.
put
(
"belong_org_id"
,
orgId
);
// 这里需要根据实际的部门信息设置其他字段
// 暂时只更新 belong_org_id,后续可以扩展
commonService
.
update
(
namespace
+
"assignUserToOrg"
,
assignParam
);
}
}
return
SUCCESS
;
}
}
src/main/java/com/scpyun/platform/jilinsscgsdp/service/impl/KeyDmUserServiceImpl.java
View file @
bb3880d1
...
...
@@ -5,12 +5,14 @@ import com.scpyun.base.core.annotation.Api;
import
com.scpyun.base.core.annotation.ApiOperation
;
import
com.scpyun.base.core.exception.CustomException
;
import
com.scpyun.base.db.service.CommonService
;
import
com.scpyun.platform.jilinsscgsdp.utils.DataScopeUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Api
(
"日常人员管理"
)
@Service
(
"keyDmUser"
)
...
...
@@ -24,6 +26,12 @@ public class KeyDmUserServiceImpl {
@ApiOperation
(
value
=
"分页查询日常人员列表"
,
desc
=
"分页"
)
public
Page
<
Map
<
String
,
Object
>>
selectList
(
Page
<
Map
<
String
,
Object
>>
map
)
{
if
(
map
==
null
)
map
=
new
Page
<>();
Map
<
String
,
Object
>
user
=
(
Map
<
String
,
Object
>)
map
.
getParams
().
get
(
"_user"
);
if
(
user
!=
null
)
{
Map
<
String
,
String
>
pos
=
DataScopeUtil
.
getPosition
(
user
);
map
.
getParams
().
put
(
"areaId"
,
pos
.
get
(
"area_id"
));
map
.
getParams
().
put
(
"parentIds"
,
user
.
get
(
"parent_ids"
)+
","
+
pos
.
get
(
"area_id"
));
}
return
commonService
.
findPage
(
namespace
+
"selectList"
,
map
);
}
...
...
@@ -57,14 +65,26 @@ public class KeyDmUserServiceImpl {
@ApiOperation
(
value
=
"根据机构编码同步用户"
,
desc
=
"同步本级及下属机构用户"
)
public
String
syncByOffice
(
Map
<
String
,
Object
>
map
)
{
// 查询 sys_user 列表(通过 office_code 匹配本级及下属机构)
// 查询 sys_user 列表(通过当前机构匹配本级及下属机构)
Map
<
String
,
Object
>
user
=
(
Map
<
String
,
Object
>)
map
.
get
(
"_user"
);
if
(
user
!=
null
)
{
Map
<
String
,
String
>
pos
=
DataScopeUtil
.
getPosition
(
user
);
map
.
put
(
"areaId"
,
pos
.
get
(
"area_id"
));
map
.
put
(
"parentIds"
,
user
.
get
(
"parent_ids"
)+
","
+
pos
.
get
(
"area_id"
));
}
List
<
Map
<
String
,
Object
>>
sysUsers
=
commonService
.
findList
(
namespace
+
"selectSysUserByOfficeCode"
,
map
);
List
<
Map
<
String
,
Object
>>
haveUsers
=
commonService
.
findList
(
namespace
+
"selectDmUserByOfficeCode"
,
map
);
if
(
sysUsers
==
null
)
return
SUCCESS
;
Map
<
String
,
Map
<
String
,
Object
>>
sysUserMap
=
haveUsers
.
stream
()
.
collect
(
Collectors
.
toMap
(
item
->
(
String
)
item
.
get
(
"id"
),
// 键提取器:从每个map中取出"id"的值作为新Map的键
item
->
item
,
// 值提取器:每个map本身作为新Map的值
(
existing
,
replacement
)
->
existing
// 合并函数
));
for
(
Map
<
String
,
Object
>
u
:
sysUsers
)
{
if
(
u
==
null
)
continue
;
Map
<
String
,
Object
>
byIdParam
=
new
HashMap
<>();
byIdParam
.
put
(
"id"
,
u
.
get
(
"id"
));
Map
<
String
,
Object
>
exists
=
commonService
.
getObject
(
namespace
+
"getById"
,
byIdParam
);
Map
<
String
,
Object
>
exists
=
sysUserMap
.
get
(
String
.
valueOf
(
u
.
get
(
"id"
)));
if
(
exists
==
null
)
{
// prepare insert map: only copy available fields
Map
<
String
,
Object
>
ins
=
new
HashMap
<>();
...
...
@@ -105,6 +125,12 @@ public class KeyDmUserServiceImpl {
@ApiOperation
(
value
=
"人员选择器列表查询"
,
desc
=
"根据机构和权限过滤人员"
)
public
Page
<
Map
<
String
,
Object
>>
selectUserSelectorList
(
Page
<
Map
<
String
,
Object
>>
map
)
{
if
(
map
==
null
)
map
=
new
Page
<>();
Map
<
String
,
Object
>
user
=
(
Map
<
String
,
Object
>)
map
.
getParams
().
get
(
"_user"
);
if
(
user
!=
null
)
{
Map
<
String
,
String
>
pos
=
DataScopeUtil
.
getPosition
(
user
);
map
.
getParams
().
put
(
"areaId"
,
pos
.
get
(
"area_id"
));
map
.
getParams
().
put
(
"parentId"
,
user
.
get
(
"parent_id"
));
}
return
commonService
.
findPage
(
namespace
+
"selectUserSelectorList"
,
map
);
}
...
...
@@ -112,10 +138,12 @@ public class KeyDmUserServiceImpl {
public
Page
<
Map
<
String
,
Object
>>
selectUserMultiSelectorList
(
Page
<
Map
<
String
,
Object
>>
map
)
{
if
(
map
==
null
)
map
=
new
Page
<>();
Map
<
String
,
Object
>
user
=
(
Map
<
String
,
Object
>)
map
.
getParams
().
get
(
"_user"
);
// if (user != null) {
// Map<String, String> pos = DataScopeUtil.getPosition(user);
// map.getParams().put("orgId", pos.get("area_id"));
// }
if
(
user
!=
null
)
{
Map
<
String
,
String
>
pos
=
DataScopeUtil
.
getPosition
(
user
);
map
.
getParams
().
put
(
"areaId"
,
pos
.
get
(
"area_id"
));
map
.
getParams
().
put
(
"parentId"
,
user
.
get
(
"parent_id"
));
map
.
getParams
().
put
(
"parentIds"
,
user
.
get
(
"parent_ids"
)+
","
+
pos
.
get
(
"area_id"
));
}
return
commonService
.
findPage
(
namespace
+
"selectUserMultiSelectorList"
,
map
);
}
}
...
...
src/main/resources/mybatis/mappers/standard/jilinsscgsdp/KeyDmUserCategoryDao.xml
View file @
bb3880d1
...
...
@@ -510,9 +510,214 @@
<if
test=
"permissionType != null and permissionType != ''"
>
AND p.permission_code = #{permissionType}
</if>
</where>
ORDER BY order_no ASC, create_time DESC
</select>
<!-- ===== 图表分析 ===== -->
<!-- 获取请假总次数 -->
<select
id=
"getLeaveCount"
resultType=
"map"
>
SELECT COUNT(*) as count
FROM jl_key_dm_leave_application
WHERE is_used = 1
</select>
<!-- 获取申领总次数 -->
<select
id=
"getBorrowCount"
resultType=
"map"
>
SELECT COUNT(*) as count
FROM jl_key_dm_borrow_application
WHERE is_used = 1
</select>
<!-- 获取入库总次数 -->
<select
id=
"getInboundCount"
resultType=
"map"
>
SELECT COUNT(*) as count
FROM jl_key_dm_inbound_record
WHERE is_used = 1
</select>
<!-- 请假类型统计 -->
<select
id=
"getLeaveTypeStats"
resultType=
"map"
>
SELECT
lt.type_name,
COUNT(la.id) as count
FROM jl_key_dm_leave_type lt
LEFT JOIN jl_key_dm_leave_application la ON la.leave_type_id = lt.id AND la.is_used = 1
WHERE lt.is_used = 1 AND lt.status = 1
GROUP BY lt.id, lt.type_name
ORDER BY count DESC
</select>
<!-- 人员请假统计(月度) -->
<select
id=
"getLeaveUserStats"
resultType=
"map"
>
SELECT
u.name as user_name,
COUNT(la.id) as leave_count
FROM jl_key_dm_user u
LEFT JOIN jl_key_dm_leave_application la ON la.applicant_id = u.id AND la.is_used = 1
AND DATE_FORMAT(la.create_time, '%Y-%m') = DATE_FORMAT(NOW(), '%Y-%m')
WHERE u.is_used = 1 AND u.is_leave = 0
GROUP BY u.id, u.name
HAVING leave_count > 0
ORDER BY leave_count DESC
LIMIT 20
</select>
<!-- 用品领用统计(月度) -->
<select
id=
"getMaterialUsageStats"
resultType=
"map"
>
SELECT
m.material_name,
SUM(bd.apply_quantity) as total_quantity
FROM jl_key_dm_material m
LEFT JOIN jl_key_dm_borrow_detail bd ON bd.material_id = m.id
LEFT JOIN jl_key_dm_borrow_application ba ON ba.id = bd.application_id AND ba.is_used = 1
AND DATE_FORMAT(ba.create_time, '%Y-%m') = DATE_FORMAT(NOW(), '%Y-%m')
WHERE m.is_used = 1
GROUP BY m.id, m.material_name
HAVING total_quantity
>
0
ORDER BY total_quantity DESC
LIMIT 20
</select>
<!-- 库存预警列表 -->
<select
id=
"getStockWarningList"
resultType=
"map"
>
SELECT
m.material_name,
i.available_quantity,
m.min_stock,
m.max_stock,
CASE
WHEN i.available_quantity
<
m.min_stock THEN 'low'
WHEN i.available_quantity
>
m.max_stock THEN 'high'
END as status
FROM jl_key_dm_material m
LEFT JOIN jl_key_dm_inventory i ON i.material_id = m.id
WHERE m.is_used = 1
AND (i.available_quantity
<
m.min_stock OR i.available_quantity
>
m.max_stock)
ORDER BY
CASE
WHEN i.available_quantity
<
m.min_stock THEN 1
WHEN i.available_quantity
>
m.max_stock THEN 2
END,
ABS(i.available_quantity - (m.min_stock + m.max_stock) / 2) DESC
</select>
<!-- ===== 部门管理 ===== -->
<select
id=
"selectOrgList"
parameterType=
"page"
resultType=
"map"
>
<!-- SELECT-->
<!-- id,-->
<!-- source_org,-->
<!-- org_code,-->
<!-- org_name,-->
<!-- remark,-->
<!-- is_used,-->
<!-- create_by,-->
<!-- create_time,-->
<!-- update_by,-->
<!-- update_time,-->
<!-- order_no-->
<!-- FROM jl_key_dm_org-->
<!-- <where>-->
<!-- AND is_used = 1-->
<!-- <if test="params.org_name != null and params.org_name != ''">-->
<!-- AND org_name LIKE CONCAT('%', #{params.org_name}, '%')-->
<!-- </if>-->
<!-- <if test="params.org_code != null and params.org_code != ''">-->
<!-- AND org_code LIKE CONCAT('%', #{params.org_code}, '%')-->
<!-- </if>-->
<!-- </where>-->
<!-- ORDER BY order_no ASC, create_time DESC-->
SELECT
org.id,
org.org_name,
org.source_org,
org.org_code,
org.order_no,
GROUP_CONCAT(CONCAT(u.name) SEPARATOR ',') AS user_names,
JSON_ARRAYAGG(
JSON_OBJECT(
'user_id', u.id,
'user_name', u.name
)
) AS users
FROM jl_key_dm_org org
LEFT JOIN jl_key_dm_user u ON u.belong_org_id = org.id AND u.is_used = 1
<where>
AND org.is_used = 1 AND source_org = #{params.area_id}
<if
test=
"params.org_name != null and params.org_name != ''"
>
AND org_name LIKE CONCAT('%', #{params.org_name}, '%')
</if>
</where>
GROUP BY org.id, org.org_name,org.source_org,org.org_code,org.order_no
ORDER BY org.order_no
</select>
<insert
id=
"insertOrg"
parameterType=
"map"
>
INSERT INTO jl_key_dm_org(
id,
source_org,
org_code,
org_name,
remark,
is_used,
create_by,
create_time,
order_no
) VALUES (
#{id},
#{source_org},
#{org_code},
#{org_name},
#{remark},
1,
#{_user.id},
NOW(),
#{order_no}
)
</insert>
<update
id=
"updateOrg"
parameterType=
"map"
>
UPDATE jl_key_dm_org
SET
org_name = #{org_name},
remark = #{remark},
order_no = #{order_no},
update_by = #{_user.id},
update_time = NOW()
WHERE id = #{id}
</update>
<update
id=
"deleteOrg"
parameterType=
"map"
>
UPDATE jl_key_dm_org
SET
is_used = 0,
update_by = #{_user.id},
update_time = NOW()
WHERE id = #{id}
</update>
<!-- 清除部门用户分配 -->
<update
id=
"clearOrgUsers"
parameterType=
"map"
>
UPDATE jl_key_dm_user
SET
belong_org_id = NULL,
belong_org_code = NULL,
belong_org_name = NULL,
update_by = #{_user.id},
update_time = NOW()
WHERE belong_org_id = #{belong_org_id}
AND office_id in (select id from sys_office where id = #{area_id} or parent_ids like #{parent_ids})
</update>
<!-- 分配用户到部门 -->
<update
id=
"assignUserToOrg"
parameterType=
"map"
>
UPDATE jl_key_dm_user
SET
belong_org_id = #{belong_org_id},
belong_org_code = (SELECT org_code FROM jl_key_dm_org WHERE id = #{belong_org_id}),
belong_org_name = (SELECT org_name FROM jl_key_dm_org WHERE id = #{belong_org_id}),
update_by = #{_user.id},
update_time = NOW()
WHERE id = #{user_id}
</update>
</mapper>
src/main/resources/mybatis/mappers/standard/jilinsscgsdp/KeyDmUserDao.xml
View file @
bb3880d1
...
...
@@ -30,16 +30,12 @@
LEFT JOIN sys_office o ON o.id = u.office_id
<where>
AND u.is_used = 1
AND (o.parent_ids LIKE CONCAT(#{params.parentIds}, '%') OR u.office_id = #{params._user.company_id})
<if
test=
"params.name != null and params.name != ''"
>
AND u.name LIKE CONCAT('%', #{params.name}, '%')
</if>
<if
test=
"params._user.company_id != null and params._user.company_id != ''"
>
AND o.parent_ids LIKE CONCAT('%', #{params._user.company_id}, '%')
</if>
</where>
ORDER BY u.order_no ASC, u.create_time DESC
ORDER BY o.grade,o.sort,u.order_no ASC, u.create_time DESC
</select>
<select
id=
"selectUserLeaderById"
parameterType=
"page"
resultType=
"map"
>
...
...
@@ -120,7 +116,7 @@
FROM sys_user su
WHERE su.office_id IN (
SELECT so.id FROM sys_office so
WHERE so.parent_ids LIKE CONCAT(
'%', #{_user.company_id}, '%') OR so.code
= #{_user.company_id}
WHERE so.parent_ids LIKE CONCAT(
#{parentIds}, '%') OR so.id
= #{_user.company_id}
)
AND (su.del_flag IS NULL OR su.del_flag = '0')
</select>
...
...
@@ -186,35 +182,21 @@
u.email,
u.phone,
u.mobile,
o.name AS office_name,
GROUP_CONCAT(DISTINCT c.catgory_name SEPARATOR ', ') AS category_names
o.name AS office_name
FROM jl_key_dm_user u
LEFT JOIN sys_office o ON o.id = u.office_id
LEFT JOIN jl_key_dm_user_catgory c ON FIND_IN_SET(c.id, u.rc_role_id) > 0
<where>
AND u.is_used = 1
AND u.is_leave = 0
<if
test=
"params.office_code != null and params.office_code != ''"
>
AND u.office_id IN (
SELECT so.id FROM sys_office so
WHERE so.parent_ids LIKE CONCAT('%', #{params.office_code}, '%')
OR so.code = #{params.office_code}
)
</if>
AND u.is_used = 1 AND u.is_leave = 0 AND o.del_flag = 0
AND (o.id = #{params.parentId} or o.area_id = #{params.areaId})
<if
test=
"params.permission != null and params.permission != ''"
>
AND EXISTS (
SELECT 1 FROM jl_key_dm_user_qx qx
WHERE qx.catgory_id = c.id
AND qx.permission_mark = #{params.permission}
AND qx.is_used = 1
)
AND u.id in (select id from jl_key_dm_permission_user where permission_code = #{params.permission})
</if>
<if
test=
"params.name != null and params.name != ''"
>
AND u.name LIKE CONCAT('%', #{params.name}, '%')
</if>
</where>
GROUP BY u.id, u.name, u.gh, u.email, u.phone, u.mobile, o.name
ORDER BY u.name ASC
ORDER BY
o.grade, o.sort,
u.name ASC
</select>
<!-- 人员多选器列表查询(所有在职人员) -->
...
...
@@ -233,16 +215,18 @@
<where>
AND u.is_used = 1
AND IFNULL(u.is_leave, 0) = 0
<if
test=
"params.round == '1'.toString()"
>
AND (u.office_id = #{params.parentId} or o.area_id = #{params.areaId} or o.parent_ids LIKE CONCAT(#{params.parentIds}, '%') )
</if>
<if
test=
"params.round == '2'.toString()"
>
AND o.area_id = #{params.areaId}
</if>
<if
test=
"params.name != null and params.name != ''"
>
AND u.name LIKE CONCAT('%', #{params.name}, '%')
</if>
<if
test=
"params.orgId != null and params.orgId != ''"
>
AND (o.office_id = #{params.orgId} or o.parent_id = #{params.orgId})
</if>
<if
test=
"params.pcode != null and params.pcode != ''"
>
AND NOT EXISTS (SELECT id from jl_key_dm_permission_user where u.id=user_id is null and permission_code=#{params.p
arams.p
code})
AND NOT EXISTS (SELECT id from jl_key_dm_permission_user where u.id=user_id is null and permission_code=#{params.pcode})
</if>
</where>
ORDER BY o.grade, o.sort
</select>
...
...
@@ -254,6 +238,14 @@
from jl_key_dm_user
where is_used = 1
</select>
</mapper>
<!-- 获取日常人员 -->
<select
id=
"selectDmUserByOfficeCode"
parameterType=
"map"
resultType=
"map"
>
SELECT du.*
FROM jl_key_dm_user du
WHERE du.office_id IN (
SELECT so.id FROM sys_office so
WHERE so.parent_ids LIKE CONCAT(#{parentIds}, '%') OR so.id = #{_user.company_id}
)
</select></mapper>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论