Browse Source

chore: cas decoupling view

master
wangxiang 2 years ago
parent
commit
85724e2743
No known key found for this signature in database
GPG Key ID: 1BA7946AB6B232E4
  1. 6
      kicc-platform/kicc-platform-api/kicc-workflow-api/src/main/java/com/cloud/kicc/workflow/api/constant/SqlConstants.java
  2. 4
      kicc-platform/kicc-platform-biz/kicc-common-biz/src/main/resources/mapper/PushBlacklistMapper.xml
  3. 6
      kicc-platform/kicc-platform-biz/kicc-common-biz/src/main/resources/mapper/PushConcernFanMapper.xml
  4. 4
      kicc-platform/kicc-platform-biz/kicc-system-biz/src/main/resources/mapper/SsoUserMapper.xml
  5. 176
      kicc-platform/kicc-platform-biz/kicc-system-biz/src/main/resources/mapper/UserMapper.xml

6
kicc-platform/kicc-platform-api/kicc-workflow-api/src/main/java/com/cloud/kicc/workflow/api/constant/SqlConstants.java

@ -12,10 +12,10 @@ public interface SqlConstants { @@ -12,10 +12,10 @@ public interface SqlConstants {
String QUERY_ACT_HI_COMMENT= "select * from ACT_HI_COMMENT where TYPE_ like ? and TASK_ID_ = ? order by TIME_ desc";
String QUERY_USER_BY_ID = "select csu.id, csu.user_name userName, csu.nick_name nickName, csu.password, u.dept_id deptId, u.status from sys_user u join remote_cas_sso_user csu on u.cas_user_id = csu.id where csu.id = ?";
String QUERY_USER_BY_ID = "select csu.id, csu.user_name userName, csu.nick_name nickName, csu.password, u.dept_id deptId, u.status from sys_user u join cas_sso_user_view csu on u.cas_user_id = csu.id where csu.id = ?";
String QUERY_USER_BY_DEPT_ID = "select csu.id, csu.user_name userName, csu.nick_name nickName, csu.password, u.dept_id deptId, u.status from sys_user u join remote_cas_sso_user csu on u.cas_user_id = csu.id where u.dept_id = ?";
String QUERY_USER_BY_DEPT_ID = "select csu.id, csu.user_name userName, csu.nick_name nickName, csu.password, u.dept_id deptId, u.status from sys_user u join cas_sso_user_view csu on u.cas_user_id = csu.id where u.dept_id = ?";
String QUERY_USER_BY_ROLE_ID = "select distinct csu.id, csu.user_name userName, csu.nick_name nickName, csu.password, u.dept_id deptId, u.status from sys_user u join remote_cas_sso_user csu on u.cas_user_id = csu.id join sys_user_role b on csu.id = b.user_id where b.role_id = ?";
String QUERY_USER_BY_ROLE_ID = "select distinct csu.id, csu.user_name userName, csu.nick_name nickName, csu.password, u.dept_id deptId, u.status from sys_user u join cas_sso_user_view csu on u.cas_user_id = csu.id join sys_user_role b on csu.id = b.user_id where b.role_id = ?";
}

4
kicc-platform/kicc-platform-biz/kicc-common-biz/src/main/resources/mapper/PushBlacklistMapper.xml

@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
from
common_push_blacklist bl
join sys_user u on bl.fan_user_id = u.cas_user_id
join remote_cas_sso_user csu on u.cas_user_id = csu.id
join cas_sso_user_view csu on u.cas_user_id = csu.id
<where>
bl.del_flag = 0 AND u.del_flag = 0 AND u.status = 0 AND bl.concern_user_id = #{map.createById}
<if test="map.nickName != null and map.nickName != ''">
@ -70,7 +70,7 @@ @@ -70,7 +70,7 @@
from
common_push_blacklist bl
join sys_user u on bl.fan_user_id = u.cas_user_id
join remote_cas_sso_user csu on u.cas_user_id = csu.id
join cas_sso_user_view csu on u.cas_user_id = csu.id
<where>
bl.del_flag = 0 AND u.del_flag = 0 AND u.status = 0 AND
bl.concern_user_id = #{concernUserId} AND

6
kicc-platform/kicc-platform-biz/kicc-common-biz/src/main/resources/mapper/PushConcernFanMapper.xml

@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
cf.fan_user_id = u.cas_user_id
</otherwise>
</choose>
JOIN (SELECT * FROM remote_cas_sso_user WHERE del_flag = 0) csu ON u.cas_user_id = csu.id
JOIN (SELECT * FROM cas_sso_user_view WHERE del_flag = 0) csu ON u.cas_user_id = csu.id
<where>
cf.del_flag = 0
AND u.status = 0
@ -98,7 +98,7 @@ @@ -98,7 +98,7 @@
cf.fan_user_id = u.cas_user_id
</otherwise>
</choose>
JOIN (SELECT * FROM remote_cas_sso_user WHERE del_flag = 0) csu ON u.cas_user_id = csu.id
JOIN (SELECT * FROM cas_sso_user_view WHERE del_flag = 0) csu ON u.cas_user_id = csu.id
<where>
cf.del_flag = 0
AND u.status = 0
@ -156,7 +156,7 @@ @@ -156,7 +156,7 @@
ON u.cas_user_id = b.fan_user_id
</otherwise>
</choose>
JOIN (SELECT * FROM remote_cas_sso_user WHERE del_flag = 0) csu ON u.cas_user_id = csu.id
JOIN (SELECT * FROM cas_sso_user_view WHERE del_flag = 0) csu ON u.cas_user_id = csu.id
<where>
u.del_flag = 0
AND u.status = 0

4
kicc-platform/kicc-platform-biz/kicc-system-biz/src/main/resources/mapper/SsoUserMapper.xml

@ -4,8 +4,8 @@ @@ -4,8 +4,8 @@
<select id="selectBindSsoUserList" resultType="SsoUser">
select csu.*
from remote_cas_sso_user csu
left join sys_user u on csu.id = u.cas_user_id
from cas_sso_user_view csu
left join sys_user u on csu.id = u.cas_user_id
where u.cas_user_id is null;
</select>

176
kicc-platform/kicc-platform-biz/kicc-system-biz/src/main/resources/mapper/UserMapper.xml

@ -3,200 +3,76 @@ @@ -3,200 +3,76 @@
<mapper namespace="com.cloud.kicc.system.mapper.UserMapper">
<select id="getCourierUserList" resultType="com.cloud.kicc.common.data.entity.KiccUser">
select
u.id,
csu.id cas_user_id,
csu.user_name,
csu.nick_name,
csu.password,
csu.email,
csu.phone,
csu.sex,
csu.avatar,
csu.login_ip,
csu.login_time,
u.user_type,
u.dept_id,
u.dept_name,
u.status,
u.map_orientation,
u.map_center,
u.create_by_id,
u.create_by_name,
u.create_time,
u.update_by_id,
u.update_by_name,
u.update_time,
csu.remarks,
csu.tenant_id,
u.del_flag
from
sys_user u
inner join
remote_cas_sso_user csu
on u.cas_user_id = csu.id
select * from sso_enhanced_user_view
where
(select count(1) from common_map_logistic m where m.courier_user_id = csu.id) = 0
and u.del_flag = 0
and u.user_type = '3'
(select count(1) from common_map_logistic where courier_user_id = id) = 0
and del_flag = 0
and user_type = '3'
</select>
<select id="selectUserList" resultType="com.cloud.kicc.common.data.entity.KiccUser">
select
u.id,
csu.id cas_user_id,
csu.user_name,
csu.nick_name,
csu.password,
csu.email,
csu.phone,
csu.sex,
csu.avatar,
csu.login_ip,
csu.login_time,
u.user_type,
u.dept_id,
u.dept_name,
u.status,
u.map_orientation,
u.map_center,
u.create_by_id,
u.create_by_name,
u.create_time,
u.update_by_id,
u.update_by_name,
u.update_time,
csu.remarks,
csu.tenant_id,
u.del_flag
from
sys_user u
inner join
remote_cas_sso_user csu
on u.cas_user_id = csu.id
select * from sso_enhanced_user_view
<where>
u.del_flag = 0
del_flag = 0
<if test="param.userName != null and param.userName != ''">
and csu.user_name like concat('%', #{param.userName}, '%')
and user_name like concat('%', #{param.userName}, '%')
</if>
<if test="param.nickName != null and param.nickName != ''">
and csu.nick_name like concat('%', #{param.nickName}, '%')
and nick_name like concat('%', #{param.nickName}, '%')
</if>
<if test="param.deptId != null and param.deptId != ''">
and u.dept_id = #{param.deptId}
and dept_id = #{param.deptId}
</if>
<if test="param.id != null and param.id != ''">
and u.id = #{param.id}
and id = #{param.id}
</if>
<if test="param.casUserId != null and param.casUserId != ''">
and csu.id = #{param.casUserId}
and cas_user_id = #{param.casUserId}
</if>
<if test="param.userType != null and param.userType != ''">
and u.user_type = #{param.userType}
and user_type = #{param.userType}
</if>
<if test="(param.beginTime != null and param.beginTime != '') and (param.endTime != null and param.endTime != '')">
and u.create_time between #{param.beginTime} and #{param.endTime}
and create_time between #{param.beginTime} and #{param.endTime}
</if>
</where>
order by u.create_time asc
order by create_time asc
</select>
<select id="getUserByParam" resultType="com.cloud.kicc.common.data.entity.KiccUser">
select
u.id,
csu.id cas_user_id,
csu.user_name,
csu.nick_name,
csu.password,
csu.email,
csu.phone,
csu.sex,
csu.avatar,
csu.login_ip,
csu.login_time,
u.user_type,
u.dept_id,
u.dept_name,
u.status,
u.map_orientation,
u.map_center,
u.create_by_id,
u.create_by_name,
u.create_time,
u.update_by_id,
u.update_by_name,
u.update_time,
csu.remarks,
csu.tenant_id,
u.del_flag
from
sys_user u
inner join
remote_cas_sso_user csu
on u.cas_user_id = csu.id
select * from sso_enhanced_user_view
<where>
u.del_flag = 0
del_flag = 0
<if test="userName != null and userName != ''">
and csu.user_name = #{userName}
and user_name = #{userName}
</if>
<if test="nickName != null and nickName != ''">
and csu.nick_name = #{nickName}
and nick_name = #{nickName}
</if>
<if test="deptId != null and deptId != ''">
and u.dept_id = #{deptId}
and dept_id = #{deptId}
</if>
<if test="id != null and id != ''">
and u.id = #{id}
and id = #{id}
</if>
<if test="casUserId != null and casUserId != ''">
and csu.id = #{casUserId}
and cas_user_id = #{casUserId}
</if>
<if test="userType != null and userType != ''">
and u.user_type = #{userType}
and user_type = #{userType}
</if>
</where>
</select>
<select id="getUserByParamList" resultType="com.cloud.kicc.common.data.entity.KiccUser">
select
u.id,
csu.id cas_user_id,
csu.user_name,
csu.nick_name,
csu.password,
csu.email,
csu.phone,
csu.sex,
csu.avatar,
csu.login_ip,
csu.login_time,
u.user_type,
u.dept_id,
u.dept_name,
u.status,
u.map_orientation,
u.map_center,
u.create_by_id,
u.create_by_name,
u.create_time,
u.update_by_id,
u.update_by_name,
u.update_time,
csu.remarks,
csu.tenant_id,
u.del_flag
from
sys_user u
inner join
remote_cas_sso_user csu
on u.cas_user_id = csu.id
select * from sso_enhanced_user_view
<where>
u.del_flag = 0
del_flag = 0
<if test="phone != null and phone != ''">
and csu.phone = #{phone}
and phone = #{phone}
</if>
</where>
order by u.create_time asc
order by create_time asc
</select>
</mapper>

Loading…
Cancel
Save