update
This commit is contained in:
@@ -92,7 +92,6 @@
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.4.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.coolstore:coolstore-base:1.5.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:3.6.1" level="project" />
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.dto.enterprise.EnterpriseUserDTO;
|
||||
import com.cool.store.entity.EnterpriseUserDO;
|
||||
import com.cool.store.mapper.EnterpriseUserMapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -48,4 +51,47 @@ public class EnterpriseUserDAO {
|
||||
}
|
||||
enterpriseUserMapper.batchUpdateDiffUserDiffRegionIds(enterpriseId, enterpriseUserList);
|
||||
}
|
||||
|
||||
public List<EnterpriseUserDO> fuzzyUsersByDepartment(String eid,
|
||||
String deptId,
|
||||
Long roleId,
|
||||
String orderBy,
|
||||
String orderRule,
|
||||
String userName,
|
||||
String jobnumber,
|
||||
Integer userStatus,
|
||||
List<String> userIdList,
|
||||
String regionId){
|
||||
return enterpriseUserMapper.fuzzyUsersByDepartment(eid, deptId, roleId, orderBy, orderRule, userName, jobnumber, userStatus, userIdList, regionId);
|
||||
}
|
||||
|
||||
public List<EnterpriseUserDO> fuzzyUsersByNotRole(String eid,
|
||||
String deptId,
|
||||
String orderBy,
|
||||
String orderRule,
|
||||
String userName,
|
||||
String jobnumber,
|
||||
Integer userStatus,
|
||||
List<String> userIdList,
|
||||
String regionId){
|
||||
return enterpriseUserMapper.fuzzyUsersByNotRole(eid, deptId, orderBy, orderRule, userName, jobnumber, userStatus, userIdList, regionId);
|
||||
}
|
||||
|
||||
public List<EnterpriseUserDO> selectUsersByUserIds(String eid, List<String> userIds) {
|
||||
return enterpriseUserMapper.selectUsersByUserIds(eid, userIds);
|
||||
}
|
||||
|
||||
public List<EnterpriseUserDO> listUserByGroupId(String eid, String groupId, String userName, List<String> userIdList){
|
||||
if(StringUtils.isAnyBlank(eid, groupId)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return enterpriseUserMapper.listUserByGroupId(eid, groupId, userName, userIdList);
|
||||
}
|
||||
|
||||
public List<EnterpriseUserDO> listByRegionIdList(String eid, List<String> regionIdList){
|
||||
if(StringUtils.isBlank(eid) || CollectionUtils.isEmpty(regionIdList)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return enterpriseUserMapper.listByRegionIdList(eid, regionIdList);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.EnterpriseUserGroupDO;
|
||||
import com.cool.store.mapper.EnterpriseUserGroupMapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户分组
|
||||
* @author wxp
|
||||
* @date 2022-12-29 14:56
|
||||
*/
|
||||
@Repository
|
||||
public class EnterpriseUserGroupDAO {
|
||||
|
||||
@Resource
|
||||
private EnterpriseUserGroupMapper enterpriseUserGroupMapper;
|
||||
|
||||
public int insertSelective(EnterpriseUserGroupDO record, String enterpriseId){
|
||||
return enterpriseUserGroupMapper.insertSelective(record,enterpriseId);
|
||||
}
|
||||
|
||||
public int updateByPrimaryKeySelective(EnterpriseUserGroupDO record, String enterpriseId){
|
||||
return enterpriseUserGroupMapper.updateByPrimaryKeySelective(record,enterpriseId);
|
||||
}
|
||||
|
||||
public int updateByGroupId(EnterpriseUserGroupDO record, String enterpriseId){
|
||||
return enterpriseUserGroupMapper.updateByGroupId(record,enterpriseId);
|
||||
}
|
||||
|
||||
public int countByGroupName(String enterpriseId, String groupName, String groupId){
|
||||
return enterpriseUserGroupMapper.countByGroupName(enterpriseId, groupName, groupId);
|
||||
}
|
||||
|
||||
public void deleteByGroupIdList(String enterpriseId, List<String> groupIdList) {
|
||||
if(StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(groupIdList)) {
|
||||
return;
|
||||
}
|
||||
enterpriseUserGroupMapper.deleteByGroupIdList(enterpriseId, groupIdList);
|
||||
}
|
||||
|
||||
public List<EnterpriseUserGroupDO> listUserGroup(String enterpriseId, String groupName){
|
||||
return enterpriseUserGroupMapper.listUserGroup(enterpriseId, groupName);
|
||||
}
|
||||
|
||||
public EnterpriseUserGroupDO getByGroupId(String enterpriseId, String groupId){
|
||||
return enterpriseUserGroupMapper.getByGroupId(enterpriseId, groupId);
|
||||
}
|
||||
|
||||
public List<EnterpriseUserGroupDO> listByGroupIdList(String enterpriseId, List<String> groupIdList){
|
||||
if (StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(groupIdList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return enterpriseUserGroupMapper.listByGroupIdList(enterpriseId, groupIdList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.EnterpriseUserGroupMappingDO;
|
||||
import com.cool.store.mapper.EnterpriseUserGroupMappingMapper;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户分组映射
|
||||
* @author wxp
|
||||
* @date 2022-12-29 14:56
|
||||
*/
|
||||
@Repository
|
||||
public class EnterpriseUserGroupMappingDAO {
|
||||
|
||||
@Resource
|
||||
private EnterpriseUserGroupMappingMapper enterpriseUserGroupMappingMapper;
|
||||
|
||||
public void deleteUserGroupMappingByGroupId(String enterpriseId, String groupId) {
|
||||
if (StringUtils.isBlank(enterpriseId) || StringUtils.isBlank(groupId)) {
|
||||
return;
|
||||
}
|
||||
enterpriseUserGroupMappingMapper.deleteUserGroupMappingByGroupId(enterpriseId, groupId);
|
||||
}
|
||||
|
||||
public void batchInsertMapping(String enterpriseId, List<String> userIdList, String groupId) {
|
||||
if (StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(userIdList) || StringUtils.isBlank(groupId)) {
|
||||
return;
|
||||
}
|
||||
enterpriseUserGroupMappingMapper.batchInsertMapping(enterpriseId, userIdList, groupId);
|
||||
}
|
||||
|
||||
public void deleteMappingByGroupIdList(String enterpriseId, String groupId, List<String> userIdList) {
|
||||
if(StringUtils.isBlank(enterpriseId) || StringUtils.isBlank(groupId)) {
|
||||
return;
|
||||
}
|
||||
enterpriseUserGroupMappingMapper.deleteMappingByGroupIdList(enterpriseId, groupId, userIdList);
|
||||
}
|
||||
|
||||
public void deleteMappingByUserIdList(String enterpriseId, List<String> userIdList) {
|
||||
if(StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(userIdList)) {
|
||||
return;
|
||||
}
|
||||
enterpriseUserGroupMappingMapper.deleteMappingByUserIdList(enterpriseId, userIdList);
|
||||
}
|
||||
|
||||
|
||||
public List<EnterpriseUserGroupMappingDO> listByGroupIdList(String enterpriseId, List<String> groupIdList){
|
||||
return enterpriseUserGroupMappingMapper.listByGroupIdList(enterpriseId, groupIdList);
|
||||
}
|
||||
|
||||
public List<EnterpriseUserGroupMappingDO> listByUserIdList(String enterpriseId, List<String> userIdList){
|
||||
if (StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(userIdList)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return enterpriseUserGroupMappingMapper.listByUserIdList(enterpriseId, userIdList);
|
||||
}
|
||||
|
||||
public void batchInsertOrUpdateUserGroupMapping(String enterpriseId, List<EnterpriseUserGroupMappingDO> userGroupMappingDOList) {
|
||||
if (CollectionUtils.isEmpty(userGroupMappingDOList)) {
|
||||
return;
|
||||
}
|
||||
enterpriseUserGroupMappingMapper.batchInsertOrUpdateUserGroupMapping(enterpriseId, userGroupMappingDOList);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,8 +1,15 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.dto.buser.UserRoleDTO;
|
||||
import com.cool.store.dto.enterprise.EnterpriseUserRole;
|
||||
import com.cool.store.entity.SysRoleDO;
|
||||
import com.cool.store.enums.RoleEnum;
|
||||
import com.cool.store.mapper.EnterpriseUserMapper;
|
||||
import com.cool.store.mapper.EnterpriseUserRoleMapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -22,4 +29,21 @@ public class EnterpriseUserRoleDAO {
|
||||
return enterpriseUserRoleMapper.insertBatchUserRole(eid, userRole);
|
||||
}
|
||||
|
||||
public List<UserRoleDTO> getUserAndRolesByUserId(String enterpriseId, List<String> userIdList){
|
||||
if(StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(userIdList)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return enterpriseUserRoleMapper.getUserAndRolesByUserId(enterpriseId, userIdList);
|
||||
}
|
||||
|
||||
public Boolean checkIsAdmin(String enterpriseId, String userId) {
|
||||
// 1.取出所有用户角色
|
||||
// 2.匹配是否有管理员角色
|
||||
List<SysRoleDO> sysRoleDOList = enterpriseUserRoleMapper.listRoleByUserId(enterpriseId, userId);
|
||||
return ListUtils.emptyIfNull(sysRoleDOList)
|
||||
.stream()
|
||||
.anyMatch(role-> StringUtils.equals(RoleEnum.MASTER.getRoleEnum(),role.getRoleEnum()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,11 +1,15 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dto.region.RegionPathDTO;
|
||||
import com.cool.store.entity.RegionDO;
|
||||
import com.cool.store.enums.RegionTypeEnum;
|
||||
import com.cool.store.mapper.RegionMapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -71,4 +75,33 @@ public class RegionDAO {
|
||||
.stream()
|
||||
.collect(Collectors.toMap(RegionDO::getSynDingDeptId, RegionDO::getId, (r, e) -> r));
|
||||
}
|
||||
|
||||
public List<RegionDO> getAllRegion(String eid){
|
||||
if(StringUtils.isBlank(eid)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return regionMapper.getAllRegion(eid);
|
||||
}
|
||||
|
||||
public List<RegionDO> listStoreRegionByIds(String enterpriseId, List<Long> regionIds){
|
||||
if(StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(regionIds)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return regionMapper.listStoreRegionByIds(enterpriseId, regionIds);
|
||||
}
|
||||
|
||||
public List<RegionPathDTO> getRegionPathByList(String eid, List<String> regionIds) {
|
||||
List<RegionDO> regionList = regionMapper.getRegionByRegionIds(eid, regionIds);
|
||||
return ListUtils.emptyIfNull(regionList)
|
||||
.stream()
|
||||
.map(data->{
|
||||
RegionPathDTO regionPathDTO =new RegionPathDTO();
|
||||
regionPathDTO.setRegionId(data.getRegionId());
|
||||
regionPathDTO.setRegionPath(data.getFullRegionPath());
|
||||
regionPathDTO.setRegionName(data.getName());
|
||||
regionPathDTO.setStoreNum(data.getStoreNum() == null? 0 : data.getStoreNum());
|
||||
regionPathDTO.setRegionType(data.getRegionType());
|
||||
return regionPathDTO;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.dto.store.StoreAreaDTO;
|
||||
import com.cool.store.entity.StoreDO;
|
||||
import com.cool.store.mapper.StoreMapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: StoreDAO
|
||||
* @Description:
|
||||
* @date 2023-05-31 11:52
|
||||
*/
|
||||
@Service
|
||||
public class StoreDAO {
|
||||
|
||||
@Resource
|
||||
private StoreMapper storeMapper;
|
||||
|
||||
public List<StoreAreaDTO> listStoreByRegionIdList(String eid, List<String> regionIdList) {
|
||||
if(StringUtils.isBlank(eid) || CollectionUtils.isEmpty(regionIdList)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return storeMapper.listStoreByRegionIdList(eid, regionIdList);
|
||||
}
|
||||
|
||||
public List<StoreDO> getStoreListByStoreIds(String enterpriseId, List<String> storeIdList){
|
||||
if(StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(storeIdList)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return storeMapper.getStoreListByStoreIds(enterpriseId, storeIdList);
|
||||
}
|
||||
|
||||
public List<StoreAreaDTO> listStoreByRegionIdListNotChild(String eid, List<String> regionIdList) {
|
||||
if(StringUtils.isBlank(eid) || CollectionUtils.isEmpty(regionIdList)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return storeMapper.listStoreByRegionIdListNotChild(eid, regionIdList);
|
||||
}
|
||||
|
||||
public Integer getStoreCount(String enterpriseId){
|
||||
return storeMapper.countStore(enterpriseId);
|
||||
}
|
||||
|
||||
public List<String> getAllStoreList (String eid,Boolean isReturnList){
|
||||
List<String> invalidStores=new ArrayList<>();
|
||||
if(isReturnList){
|
||||
return storeMapper.listStoreIdList(eid);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.SubordinateMappingDO;
|
||||
import com.cool.store.mapper.SubordinateMappingMapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: SubordinateMappingDAO
|
||||
* @Description:
|
||||
* @date 2023-05-31 14:27
|
||||
*/
|
||||
@Service
|
||||
public class SubordinateMappingDAO {
|
||||
|
||||
@Resource
|
||||
private SubordinateMappingMapper subordinateMappingMapper;
|
||||
|
||||
public List<SubordinateMappingDO> selectByUserIds(String enterpriseId, List<String> userIds){
|
||||
if (StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(userIds)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return subordinateMappingMapper.selectByUserIds(enterpriseId,userIds);
|
||||
}
|
||||
|
||||
public void batchInsertSubordinateMapping(String enterpriseId, List<SubordinateMappingDO> subordinateMappingDOS) {
|
||||
if (CollectionUtils.isEmpty(subordinateMappingDOS)) {
|
||||
return;
|
||||
}
|
||||
List<SubordinateMappingDO> distinctData = subordinateMappingDOS.stream()
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
subordinateMappingMapper.batchInsertSubordinateMapping(enterpriseId, distinctData);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,15 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.UserAuthMappingDO;
|
||||
import com.cool.store.mapper.UserAuthMappingMapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 02:54
|
||||
@@ -9,4 +17,21 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class UserAuthMappingDAO {
|
||||
|
||||
@Resource
|
||||
private UserAuthMappingMapper userAuthMappingMapper;
|
||||
|
||||
|
||||
public List<UserAuthMappingDO> listUserAuthMappingByUserId(String eid, String userId){
|
||||
if(StringUtils.isAnyBlank(eid, userId)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return userAuthMappingMapper.listUserAuthMappingByUserId(eid, userId);
|
||||
}
|
||||
|
||||
public List<UserAuthMappingDO> listUserAuthMappingByUserIds(String eid, List<String> userIds){
|
||||
if(StringUtils.isBlank(eid) || CollectionUtils.isEmpty(userIds)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return userAuthMappingMapper.listUserAuthMappingByUserIds(eid, userIds);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.enterprise.EnterpriseUserDTO;
|
||||
import com.cool.store.entity.EnterpriseUserDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -48,4 +49,41 @@ public interface EnterpriseUserMapper {
|
||||
*/
|
||||
Boolean batchUpdateDiffUserDiffRegionIds(@Param("eid") String eid, @Param("list") List<EnterpriseUserDO> enterpriseUserDOList);
|
||||
|
||||
List<EnterpriseUserDO> fuzzyUsersByDepartment(@Param("eid") String eid,
|
||||
@Param("deptId") String deptId,
|
||||
@Param("roleId") Long roleId,
|
||||
@Param("orderBy") String orderBy,
|
||||
@Param("orderRule") String orderRule,
|
||||
@Param("userName") String userName,
|
||||
@Param("jobNumber") String jobnumber,
|
||||
@Param("userStatus") Integer userStatus,
|
||||
@Param("userIdList") List<String> userIdList,
|
||||
@Param("regionId") String regionId);
|
||||
|
||||
List<EnterpriseUserDO> fuzzyUsersByNotRole(@Param("eid") String eid,
|
||||
@Param("deptId") String deptId,
|
||||
@Param("orderBy") String orderBy,
|
||||
@Param("orderRule") String orderRule,
|
||||
@Param("userName") String userName,
|
||||
@Param("jobNumber") String jobnumber,
|
||||
@Param("userStatus") Integer userStatus,
|
||||
@Param("userIdList") List<String> userIdList,
|
||||
@Param("regionId") String regionId);
|
||||
|
||||
/**
|
||||
* 根据用户id数组获取用户
|
||||
* @param eid
|
||||
* @param userIds
|
||||
* @return
|
||||
*/
|
||||
List<EnterpriseUserDO> selectUsersByUserIds(@Param("eid") String eid, @Param("userIds") List<String> userIds);
|
||||
|
||||
|
||||
List<EnterpriseUserDO> listUserByGroupId(@Param("eid") String eid,
|
||||
@Param("groupId") String groupId,
|
||||
@Param("userName") String userName,
|
||||
@Param("userIdList") List<String> userIdList);
|
||||
|
||||
List<EnterpriseUserDO> listByRegionIdList(@Param("eid") String eid, @Param("regionIdList") List<String> regionIdList);
|
||||
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.buser.UserRoleDTO;
|
||||
import com.cool.store.dto.enterprise.EnterpriseUserRole;
|
||||
import com.cool.store.entity.EnterpriseUserRoleDO;
|
||||
import com.cool.store.entity.SysRoleDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@@ -33,4 +35,8 @@ public interface EnterpriseUserRoleMapper {
|
||||
* @return
|
||||
*/
|
||||
Boolean insertBatchUserRole(@Param("eid") String enterpriseId, @Param("userRoles") List<EnterpriseUserRole> userRoles);
|
||||
|
||||
List<UserRoleDTO> getUserAndRolesByUserId(@Param("eip") String enterpriseId, @Param("userIdList") List<String> userIdList);
|
||||
|
||||
List<SysRoleDO> listRoleByUserId(@Param("eip") String enterpriseId, @Param("userId") String userId);
|
||||
}
|
||||
@@ -37,4 +37,8 @@ public interface RegionMapper {
|
||||
Integer batchInsertRegionsByDepartments(@Param("eid") String eid, @Param("regions") List<RegionDO> regions);
|
||||
|
||||
List<RegionDO> selectRegionBySynDingDeptIds(@Param("eid") String eid, @Param("synDingDeptIds") List<String> synDingDeptIds);
|
||||
|
||||
List<RegionDO> getAllRegion(@Param("eid") String eid);
|
||||
|
||||
List<RegionDO> listStoreRegionByIds(@Param("eid")String enterpriseId, @Param("regionIds")List<Long> regionIds);
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.cool.store.mapper;
|
||||
import com.cool.store.entity.UserAuthMappingDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 02:54
|
||||
@@ -22,4 +24,9 @@ public interface UserAuthMappingMapper {
|
||||
* dateTime:2023-05-19 02:54
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") UserAuthMappingDO record, @Param("enterpriseId") String enterpriseId);
|
||||
|
||||
List<UserAuthMappingDO> listUserAuthMappingByUserId(@Param("eid") String eid, @Param("userId") String userId);
|
||||
|
||||
List<UserAuthMappingDO> listUserAuthMappingByUserIds(@Param("eid") String eid,
|
||||
@Param("userIds") List<String> userIds);
|
||||
}
|
||||
@@ -468,7 +468,6 @@
|
||||
jobnumber=values(jobnumber)
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="batchUpdateDiffUserDiffRegionIds">
|
||||
update enterprise_user_${eid}
|
||||
set user_region_ids =
|
||||
@@ -480,4 +479,195 @@
|
||||
#{item.userId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="fuzzyUsersByDepartment" resultType="com.cool.store.entity.EnterpriseUserDO">
|
||||
select
|
||||
u.user_id as userId,
|
||||
u.name as name,
|
||||
u.roles as roles,
|
||||
u.jobnumber as jobnumber,
|
||||
u.remark as remark,
|
||||
u.mobile as mobile,
|
||||
u.email as email,
|
||||
u.org_email as orgEmail,
|
||||
u.avatar as avatar,
|
||||
u.user_status as userStatus,
|
||||
u.unionid as unionid
|
||||
from enterprise_user_${eid} u
|
||||
left join enterprise_user_role_${eid} ul on u.user_id=ul.user_id
|
||||
left join sys_role_${eid} r on ul.role_id=r.id
|
||||
<where>
|
||||
u.active = true and u.user_id != 'a100000001'
|
||||
<if test="deptId !=null and deptId !=''">
|
||||
and u.departments like concat('%/',#{deptId},'/%')
|
||||
</if>
|
||||
<if test="userName !=null and userName !=''">
|
||||
and u.name like concat('%',#{userName},'%')
|
||||
</if>
|
||||
<if test="jobNumber !=null and jobNumber !=''">
|
||||
and u.jobnumber = #{jobNumber}
|
||||
</if>
|
||||
<if test="roleId !=null ">
|
||||
and r.id=#{roleId}
|
||||
</if>
|
||||
<if test="userStatus !=null ">
|
||||
and u.user_status=#{userStatus}
|
||||
</if>
|
||||
<if test="regionId !=null and regionId !=''">
|
||||
and user_region_ids like concat('%/',#{regionId},'/%')
|
||||
</if>
|
||||
<if test="userIdList != null and userIdList.size > 0">
|
||||
and u.user_id in
|
||||
<foreach collection="userIdList" item="userId" separator="," open="(" close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY u.user_id
|
||||
<if test="orderBy != null and orderBy != '' ">
|
||||
order by u.${orderBy} ${orderRule}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="fuzzyUsersByNotRole" resultType="com.cool.store.entity.EnterpriseUserDO">
|
||||
select
|
||||
user_id as userId,
|
||||
name as name,
|
||||
jobnumber as jobnumber,
|
||||
remark as remark,
|
||||
mobile as mobile,
|
||||
email as email,
|
||||
org_email as orgEmail,
|
||||
avatar as avatar,
|
||||
roles as roles,
|
||||
departments as departments,
|
||||
user_status as userStatus,
|
||||
unionid
|
||||
from enterprise_user_${eid}
|
||||
<where>
|
||||
active = true and user_id != 'a100000001'
|
||||
<if test="deptId !=null and deptId !=''">
|
||||
and departments like concat('%/',#{deptId},'/%')
|
||||
</if>
|
||||
<if test="userName !=null and userName !=''">
|
||||
and name like concat('%',#{userName},'%')
|
||||
</if>
|
||||
<if test="jobNumber !=null and jobNumber !=''">
|
||||
and jobnumber = #{jobNumber}
|
||||
</if>
|
||||
<if test="userStatus !=null">
|
||||
and user_status = #{userStatus}
|
||||
</if>
|
||||
<if test="regionId !=null and regionId !=''">
|
||||
and user_region_ids like concat('%/',#{regionId},'/%')
|
||||
</if>
|
||||
<if test="userIdList != null and userIdList.size > 0">
|
||||
and user_id in
|
||||
<foreach collection="userIdList" item="userId" separator="," open="(" close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
</where>
|
||||
ORDER BY user_id
|
||||
<if test="orderBy != null and orderBy != '' ">
|
||||
, ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectUsersByUserIds" resultType="com.cool.store.entity.EnterpriseUserDO">
|
||||
select
|
||||
id,
|
||||
user_id as userId,
|
||||
`name` as name,
|
||||
avatar,
|
||||
active,
|
||||
mobile,
|
||||
jobnumber,
|
||||
`language`,
|
||||
user_status as userStatus,
|
||||
subordinate_range as subordinateRange
|
||||
from enterprise_user_${eid}
|
||||
<where>
|
||||
user_id != 'a100000001'
|
||||
and
|
||||
<if test="userIds.size()>0 and userIds!=null">or
|
||||
user_id in
|
||||
<foreach
|
||||
collection="userIds" item="userId" separator="," open="(" close=")">
|
||||
#{userId, jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="listUserByGroupId" resultType="com.cool.store.entity.EnterpriseUserDO">
|
||||
select
|
||||
u.user_id as userId,
|
||||
u.name as name,
|
||||
u.roles as roles,
|
||||
u.jobnumber as jobnumber,
|
||||
u.mobile as mobile,
|
||||
u.email as email,
|
||||
u.org_email as orgEmail,
|
||||
u.avatar as avatar,
|
||||
u.departments as departments,
|
||||
u.user_status as userStatus,
|
||||
u.unionid as unionid
|
||||
from enterprise_user_${eid} u
|
||||
left join enterprise_user_group_mapping_${eid} ug on u.user_id=ug.user_id
|
||||
<where>
|
||||
ug.group_id = #{groupId} and u.active = true and u.user_id != 'a100000001'
|
||||
<if test="userName !=null and userName !=''">
|
||||
and u.name like concat('%',#{userName},'%')
|
||||
</if>
|
||||
<if test="userIdList != null and userIdList.size > 0">
|
||||
and u.user_id in
|
||||
<foreach collection="userIdList" item="userId" separator="," open="(" close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY u.user_id
|
||||
</select>
|
||||
|
||||
<select id="listByRegionIdList" resultType="com.cool.store.entity.EnterpriseUserDO">
|
||||
select
|
||||
id as id,
|
||||
user_id as userId,
|
||||
`name` as name,
|
||||
tel as tel,
|
||||
work_place as workPlace,
|
||||
remark as remark,
|
||||
mobile as mobile,
|
||||
email as email,
|
||||
org_email as orgEmail,
|
||||
active as active,
|
||||
order_in_depts as orderInDepts,
|
||||
is_admin as isAdmin,
|
||||
is_boss as isBoss,
|
||||
dingId as dingId,
|
||||
unionid as unionid,
|
||||
is_leader_in_depts as isLeaderInDepts,
|
||||
is_hide as isHide,
|
||||
`position` as position,
|
||||
avatar as avatar,
|
||||
jobnumber as jobnumber,
|
||||
extattr as extattr,
|
||||
is_enterprise as isEnterprise,
|
||||
roles as roles,
|
||||
monitored_departments as monitoredDepartments,
|
||||
departments as departments,
|
||||
is_leader as isLeader,
|
||||
face_url as faceUrl,
|
||||
create_time as createTime,
|
||||
`language` as language
|
||||
from enterprise_user_${eid} where user_id != 'a100000001'
|
||||
<foreach collection="regionIdList" item="regionId" separator=" or " open="and (" close=" )">
|
||||
user_region_ids like concat('%/', #{regionId}, '/%')
|
||||
</foreach>
|
||||
order by id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -69,4 +69,35 @@
|
||||
(#{userRole.roleId}, #{userRole.userId} ,#{userRole.createTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="getUserAndRolesByUserId" resultType="com.cool.store.dto.buser.UserRoleDTO">
|
||||
select
|
||||
a.role_id as roleId,
|
||||
a.user_id as userId,
|
||||
b.role_name as roleName,
|
||||
b.role_auth as roleAuth,
|
||||
b.role_enum as roleEnum,
|
||||
b.priority as priority
|
||||
from enterprise_user_role_${eip} a left join sys_role_${eip} b on a.role_id=b.id
|
||||
<where>
|
||||
<if test="userIdList != null and userIdList.size>0">
|
||||
<foreach collection="userIdList" item="userId" separator="," open="a.user_id in (" close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
AND b.role_name IS NOT NULL
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="listRoleByUserId" resultType="com.cool.store.entity.SysRoleDO">
|
||||
select
|
||||
c.id as id,
|
||||
c.role_name as roleName,
|
||||
c.role_auth as roleAuth,
|
||||
c.source as source,
|
||||
c.role_enum as roleEnum
|
||||
from enterprise_user_role_${eip} b
|
||||
left join sys_role_${eip} c on c.id = b.role_id
|
||||
where b.user_id = #{userId}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -9,7 +9,7 @@
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.model.entity.HyPartnerInterviewLogDO">
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.entity.HyPartnerInterviewLogDO">
|
||||
<result column="change_before_cpoy" jdbcType="LONGVARCHAR" property="changeBeforeCpoy" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="partner_id" jdbcType="BIGINT" property="partnerId" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.model.entity.HyPartnerTaskInfoLogDO">
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.entity.HyPartnerTaskInfoLogDO">
|
||||
<result column="field_copy" jdbcType="LONGVARCHAR" property="fieldCopy" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
|
||||
@@ -340,4 +340,49 @@
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="getAllRegion" resultType="com.cool.store.entity.RegionDO">
|
||||
select
|
||||
id ,
|
||||
id as regionId,
|
||||
name ,
|
||||
parent_id as parentId,
|
||||
group_id as groupId,
|
||||
create_time as createTime,
|
||||
create_name as createName,
|
||||
update_time as updateTime,
|
||||
update_name as updateName,
|
||||
syn_ding_dept_id as synDingDeptId,
|
||||
region_type as regionType,
|
||||
region_path as regionPath,
|
||||
deleted as deleted,
|
||||
third_dept_id as thirdDeptId
|
||||
from region_${eid}
|
||||
where deleted = 0 and id > 0
|
||||
and region_type != 'store'
|
||||
</select>
|
||||
|
||||
<select id="listStoreRegionByIds" resultType="com.cool.store.entity.RegionDO">
|
||||
select
|
||||
id ,
|
||||
region_id as regionId,
|
||||
name as name ,
|
||||
parent_id as parentId,
|
||||
group_id as groupId,
|
||||
create_time as createTime,
|
||||
create_name as createName,
|
||||
update_time as updateTime,
|
||||
update_name as updateName,
|
||||
syn_ding_dept_id as synDingDeptId,
|
||||
region_type as regionType,
|
||||
deleted as deleted,
|
||||
store_id as storeId
|
||||
from region_${eid}
|
||||
where region_type = 'store'
|
||||
and id in (
|
||||
<foreach collection="regionIds" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -100,4 +100,16 @@
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
|
||||
<select id="listUserAuthMappingByUserId" resultMap="BaseResultMap">
|
||||
select * from user_auth_mapping_${eid}
|
||||
where user_id=#{userId}
|
||||
</select>
|
||||
|
||||
<select id="listUserAuthMappingByUserIds" resultMap="BaseResultMap">
|
||||
select * from user_auth_mapping_${eid}
|
||||
<foreach collection="userIds" item="userId" open="user_id in (" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -3,4 +3,4 @@ jdbc.url = jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcoll
|
||||
jdbc.user= coolstore
|
||||
jdbc.password = CSCErYcXniNYm7bT
|
||||
|
||||
table.name = login_record_e88b6a2bc1334164b54977a4dbfe5d9d
|
||||
table.name = enterprise_user_group_mapping_e88b6a2bc1334164b54977a4dbfe5d9d
|
||||
Reference in New Issue
Block a user