This commit is contained in:
zhangchenbiao
2023-06-06 09:43:31 +08:00
parent 04e7ebea85
commit 7a78f59ad7
108 changed files with 511 additions and 4582 deletions

View File

@@ -21,11 +21,9 @@ public class EnterpriseConfigDAO {
private EnterpriseConfigMapper enterpriseConfigMapper; private EnterpriseConfigMapper enterpriseConfigMapper;
public EnterpriseConfigDO selectByEnterpriseId(String enterpriseId) { public EnterpriseConfigDO selectByEnterpriseId() {
if(StringUtils.isBlank(enterpriseId)){ //return enterpriseConfigMapper.selectByEnterpriseId(enterpriseId);
return null; return null;
}
return enterpriseConfigMapper.selectByEnterpriseId(enterpriseId);
} }
public EnterpriseConfigDO getDbInfoByDbName(String dbName) { public EnterpriseConfigDO getDbInfoByDbName(String dbName) {

View File

@@ -2,7 +2,6 @@ package com.cool.store.dao;
import com.cool.store.entity.EnterpriseDO; import com.cool.store.entity.EnterpriseDO;
import com.cool.store.mapper.EnterpriseMapper; import com.cool.store.mapper.EnterpriseMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import javax.annotation.Resource; import javax.annotation.Resource;
@@ -20,11 +19,9 @@ public class EnterpriseDAO {
private EnterpriseMapper enterpriseMapper; private EnterpriseMapper enterpriseMapper;
public EnterpriseDO getEnterpriseById(String enterpriseId){ public EnterpriseDO getEnterpriseById(){
if(StringUtils.isBlank(enterpriseId)){ //return enterpriseMapper.getEnterpriseById(enterpriseId);
return null; return null;
}
return enterpriseMapper.getEnterpriseById(enterpriseId);
} }
} }

View File

@@ -25,14 +25,14 @@ public class EnterpriseUserDAO {
private EnterpriseUserMapper enterpriseUserMapper; private EnterpriseUserMapper enterpriseUserMapper;
public EnterpriseUserDO getUserInfoById(String enterpriseId, String userId){ public EnterpriseUserDO getUserInfoById(String userId){
if(StringUtils.isAnyBlank(enterpriseId, userId)){ if(StringUtils.isAnyBlank(userId)){
return null; return null;
} }
return enterpriseUserMapper.getUserInfoById(enterpriseId, userId); return enterpriseUserMapper.getUserInfoById(userId);
} }
public void batchInsertOrUpdate(String eid, List<EnterpriseUserDO> users) { public void batchInsertOrUpdate(List<EnterpriseUserDO> users) {
List<EnterpriseUserDO> result = new ArrayList<>(); List<EnterpriseUserDO> result = new ArrayList<>();
users.forEach(user -> { users.forEach(user -> {
if (StringUtils.isBlank(user.getUnionid()) || StringUtils.isBlank(user.getUserId())) { if (StringUtils.isBlank(user.getUnionid()) || StringUtils.isBlank(user.getUserId())) {
@@ -43,17 +43,17 @@ public class EnterpriseUserDAO {
} }
result.add(user); result.add(user);
}); });
enterpriseUserMapper.batchInsertOrUpdate(eid, result); enterpriseUserMapper.batchInsertOrUpdate(result);
} }
public void batchUpdateDiffUserDiffRegionIds(String enterpriseId, List<EnterpriseUserDO> enterpriseUserList) { public void batchUpdateDiffUserDiffRegionIds(List<EnterpriseUserDO> enterpriseUserList) {
if(StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(enterpriseUserList)){ if(CollectionUtils.isEmpty(enterpriseUserList)){
return; return;
} }
enterpriseUserMapper.batchUpdateDiffUserDiffRegionIds(enterpriseId, enterpriseUserList); enterpriseUserMapper.batchUpdateDiffUserDiffRegionIds(enterpriseUserList);
} }
public List<EnterpriseUserDO> fuzzyUsersByDepartment(String eid, public List<EnterpriseUserDO> fuzzyUsersByDepartment(
String deptId, String deptId,
Long roleId, Long roleId,
String orderBy, String orderBy,
@@ -63,10 +63,10 @@ public class EnterpriseUserDAO {
Integer userStatus, Integer userStatus,
List<String> userIdList, List<String> userIdList,
String regionId){ String regionId){
return enterpriseUserMapper.fuzzyUsersByDepartment(eid, deptId, roleId, orderBy, orderRule, userName, jobnumber, userStatus, userIdList, regionId); return enterpriseUserMapper.fuzzyUsersByDepartment(deptId, roleId, orderBy, orderRule, userName, jobnumber, userStatus, userIdList, regionId);
} }
public List<EnterpriseUserDO> fuzzyUsersByNotRole(String eid, public List<EnterpriseUserDO> fuzzyUsersByNotRole(
String deptId, String deptId,
String orderBy, String orderBy,
String orderRule, String orderRule,
@@ -75,28 +75,28 @@ public class EnterpriseUserDAO {
Integer userStatus, Integer userStatus,
List<String> userIdList, List<String> userIdList,
String regionId){ String regionId){
return enterpriseUserMapper.fuzzyUsersByNotRole(eid, deptId, orderBy, orderRule, userName, jobnumber, userStatus, userIdList, regionId); return enterpriseUserMapper.fuzzyUsersByNotRole(deptId, orderBy, orderRule, userName, jobnumber, userStatus, userIdList, regionId);
} }
public List<EnterpriseUserDO> selectUsersByUserIds(String eid, List<String> userIds) { public List<EnterpriseUserDO> selectUsersByUserIds(List<String> userIds) {
return enterpriseUserMapper.selectUsersByUserIds(eid, userIds); return enterpriseUserMapper.selectUsersByUserIds(userIds);
} }
public List<EnterpriseUserDO> listUserByGroupId(String eid, String groupId, String userName, List<String> userIdList){ public List<EnterpriseUserDO> listUserByGroupId(String groupId, String userName, List<String> userIdList){
if(StringUtils.isAnyBlank(eid, groupId)){ if(StringUtils.isAnyBlank(groupId)){
return Lists.newArrayList(); return Lists.newArrayList();
} }
return enterpriseUserMapper.listUserByGroupId(eid, groupId, userName, userIdList); return enterpriseUserMapper.listUserByGroupId(groupId, userName, userIdList);
} }
public List<EnterpriseUserDO> listByRegionIdList(String eid, List<String> regionIdList){ public List<EnterpriseUserDO> listByRegionIdList(List<String> regionIdList){
if(StringUtils.isBlank(eid) || CollectionUtils.isEmpty(regionIdList)){ if(CollectionUtils.isEmpty(regionIdList)){
return Lists.newArrayList(); return Lists.newArrayList();
} }
return enterpriseUserMapper.listByRegionIdList(eid, regionIdList); return enterpriseUserMapper.listByRegionIdList(regionIdList);
} }
public Boolean insertEnterpriseUser(String eid, EnterpriseUserDO entity) { public Boolean insertEnterpriseUser(EnterpriseUserDO entity) {
if(Objects.isNull(entity.getUserStatus())){ if(Objects.isNull(entity.getUserStatus())){
entity.setUserStatus(UserStatusEnum.NORMAL.getCode()); entity.setUserStatus(UserStatusEnum.NORMAL.getCode());
} }
@@ -113,36 +113,30 @@ public class EnterpriseUserDAO {
if (StringUtils.isBlank(entity.getName())) { if (StringUtils.isBlank(entity.getName())) {
entity.setName(entity.getUserId()); entity.setName(entity.getUserId());
} }
enterpriseUserMapper.insertEnterpriseUser(eid, entity); enterpriseUserMapper.insertEnterpriseUser(entity);
return true; return true;
} }
public void updateEnterpriseUser(String eid,EnterpriseUserDO enterpriseUser){ public void updateEnterpriseUser(EnterpriseUserDO enterpriseUser){
if(StringUtils.isBlank(eid) || Objects.isNull(enterpriseUser)){ if(Objects.isNull(enterpriseUser)){
return; return;
} }
enterpriseUserMapper.updateEnterpriseUser(eid, enterpriseUser); enterpriseUserMapper.updateEnterpriseUser(enterpriseUser);
} }
public List<String> getMainAdminUserIds(String eid){ public List<String> getMainAdminUserIds(){
if(StringUtils.isBlank(eid)){ return enterpriseUserMapper.getMainAdminUserIds();
return Lists.newArrayList();
}
return enterpriseUserMapper.getMainAdminUserIds(eid);
} }
public List<String> selectSpecifyNodeUserIds(String eid, String dingDeptId) { public List<String> selectSpecifyNodeUserIds( String dingDeptId) {
return enterpriseUserMapper.selectSpecifyNodeUserIds(eid,dingDeptId); return enterpriseUserMapper.selectSpecifyNodeUserIds(dingDeptId);
} }
public List<String> selectAllUserId(String eid) { public List<String> selectAllUserId() {
if(StringUtils.isBlank(eid)){ return enterpriseUserMapper.selectAllUserIds();
return Lists.newArrayList();
}
return enterpriseUserMapper.selectAllUserIds(eid);
} }
public EnterpriseUserDO selectByUserIdIgnoreActive(String enterpriseId, String userId) { public EnterpriseUserDO selectByUserIdIgnoreActive(String userId) {
return enterpriseUserMapper.selectByUserIdIgnoreActive(enterpriseId, userId); return enterpriseUserMapper.selectByUserIdIgnoreActive(userId);
} }
} }

View File

@@ -1,61 +0,0 @@
package com.cool.store.dao;
import com.cool.store.entity.EnterpriseUserDepartmentDO;
import com.cool.store.mapper.EnterpriseUserDepartmentMapper;
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.Repository;
import javax.annotation.Resource;
import java.util.List;
/**
* @author zhangchenbiao
* @FileName: EnterpriseUserDepartmentDAO
* @Description:
* @date 2023-06-02 17:08
*/
@Repository
public class EnterpriseUserDepartmentDAO {
@Resource
private EnterpriseUserDepartmentMapper enterpriseUserDepartmentMapper;
public List<Integer> getIdsByUserId( String eid, String userId){
if(StringUtils.isAnyBlank(eid, userId)){
return Lists.newArrayList();
}
return enterpriseUserDepartmentMapper.getIdsByUserId(eid, userId);
}
public void deleteByIdList( String eid, @Param("list") List<Integer> ids){
if(StringUtils.isBlank(eid) || CollectionUtils.isEmpty(ids)){
return;
}
enterpriseUserDepartmentMapper.deleteByIdList(eid, ids);
}
public List<EnterpriseUserDepartmentDO> selectUserDeptByUserId(String eid, String userId){
if(StringUtils.isAnyBlank(eid, userId)){
return Lists.newArrayList();
}
return enterpriseUserDepartmentMapper.selectUserDeptByUserId(eid, userId);
}
public int batchInsert(String eid, List<EnterpriseUserDepartmentDO> deptUsers){
if(StringUtils.isBlank(eid) || CollectionUtils.isEmpty(deptUsers)){
return 0;
}
return enterpriseUserDepartmentMapper.batchInsert(eid, deptUsers);
}
public List<EnterpriseUserDepartmentDO> selectUserDeptAuthByUserId(String eid, String userId){
if(StringUtils.isAnyBlank(eid, userId)){
return Lists.newArrayList();
}
return enterpriseUserDepartmentMapper.selectUserDeptAuthByUserId(eid, userId);
}
}

View File

@@ -1,63 +0,0 @@
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);
}
}

View File

@@ -1,71 +0,0 @@
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);
}
}

View File

@@ -25,51 +25,52 @@ public class EnterpriseUserRoleDAO {
@Resource @Resource
private EnterpriseUserRoleMapper enterpriseUserRoleMapper; private EnterpriseUserRoleMapper enterpriseUserRoleMapper;
public Boolean insertBatchUserRole(String eid, List<EnterpriseUserRole> userRole) { public Boolean insertBatchUserRole(List<EnterpriseUserRole> userRole) {
return enterpriseUserRoleMapper.insertBatchUserRole(eid, userRole); return enterpriseUserRoleMapper.insertBatchUserRole(userRole);
} }
public List<UserRoleDTO> getUserAndRolesByUserId(String enterpriseId, List<String> userIdList){ public List<UserRoleDTO> getUserAndRolesByUserId(List<String> userIdList){
if(StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(userIdList)){ if(CollectionUtils.isEmpty(userIdList)){
return Lists.newArrayList(); return Lists.newArrayList();
} }
return enterpriseUserRoleMapper.getUserAndRolesByUserId(enterpriseId, userIdList); return enterpriseUserRoleMapper.getUserAndRolesByUserId(userIdList);
} }
public Boolean checkIsAdmin(String enterpriseId, String userId) { public Boolean checkIsAdmin(String userId) {
// 1.取出所有用户角色 // 1.取出所有用户角色
// 2.匹配是否有管理员角色 // 2.匹配是否有管理员角色
List<SysRoleDO> sysRoleDOList = enterpriseUserRoleMapper.listRoleByUserId(enterpriseId, userId); List<SysRoleDO> sysRoleDOList = enterpriseUserRoleMapper.listRoleByUserId(userId);
return ListUtils.emptyIfNull(sysRoleDOList) return ListUtils.emptyIfNull(sysRoleDOList)
.stream() .stream()
.anyMatch(role-> StringUtils.equals(RoleEnum.MASTER.getRoleEnum(),role.getRoleEnum())); .anyMatch(role-> StringUtils.equals(RoleEnum.MASTER.getRoleEnum(),role.getRoleEnum()));
} }
public void deleteBatchByPrimaryKey(String enterpriseId, List<Long> ids){ public void deleteBatchByPrimaryKey(List<Long> ids){
if(StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(ids)){ if(CollectionUtils.isEmpty(ids)){
return; return;
} }
enterpriseUserRoleMapper.deleteBatchByPrimaryKey(enterpriseId, ids); enterpriseUserRoleMapper.deleteBatchByPrimaryKey(ids);
} }
public List<Long> selectIdsByUserId(String enterpriseId, String userId){ public List<Long> selectIdsByUserId(String userId){
if(StringUtils.isAnyBlank(enterpriseId, userId)){ if(StringUtils.isAnyBlank(userId)){
return Lists.newArrayList(); return Lists.newArrayList();
} }
return enterpriseUserRoleMapper.selectIdsByUserId(enterpriseId, userId); return enterpriseUserRoleMapper.selectIdsByUserId(userId);
} }
public EnterpriseUserRole selectByUserIdAndRoleId(String enterpriseId, String userId, String roleId){ public EnterpriseUserRole selectByUserIdAndRoleId(String userId, String roleId){
if(StringUtils.isAnyBlank(enterpriseId, userId, roleId)){ if(StringUtils.isAnyBlank(userId, roleId)){
return null; return null;
} }
return enterpriseUserRoleMapper.selectByUserIdAndRoleId(enterpriseId, userId, roleId); return enterpriseUserRoleMapper.selectByUserIdAndRoleId(userId, roleId);
} }
public void save(String enterpriseId, EnterpriseUserRole entity){ public void save( EnterpriseUserRole entity){
if(StringUtils.isBlank(enterpriseId) || Objects.isNull(entity)){ if(Objects.isNull(entity)){
return; return;
} }
enterpriseUserRoleMapper.save(entity);
} }
} }

View File

@@ -18,11 +18,11 @@ public class LoginRecordDAO {
@Resource @Resource
private LoginRecordMapper loginRecordMapper; private LoginRecordMapper loginRecordMapper;
public void addLoginRecord(String enterpriseId, String userId){ public void addLoginRecord(String userId){
LoginRecordDO record = new LoginRecordDO(); LoginRecordDO record = new LoginRecordDO();
record.setUserId(userId); record.setUserId(userId);
record.setCreateTime(System.currentTimeMillis()); record.setCreateTime(System.currentTimeMillis());
loginRecordMapper.insertSelective(record, enterpriseId); loginRecordMapper.insertSelective(record);
} }
} }

View File

@@ -27,23 +27,23 @@ public class RegionDAO {
@Resource @Resource
private RegionMapper regionMapper; private RegionMapper regionMapper;
public List<Long> getRegionIdsBySynDingDeptIds(String eid, List<String> synDingDeptIds) { public List<Long> getRegionIdsBySynDingDeptIds(List<String> synDingDeptIds) {
if (CollectionUtils.isEmpty(synDingDeptIds)) { if (CollectionUtils.isEmpty(synDingDeptIds)) {
return new ArrayList<>(); return new ArrayList<>();
} }
return regionMapper.selectRegionIdsBySynDingDeptIds(eid, synDingDeptIds); return regionMapper.selectRegionIdsBySynDingDeptIds(synDingDeptIds);
} }
public List<RegionDO> getRegionByRegionIds(String eid, List<String> regionIds) { public List<RegionDO> getRegionByRegionIds(List<String> regionIds) {
if(CollectionUtils.isEmpty(regionIds)){ if(CollectionUtils.isEmpty(regionIds)){
return Collections.emptyList(); return Collections.emptyList();
} }
return regionMapper.getRegionByRegionIds(eid, regionIds); return regionMapper.getRegionByRegionIds(regionIds);
} }
public RegionDO getUnclassifiedRegionDO(String enterpriseId) { public RegionDO getUnclassifiedRegionDO() {
//先查询是否存在未分组区域 //先查询是否存在未分组区域
RegionDO unclassified = regionMapper.getUnclassifiedRegionDO(enterpriseId, CommonConstants.UNGROUPED_DEPT_NAME); RegionDO unclassified = regionMapper.getUnclassifiedRegionDO(CommonConstants.UNGROUPED_DEPT_NAME);
if (Objects.isNull(unclassified)) { if (Objects.isNull(unclassified)) {
RegionDO regionDO = new RegionDO(); RegionDO regionDO = new RegionDO();
regionDO.setId(CommonConstants.UNGROUPED_DEPT_ID); regionDO.setId(CommonConstants.UNGROUPED_DEPT_ID);
@@ -54,45 +54,42 @@ public class RegionDAO {
regionDO.setCreateTime(Calendar.getInstance().getTimeInMillis()); regionDO.setCreateTime(Calendar.getInstance().getTimeInMillis());
regionDO.setRegionPath("/" + CommonConstants.ROOT_DEPT_ID_STR + "/"); regionDO.setRegionPath("/" + CommonConstants.ROOT_DEPT_ID_STR + "/");
regionDO.setUnclassifiedFlag(CommonConstants.ONE); regionDO.setUnclassifiedFlag(CommonConstants.ONE);
insertRegion(enterpriseId, regionDO); insertRegion(regionDO);
regionDO.setRegionId(regionDO.getId().toString()); regionDO.setRegionId(regionDO.getId().toString());
return regionDO; return regionDO;
} }
return unclassified; return unclassified;
} }
public Long insertRegion(String eid, RegionDO regionDO) { public Long insertRegion(RegionDO regionDO) {
return regionMapper.insertRoot(eid, regionDO); return regionMapper.insertRoot(regionDO);
} }
public void batchInsertRegions(List<RegionDO> regionDOList, String eid){ public void batchInsertRegions(List<RegionDO> regionDOList){
regionMapper.batchInsertRegionsByDepartments(eid, regionDOList); regionMapper.batchInsertRegionsByDepartments(regionDOList);
} }
public Map<String,Long> getRegionSynDeptIdAndIdMapping(String eid, List<String> syncDeptIds){ public Map<String,Long> getRegionSynDeptIdAndIdMapping(List<String> syncDeptIds){
List<RegionDO> regionDOS = regionMapper.selectRegionBySynDingDeptIds(eid, syncDeptIds); List<RegionDO> regionDOS = regionMapper.selectRegionBySynDingDeptIds(syncDeptIds);
return ListUtils.emptyIfNull(regionDOS) return ListUtils.emptyIfNull(regionDOS)
.stream() .stream()
.collect(Collectors.toMap(RegionDO::getSynDingDeptId, RegionDO::getId, (r, e) -> r)); .collect(Collectors.toMap(RegionDO::getSynDingDeptId, RegionDO::getId, (r, e) -> r));
} }
public List<RegionDO> getAllRegion(String eid){ public List<RegionDO> getAllRegion(){
if(StringUtils.isBlank(eid)){ return regionMapper.getAllRegion();
return Lists.newArrayList();
}
return regionMapper.getAllRegion(eid);
} }
public List<RegionDO> listStoreRegionByIds(String enterpriseId, List<Long> regionIds){ public List<RegionDO> listStoreRegionByIds(List<Long> regionIds){
if(StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(regionIds)){ if(CollectionUtils.isEmpty(regionIds)){
return Lists.newArrayList(); return Lists.newArrayList();
} }
return regionMapper.listStoreRegionByIds(enterpriseId, regionIds); return regionMapper.listStoreRegionByIds(regionIds);
} }
public List<RegionPathDTO> getRegionPathByList(String eid, List<String> regionIds) { public List<RegionPathDTO> getRegionPathByList(List<String> regionIds) {
List<RegionDO> regionList = regionMapper.getRegionByRegionIds(eid, regionIds); List<RegionDO> regionList = regionMapper.getRegionByRegionIds(regionIds);
return ListUtils.emptyIfNull(regionList) return ListUtils.emptyIfNull(regionList)
.stream() .stream()
.map(data->{ .map(data->{
@@ -106,60 +103,60 @@ public class RegionDAO {
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
public RegionDO getByRegionId(String eid, Long regionId){ public RegionDO getByRegionId(Long regionId){
if(StringUtils.isBlank(eid) || Objects.isNull(regionId)){ if(Objects.isNull(regionId)){
return null; return null;
} }
return regionMapper.getByRegionId(eid, regionId); return regionMapper.getByRegionId(regionId);
} }
public RegionNode getRegionById(String eid, String regionId){ public RegionNode getRegionById(String regionId){
return regionMapper.getRegionByRegionId(eid, regionId); return regionMapper.getRegionByRegionId(regionId);
} }
public void insertOrUpdate(RegionDO regionDO, String eid){ public void insertOrUpdate(RegionDO regionDO){
regionMapper.insertOrUpdate(regionDO,eid); regionMapper.insertOrUpdate(regionDO);
} }
public List<RegionSyncDTO> getSpecifiedRegionIdAndDeptId(String eid, Long parentId){ public List<RegionSyncDTO> getSpecifiedRegionIdAndDeptId(Long parentId){
return regionMapper.getSpecifiedRegionIdAndDeptId(eid,parentId); return regionMapper.getSpecifiedRegionIdAndDeptId(parentId);
} }
public List<RegionDO> getRegionByDingDeptIds(String enterpriseId, List<String> dingDeptIds){ public List<RegionDO> getRegionByDingDeptIds(List<String> dingDeptIds){
if(StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(dingDeptIds)){ if(CollectionUtils.isEmpty(dingDeptIds)){
return Lists.newArrayList(); return Lists.newArrayList();
} }
return regionMapper.getRegionByDingDeptIds(enterpriseId, dingDeptIds); return regionMapper.getRegionByDingDeptIds(dingDeptIds);
} }
public RegionDO getBySynDingDeptId(String eid, String synDingDeptId){ public RegionDO getBySynDingDeptId(String synDingDeptId){
if(StringUtils.isAnyBlank(eid, synDingDeptId)){ if(StringUtils.isAnyBlank(synDingDeptId)){
return null; return null;
} }
return regionMapper.getBySynDingDeptId(eid, synDingDeptId); return regionMapper.getBySynDingDeptId(synDingDeptId);
} }
public Long ignoreInsert(String eid, RegionDO regionDO) { public Long ignoreInsert(RegionDO regionDO) {
if(StringUtils.isBlank(eid) || Objects.isNull(regionDO)){ if(Objects.isNull(regionDO)){
return 0L; return 0L;
} }
return regionMapper.ignoreInsert(eid, regionDO); return regionMapper.ignoreInsert(regionDO);
} }
public Integer updateSyncRegion(String eid, RegionDO regionDO){ public Integer updateSyncRegion(RegionDO regionDO){
if(StringUtils.isBlank(eid) || Objects.isNull(regionDO)){ if(Objects.isNull(regionDO)){
return 0; return 0;
} }
return regionMapper.updateSyncRegion(eid, regionDO); return regionMapper.updateSyncRegion(regionDO);
} }
public void removeRegion(String eid, List<Long> regionIds) { public void removeRegion(List<Long> regionIds) {
if (regionIds.contains(CommonConstants.UNGROUPED_DEPT_ID)) { if (regionIds.contains(CommonConstants.UNGROUPED_DEPT_ID)) {
regionIds.remove(CommonConstants.UNGROUPED_DEPT_ID); regionIds.remove(CommonConstants.UNGROUPED_DEPT_ID);
} }
if(CollectionUtils.isEmpty(regionIds)) { if(CollectionUtils.isEmpty(regionIds)) {
return; return;
} }
regionMapper.removeRegions(eid, regionIds); regionMapper.removeRegions(regionIds);
} }
} }

View File

@@ -1,106 +0,0 @@
package com.cool.store.dao;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dto.region.RegionSyncDTO;
import com.cool.store.dto.store.StoreAreaDTO;
import com.cool.store.entity.StoreDO;
import com.cool.store.enums.StoreIsDeleteEnum;
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.springframework.stereotype.Repository;
import javax.annotation.Resource;
import java.util.*;
/**
* @author zhangchenbiao
* @FileName: StoreDAO
* @Description:
* @date 2023-05-31 11:52
*/
@Repository
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){
if(isReturnList){
return storeMapper.listStoreIdList(eid);
}
return null;
}
public List<RegionSyncDTO> getSpecifiedStoreIdsAndDeptId(String eId, Long parentId) {
List<RegionSyncDTO> storeDOList = storeMapper.getSpecifiedStoreIdsAndDeptId(eId, StoreIsDeleteEnum.EFFECTIVE.getValue(), parentId);
return storeDOList;
}
public StoreDO getStoreBySynId(String eid, String synId){
if(StringUtils.isAnyBlank(eid, synId)){
return null;
}
return storeMapper.getStoreBySynId(eid, synId);
}
public Integer updateStore(String enterpriseId, StoreDO storeDO) {
fillAddressPoint(storeDO);
return storeMapper.updateStore(enterpriseId, storeDO);
}
public Integer insertStore(String enterpriseId, StoreDO storeDO) {
fillAddressPoint(storeDO);
return storeMapper.insertStore(enterpriseId, storeDO);
}
private void fillAddressPoint(StoreDO storeDO){
if(StringUtils.isNoneBlank(storeDO.getLatitude(), storeDO.getLongitude()) && StringUtils.isBlank(storeDO.getLongitudeLatitude())){
storeDO.setLongitudeLatitude(storeDO.getLongitude() + CommonConstants.COMMA+ storeDO.getLatitude());
}
if(StringUtils.isNotBlank(storeDO.getLongitudeLatitude())){
List<String> list = Arrays.asList(storeDO.getLongitudeLatitude().split(","));
storeDO.setAddressPoint("POINT("+list.get(0)+" "+list.get(1)+")");
}
}
public List<String> getStoreIdByIdList(String eid, List<String> ids){
if(StringUtils.isBlank(eid) || CollectionUtils.isEmpty(ids)){
return Lists.newArrayList();
}
return storeMapper.getStoreIdByIdList(eid, ids);
}
public Integer deleteStoreByStoreIds(String enterpriseId, List<String> storeIds, String userId, Long updateTime){
if(StringUtils.isAnyBlank(enterpriseId, userId) || CollectionUtils.isEmpty(storeIds) || Objects.isNull(updateTime)){
return 0;
}
return storeMapper.deleteStoreByStoreIds(enterpriseId, storeIds, userId, updateTime);
}
}

View File

@@ -1,51 +0,0 @@
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.Repository;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author zhangchenbiao
* @FileName: SubordinateMappingDAO
* @Description:
* @date 2023-05-31 14:27
*/
@Repository
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);
}
public void deletedByUserIds(String enterpriseId,List<String> userIds){
if (CollectionUtils.isEmpty(userIds)){
return;
}
List<String> distinctUserIds = userIds.stream().distinct().collect(Collectors.toList());
subordinateMappingMapper.deletedByUserIds(enterpriseId,distinctUserIds);
}
}

View File

@@ -22,38 +22,32 @@ public class SysDepartmentDAO {
@Resource @Resource
private SysDepartmentMapper sysDepartmentMapper; private SysDepartmentMapper sysDepartmentMapper;
public void batchInsertOrUpdate(String enterpriseId, List<SysDepartmentDO> deptList){ public void batchInsertOrUpdate(List<SysDepartmentDO> deptList){
if(StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(deptList)){ if(CollectionUtils.isEmpty(deptList)){
return; return;
} }
sysDepartmentMapper.batchInsertOrUpdate(deptList, enterpriseId); sysDepartmentMapper.batchInsertOrUpdate(deptList);
} }
public List<QueryDeptChildDTO> getDeptChildListByParentId(String eid, String parentId){ public List<QueryDeptChildDTO> getDeptChildListByParentId(String parentId){
if(StringUtils.isAnyBlank(eid, parentId)){ if(StringUtils.isAnyBlank(parentId)){
return Lists.newArrayList(); return Lists.newArrayList();
} }
return sysDepartmentMapper.getDeptChildListByParentId(eid, parentId); return sysDepartmentMapper.getDeptChildListByParentId(parentId);
} }
public void deleteByNotInIds(String enterpriseId, List<String> deptIds){ public void deleteByNotInIds(List<String> deptIds){
if(StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(deptIds)){ if(CollectionUtils.isEmpty(deptIds)){
return; return;
} }
sysDepartmentMapper.deleteByNotInIds(deptIds, enterpriseId); sysDepartmentMapper.deleteByNotInIds(deptIds);
} }
public List<SyncTreeNode> getSyncDeptTreeList(String eid) { public List<SyncTreeNode> getSyncDeptTreeList() {
if(StringUtils.isBlank(eid)){ return sysDepartmentMapper.getSyncDeptTreeList();
return Lists.newArrayList();
}
return sysDepartmentMapper.getSyncDeptTreeList(eid);
} }
public List<SysDepartmentDO> selectAllDepts(String enterpriseId){ public List<SysDepartmentDO> selectAllDepts(){
if(StringUtils.isBlank(enterpriseId)){ return sysDepartmentMapper.selectAll();
return Lists.newArrayList();
}
return sysDepartmentMapper.selectAll(enterpriseId);
} }
} }

View File

@@ -24,16 +24,16 @@ public class SysRoleDAO {
* @param userId * @param userId
* @return * @return
*/ */
public SysRoleDO getHighestPrioritySysRoleDoByUserId(String enterpriseId, String userId){ public SysRoleDO getHighestPrioritySysRoleDoByUserId(String userId){
if(StringUtils.isAnyBlank(enterpriseId, userId)){ if(StringUtils.isAnyBlank(userId)){
return null; return null;
} }
return sysRoleMapper.getHighestPrioritySysRoleDoByUserId(enterpriseId, userId); return sysRoleMapper.getHighestPrioritySysRoleDoByUserId(userId);
} }
public Long getRoleIdByRoleEnum(String eid, String roleEnum) { public Long getRoleIdByRoleEnum(String roleEnum) {
SysRoleDO roleByRoleEnum = sysRoleMapper.getRoleByRoleEnum(eid, roleEnum); SysRoleDO roleByRoleEnum = sysRoleMapper.getRoleByRoleEnum(roleEnum);
if(roleByRoleEnum==null){ if(roleByRoleEnum==null){
return Long.valueOf(RoleEnum.getByCode(roleEnum).getId()); return Long.valueOf(RoleEnum.getByCode(roleEnum).getId());
} }

View File

@@ -1,66 +0,0 @@
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.Repository;
import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
/**
* @author zhangchenbiao
* @date 2023-05-19 02:54
*/
@Repository
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);
}
public void deleteAuthMappingByIds(String eid, List<Long> ids){
if(StringUtils.isBlank(eid) || CollectionUtils.isEmpty(ids)){
return;
}
userAuthMappingMapper.deleteAuthMappingByIds(eid, ids);
}
public List<Long> selectIdsByUserId(String eid, String userId){
if(StringUtils.isAnyBlank(eid, userId)){
return Lists.newArrayList();
}
return userAuthMappingMapper.selectIdsByUserId(eid, userId);
}
public void insertUserAuthMapping(String eid, UserAuthMappingDO auth){
if(StringUtils.isBlank(eid)|| Objects.isNull(auth)){
return;
}
userAuthMappingMapper.insertUserAuthMapping(eid, auth);
}
public void deleteAuthMappingByIdAndType(String eid, List<String> ids, String type){
if(StringUtils.isAnyBlank(eid, type) || CollectionUtils.isEmpty(ids)){
return;
}
userAuthMappingMapper.deleteAuthMappingByIdAndType(eid, ids, type);
}
}

View File

@@ -4,7 +4,6 @@ import com.cool.store.entity.UserRegionMappingDO;
import com.cool.store.mapper.UserRegionMappingMapper; import com.cool.store.mapper.UserRegionMappingMapper;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import javax.annotation.Resource; import javax.annotation.Resource;
@@ -22,42 +21,42 @@ public class UserRegionMappingDAO {
private UserRegionMappingMapper userRegionMappingMapper; private UserRegionMappingMapper userRegionMappingMapper;
public void deletedByUserIds(String enterpriseId, List<String> userIds){ public void deletedByUserIds(List<String> userIds){
if (CollectionUtils.isEmpty(userIds)) { if (CollectionUtils.isEmpty(userIds)) {
return; return;
} }
List<String> distinctData = userIds.stream() List<String> distinctData = userIds.stream()
.distinct() .distinct()
.collect(Collectors.toList()); .collect(Collectors.toList());
userRegionMappingMapper.deletedByUserIds(enterpriseId, distinctData); userRegionMappingMapper.deletedByUserIds(distinctData);
} }
public void batchInsertRegionMapping(String enterpriseId, List<UserRegionMappingDO> userRegionMappingDOS){ public void batchInsertRegionMapping(List<UserRegionMappingDO> userRegionMappingDOS){
if (CollectionUtils.isEmpty(userRegionMappingDOS)) { if (CollectionUtils.isEmpty(userRegionMappingDOS)) {
return; return;
} }
List<UserRegionMappingDO> distinctData = userRegionMappingDOS.stream() List<UserRegionMappingDO> distinctData = userRegionMappingDOS.stream()
.distinct() .distinct()
.collect(Collectors.toList()); .collect(Collectors.toList());
userRegionMappingMapper.batchInsertRegionMapping(enterpriseId, distinctData); userRegionMappingMapper.batchInsertRegionMapping(distinctData);
} }
public List<UserRegionMappingDO> listUserRegionMappingByUserId(String enterpriseId, List<String> userIds){ public List<UserRegionMappingDO> listUserRegionMappingByUserId(List<String> userIds){
if(StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(userIds)){ if(CollectionUtils.isEmpty(userIds)){
return Lists.newArrayList(); return Lists.newArrayList();
} }
return userRegionMappingMapper.listUserRegionMappingByUserId(enterpriseId, userIds); return userRegionMappingMapper.listUserRegionMappingByUserId(userIds);
} }
public void deletedByIds(String enterpriseId, List<Integer> ids){ public void deletedByIds(List<Integer> ids){
if (CollectionUtils.isEmpty(ids)) { if (CollectionUtils.isEmpty(ids)) {
return; return;
} }
List<Integer> distinctData = ids.stream() List<Integer> distinctData = ids.stream()
.distinct() .distinct()
.collect(Collectors.toList()); .collect(Collectors.toList());
userRegionMappingMapper.deletedByIds(enterpriseId, distinctData); userRegionMappingMapper.deletedByIds(distinctData);
} }
} }

View File

@@ -1,39 +0,0 @@
package com.cool.store.mapper;
import com.cool.store.entity.EnterpriseUserDepartmentDO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author zhangchenbiao
* @date 2023-06-02 05:01
*/
public interface EnterpriseUserDepartmentMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-06-02 05:01
*/
int insertSelective(@Param("record") EnterpriseUserDepartmentDO record, @Param("enterpriseId") String enterpriseId);
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-06-02 05:01
*/
int updateByPrimaryKeySelective(@Param("record") EnterpriseUserDepartmentDO record, @Param("enterpriseId") String enterpriseId);
List<Integer> getIdsByUserId(@Param("eid") String eid, @Param("userId") String userId);
void deleteByIdList(@Param("eid") String eid, @Param("list") List<Integer> ids);
List<EnterpriseUserDepartmentDO> selectUserDeptByUserId(@Param("eid")String eid, @Param("userId")String userId);
int batchInsert(@Param("eid")String eid, @Param("deptUsers") List<EnterpriseUserDepartmentDO> deptUsers);
List<EnterpriseUserDepartmentDO> selectUserDeptAuthByUserId(@Param("eid")String eid, @Param("userId")String userId);
}

View File

@@ -1,40 +0,0 @@
package com.cool.store.mapper;
import com.cool.store.entity.EnterpriseUserGroupDO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author zhangchenbiao
* @date 2023-05-31 02:43
*/
public interface EnterpriseUserGroupMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-31 02:43
*/
int insertSelective(@Param("record") EnterpriseUserGroupDO record, @Param("enterpriseId") String enterpriseId);
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-31 02:43
*/
int updateByPrimaryKeySelective(@Param("record") EnterpriseUserGroupDO record, @Param("enterpriseId") String enterpriseId);
int countByGroupName(@Param("enterpriseId") String enterpriseId, @Param("groupName") String groupName, @Param("groupId") String groupId);
void deleteByGroupIdList(@Param("enterpriseId") String enterpriseId, @Param("groupIdList") List<String> groupIdList);
List<EnterpriseUserGroupDO> listUserGroup(@Param("enterpriseId")String enterpriseId, @Param("groupName")String groupName);
EnterpriseUserGroupDO getByGroupId(@Param("enterpriseId")String enterpriseId, @Param("groupId")String groupId);
List<EnterpriseUserGroupDO> listByGroupIdList(@Param("enterpriseId") String enterpriseId, @Param("groupIdList") List<String> groupIdList);
int updateByGroupId(@Param("record")EnterpriseUserGroupDO record, @Param("enterpriseId") String enterpriseId);
}

View File

@@ -1,41 +0,0 @@
package com.cool.store.mapper;
import com.cool.store.entity.EnterpriseUserGroupMappingDO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author zhangchenbiao
* @date 2023-05-31 02:43
*/
public interface EnterpriseUserGroupMappingMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-31 02:43
*/
int insertSelective(@Param("record") EnterpriseUserGroupMappingDO record, @Param("enterpriseId") String enterpriseId);
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-31 02:43
*/
int updateByPrimaryKeySelective(@Param("record") EnterpriseUserGroupMappingDO record, @Param("enterpriseId") String enterpriseId);
void deleteUserGroupMappingByGroupId(@Param("enterpriseId")String enterpriseId, @Param("groupId") String groupId);
Integer batchInsertMapping(@Param("enterpriseId") String enterpriseId, @Param("userIdList") List<String> userIdList, @Param("groupId") String groupId);
Integer deleteMappingByGroupIdList(@Param("enterpriseId") String enterpriseId, @Param("groupId") String groupId, @Param("userIdList") List<String> userIdList);
Integer deleteMappingByUserIdList(@Param("enterpriseId") String enterpriseId, @Param("userIdList") List<String> userIdList);
List<EnterpriseUserGroupMappingDO> listByGroupIdList(@Param("enterpriseId") String enterpriseId, @Param("groupIdList") List<String> groupIdList);
List<EnterpriseUserGroupMappingDO> listByUserIdList(@Param("enterpriseId") String enterpriseId, @Param("userIdList") List<String> userIdList);
void batchInsertOrUpdateUserGroupMapping(@Param("enterpriseId") String enterpriseId,@Param("userGroupMappingList") List<EnterpriseUserGroupMappingDO> userGroupMappingList);
}

View File

@@ -17,14 +17,14 @@ public interface EnterpriseUserMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-19 02:58 * dateTime:2023-05-19 02:58
*/ */
int insertSelective(@Param("record") EnterpriseUserDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") EnterpriseUserDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-19 02:58 * dateTime:2023-05-19 02:58
*/ */
int updateByPrimaryKeySelective(@Param("record") EnterpriseUserDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") EnterpriseUserDO record);
/** /**
* *
@@ -32,14 +32,14 @@ public interface EnterpriseUserMapper {
* @param userId * @param userId
* @return * @return
*/ */
EnterpriseUserDO getUserInfoById(@Param("enterpriseId")String enterpriseId, @Param("userId")String userId); EnterpriseUserDO getUserInfoById(@Param("userId")String userId);
/** /**
* 批量插入或更新 * 批量插入或更新
* @param enterpriseId * @param enterpriseId
* @param users * @param users
*/ */
void batchInsertOrUpdate(@Param("enterpriseId") String enterpriseId, @Param("list") List<EnterpriseUserDO> users); void batchInsertOrUpdate(@Param("list") List<EnterpriseUserDO> users);
/** /**
* 批量更新不同用户 不同的userRegionids * 批量更新不同用户 不同的userRegionids
@@ -47,10 +47,9 @@ public interface EnterpriseUserMapper {
* @param enterpriseUserDOList * @param enterpriseUserDOList
* @return * @return
*/ */
Boolean batchUpdateDiffUserDiffRegionIds(@Param("eid") String eid, @Param("list") List<EnterpriseUserDO> enterpriseUserDOList); Boolean batchUpdateDiffUserDiffRegionIds(@Param("list") List<EnterpriseUserDO> enterpriseUserDOList);
List<EnterpriseUserDO> fuzzyUsersByDepartment(@Param("eid") String eid, List<EnterpriseUserDO> fuzzyUsersByDepartment(@Param("deptId") String deptId,
@Param("deptId") String deptId,
@Param("roleId") Long roleId, @Param("roleId") Long roleId,
@Param("orderBy") String orderBy, @Param("orderBy") String orderBy,
@Param("orderRule") String orderRule, @Param("orderRule") String orderRule,
@@ -60,8 +59,7 @@ public interface EnterpriseUserMapper {
@Param("userIdList") List<String> userIdList, @Param("userIdList") List<String> userIdList,
@Param("regionId") String regionId); @Param("regionId") String regionId);
List<EnterpriseUserDO> fuzzyUsersByNotRole(@Param("eid") String eid, List<EnterpriseUserDO> fuzzyUsersByNotRole(@Param("deptId") String deptId,
@Param("deptId") String deptId,
@Param("orderBy") String orderBy, @Param("orderBy") String orderBy,
@Param("orderRule") String orderRule, @Param("orderRule") String orderRule,
@Param("userName") String userName, @Param("userName") String userName,
@@ -76,27 +74,26 @@ public interface EnterpriseUserMapper {
* @param userIds * @param userIds
* @return * @return
*/ */
List<EnterpriseUserDO> selectUsersByUserIds(@Param("eid") String eid, @Param("userIds") List<String> userIds); List<EnterpriseUserDO> selectUsersByUserIds(@Param("userIds") List<String> userIds);
List<EnterpriseUserDO> listUserByGroupId(@Param("eid") String eid, List<EnterpriseUserDO> listUserByGroupId(@Param("groupId") String groupId,
@Param("groupId") String groupId,
@Param("userName") String userName, @Param("userName") String userName,
@Param("userIdList") List<String> userIdList); @Param("userIdList") List<String> userIdList);
List<EnterpriseUserDO> listByRegionIdList(@Param("eid") String eid, @Param("regionIdList") List<String> regionIdList); List<EnterpriseUserDO> listByRegionIdList(@Param("regionIdList") List<String> regionIdList);
void updateEnterpriseUser(@Param("eid") String eid,@Param("enterpriseUserDO") EnterpriseUserDO enterpriseUserDO); void updateEnterpriseUser(@Param("enterpriseUserDO") EnterpriseUserDO enterpriseUserDO);
List<String> getMainAdminUserIds(@Param("eid")String eid); List<String> getMainAdminUserIds();
List<String> selectSpecifyNodeUserIds(@Param("eid") String eid, @Param("dingDeptId") String dingDeptId); List<String> selectSpecifyNodeUserIds(@Param("dingDeptId") String dingDeptId);
List<String> selectAllUserIds(@Param("eid") String eid); List<String> selectAllUserIds();
EnterpriseUserDO selectByUserIdIgnoreActive(@Param("enterpriseId") String enterpriseId, @Param("userId") String userId); EnterpriseUserDO selectByUserIdIgnoreActive(@Param("userId") String userId);
void insertEnterpriseUser(@Param("eid") String eid, @Param("entity") EnterpriseUserDO entity); void insertEnterpriseUser(@Param("entity") EnterpriseUserDO entity);
} }

View File

@@ -19,14 +19,14 @@ public interface EnterpriseUserRoleMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-19 02:59 * dateTime:2023-05-19 02:59
*/ */
int insertSelective(@Param("record") EnterpriseUserRoleDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") EnterpriseUserRoleDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-19 02:59 * dateTime:2023-05-19 02:59
*/ */
int updateByPrimaryKeySelective(@Param("record") EnterpriseUserRoleDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") EnterpriseUserRoleDO record);
/** /**
* 批量插入用户角色 * 批量插入用户角色
@@ -34,17 +34,17 @@ public interface EnterpriseUserRoleMapper {
* @param userRoles * @param userRoles
* @return * @return
*/ */
Boolean insertBatchUserRole(@Param("eid") String enterpriseId, @Param("userRoles") List<EnterpriseUserRole> userRoles); Boolean insertBatchUserRole(@Param("userRoles") List<EnterpriseUserRole> userRoles);
List<UserRoleDTO> getUserAndRolesByUserId(@Param("eip") String enterpriseId, @Param("userIdList") List<String> userIdList); List<UserRoleDTO> getUserAndRolesByUserId(@Param("userIdList") List<String> userIdList);
List<SysRoleDO> listRoleByUserId(@Param("eip") String enterpriseId, @Param("userId") String userId); List<SysRoleDO> listRoleByUserId(@Param("userId") String userId);
void deleteBatchByPrimaryKey(@Param("eid") String enterpriseId, @Param("ids") List<Long> ids); void deleteBatchByPrimaryKey(@Param("ids") List<Long> ids);
List<Long> selectIdsByUserId(@Param("eid") String enterpriseId, @Param("userId") String userId); List<Long> selectIdsByUserId(@Param("userId") String userId);
EnterpriseUserRole selectByUserIdAndRoleId(@Param("eid") String enterpriseId, @Param("userId") String userId, @Param("roleId") String roleId); EnterpriseUserRole selectByUserIdAndRoleId(@Param("userId") String userId, @Param("roleId") String roleId);
void save(@Param("eid") String enterpriseId, @Param("entity") EnterpriseUserRole entity); void save(@Param("entity") EnterpriseUserRole entity);
} }

View File

@@ -14,12 +14,12 @@ public interface HyAdvancedSettingMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-29 03:49 * dateTime:2023-05-29 03:49
*/ */
int insertSelective(@Param("record") HyAdvancedSettingDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") HyAdvancedSettingDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-29 03:49 * dateTime:2023-05-29 03:49
*/ */
int updateByPrimaryKeySelective(@Param("record") HyAdvancedSettingDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") HyAdvancedSettingDO record);
} }

View File

@@ -14,12 +14,12 @@ public interface HyContentInfoMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-29 03:50 * dateTime:2023-05-29 03:50
*/ */
int insertSelective(@Param("record") HyContentInfoDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") HyContentInfoDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-29 03:50 * dateTime:2023-05-29 03:50
*/ */
int updateByPrimaryKeySelective(@Param("record") HyContentInfoDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") HyContentInfoDO record);
} }

View File

@@ -14,12 +14,12 @@ public interface HyIntendDevZoneInfoMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-29 03:50 * dateTime:2023-05-29 03:50
*/ */
int insertSelective(@Param("record") HyIntendDevZoneInfoDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") HyIntendDevZoneInfoDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-29 03:50 * dateTime:2023-05-29 03:50
*/ */
int updateByPrimaryKeySelective(@Param("record") HyIntendDevZoneInfoDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") HyIntendDevZoneInfoDO record);
} }

View File

@@ -14,12 +14,12 @@ public interface HyIntendDevelopementMappingMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-29 03:50 * dateTime:2023-05-29 03:50
*/ */
int insertSelective(@Param("record") HyIntendDevelopementMappingDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") HyIntendDevelopementMappingDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-29 03:50 * dateTime:2023-05-29 03:50
*/ */
int updateByPrimaryKeySelective(@Param("record") HyIntendDevelopementMappingDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") HyIntendDevelopementMappingDO record);
} }

View File

@@ -14,12 +14,12 @@ public interface HyOpenAreaInfoMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-29 03:51 * dateTime:2023-05-29 03:51
*/ */
int insertSelective(@Param("record") HyOpenAreaInfoDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") HyOpenAreaInfoDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-29 03:51 * dateTime:2023-05-29 03:51
*/ */
int updateByPrimaryKeySelective(@Param("record") HyOpenAreaInfoDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") HyOpenAreaInfoDO record);
} }

View File

@@ -14,12 +14,12 @@ public interface HyPartnerBaseInfoMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-29 03:51 * dateTime:2023-05-29 03:51
*/ */
int insertSelective(@Param("record") HyPartnerBaseInfoDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") HyPartnerBaseInfoDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-29 03:51 * dateTime:2023-05-29 03:51
*/ */
int updateByPrimaryKeySelective(@Param("record") HyPartnerBaseInfoDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") HyPartnerBaseInfoDO record);
} }

View File

@@ -14,12 +14,12 @@ public interface HyPartnerCertificationInfoMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-29 03:51 * dateTime:2023-05-29 03:51
*/ */
int insertSelective(@Param("record") HyPartnerCertificationInfoDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") HyPartnerCertificationInfoDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-29 03:51 * dateTime:2023-05-29 03:51
*/ */
int updateByPrimaryKeySelective(@Param("record") HyPartnerCertificationInfoDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") HyPartnerCertificationInfoDO record);
} }

View File

@@ -14,12 +14,12 @@ public interface HyPartnerClerkMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-29 03:51 * dateTime:2023-05-29 03:51
*/ */
int insertSelective(@Param("record") HyPartnerClerkDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") HyPartnerClerkDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-29 03:51 * dateTime:2023-05-29 03:51
*/ */
int updateByPrimaryKeySelective(@Param("record") HyPartnerClerkDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") HyPartnerClerkDO record);
} }

View File

@@ -14,12 +14,12 @@ public interface HyPartnerIntentInfoMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-29 03:52 * dateTime:2023-05-29 03:52
*/ */
int insertSelective(@Param("record") HyPartnerIntentInfoDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") HyPartnerIntentInfoDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-29 03:52 * dateTime:2023-05-29 03:52
*/ */
int updateByPrimaryKeySelective(@Param("record") HyPartnerIntentInfoDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") HyPartnerIntentInfoDO record);
} }

View File

@@ -14,12 +14,12 @@ public interface HyPartnerInterviewLogMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-29 03:52 * dateTime:2023-05-29 03:52
*/ */
int insertSelective(@Param("record") HyPartnerInterviewLogDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") HyPartnerInterviewLogDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-29 03:52 * dateTime:2023-05-29 03:52
*/ */
int updateByPrimaryKeySelective(@Param("record") HyPartnerInterviewLogDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") HyPartnerInterviewLogDO record);
} }

View File

@@ -14,12 +14,12 @@ public interface HyPartnerInterviewMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-29 03:52 * dateTime:2023-05-29 03:52
*/ */
int insertSelective(@Param("record") HyPartnerInterviewDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") HyPartnerInterviewDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-29 03:52 * dateTime:2023-05-29 03:52
*/ */
int updateByPrimaryKeySelective(@Param("record") HyPartnerInterviewDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") HyPartnerInterviewDO record);
} }

View File

@@ -14,12 +14,12 @@ public interface HyPartnerInterviewPlanMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-29 03:52 * dateTime:2023-05-29 03:52
*/ */
int insertSelective(@Param("record") HyPartnerInterviewPlanDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") HyPartnerInterviewPlanDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-29 03:52 * dateTime:2023-05-29 03:52
*/ */
int updateByPrimaryKeySelective(@Param("record") HyPartnerInterviewPlanDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") HyPartnerInterviewPlanDO record);
} }

View File

@@ -15,12 +15,12 @@ public interface HyPartnerLineInfoMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-29 03:52 * dateTime:2023-05-29 03:52
*/ */
int insertSelective(@Param("record") HyPartnerLineInfoDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") HyPartnerLineInfoDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-29 03:52 * dateTime:2023-05-29 03:52
*/ */
int updateByPrimaryKeySelective(@Param("record") HyPartnerLineInfoDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") HyPartnerLineInfoDO record);
} }

View File

@@ -14,12 +14,12 @@ public interface HyPartnerTaskInfoLogMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-29 03:53 * dateTime:2023-05-29 03:53
*/ */
int insertSelective(@Param("record") HyPartnerTaskInfoLogDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") HyPartnerTaskInfoLogDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-29 03:53 * dateTime:2023-05-29 03:53
*/ */
int updateByPrimaryKeySelective(@Param("record") HyPartnerTaskInfoLogDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") HyPartnerTaskInfoLogDO record);
} }

View File

@@ -14,12 +14,12 @@ public interface HyPartnerUserInfoMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-29 03:53 * dateTime:2023-05-29 03:53
*/ */
int insertSelective(@Param("record") HyPartnerUserInfoDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") HyPartnerUserInfoDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-29 03:53 * dateTime:2023-05-29 03:53
*/ */
int updateByPrimaryKeySelective(@Param("record") HyPartnerUserInfoDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") HyPartnerUserInfoDO record);
} }

View File

@@ -14,12 +14,12 @@ public interface HyPartnerUserPlatformBindMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-29 03:53 * dateTime:2023-05-29 03:53
*/ */
int insertSelective(@Param("record") HyPartnerUserPlatformBindDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") HyPartnerUserPlatformBindDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-29 03:53 * dateTime:2023-05-29 03:53
*/ */
int updateByPrimaryKeySelective(@Param("record") HyPartnerUserPlatformBindDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") HyPartnerUserPlatformBindDO record);
} }

View File

@@ -14,12 +14,12 @@ public interface HyWorkflowStageMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-29 03:53 * dateTime:2023-05-29 03:53
*/ */
int insertSelective(@Param("record") HyWorkflowStageDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") HyWorkflowStageDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-29 03:53 * dateTime:2023-05-29 03:53
*/ */
int updateByPrimaryKeySelective(@Param("record") HyWorkflowStageDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") HyWorkflowStageDO record);
} }

View File

@@ -14,12 +14,12 @@ public interface LoginRecordMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-23 03:46 * dateTime:2023-05-23 03:46
*/ */
int insertSelective(@Param("record") LoginRecordDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") LoginRecordDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-23 03:46 * dateTime:2023-05-23 03:46
*/ */
int updateByPrimaryKeySelective(@Param("record") LoginRecordDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") LoginRecordDO record);
} }

View File

@@ -18,48 +18,48 @@ public interface RegionMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-19 02:59 * dateTime:2023-05-19 02:59
*/ */
int insertSelective(@Param("record") RegionDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") RegionDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-19 02:59 * dateTime:2023-05-19 02:59
*/ */
int updateByPrimaryKeySelective(@Param("record") RegionDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") RegionDO record);
List<Long> selectRegionIdsBySynDingDeptIds(@Param("eid") String eid, @Param("synDingDeptIds") List<String> synDingDeptIds); List<Long> selectRegionIdsBySynDingDeptIds(@Param("synDingDeptIds") List<String> synDingDeptIds);
List<RegionDO> getRegionByRegionIds(@Param("eid") String eid, @Param("regionIds") List<String> regionIds); List<RegionDO> getRegionByRegionIds( @Param("regionIds") List<String> regionIds);
RegionDO getUnclassifiedRegionDO(@Param("enterpriseId") String enterpriseId, @Param("name")String name); RegionDO getUnclassifiedRegionDO(@Param("name")String name);
Long insertRoot(@Param("eid") String eid, @Param("region") RegionDO regionDO); Long insertRoot(@Param("region") RegionDO regionDO);
Integer batchInsertRegionsByDepartments(@Param("eid") String eid, @Param("regions") List<RegionDO> regions); Integer batchInsertRegionsByDepartments(@Param("regions") List<RegionDO> regions);
List<RegionDO> selectRegionBySynDingDeptIds(@Param("eid") String eid, @Param("synDingDeptIds") List<String> synDingDeptIds); List<RegionDO> selectRegionBySynDingDeptIds(@Param("synDingDeptIds") List<String> synDingDeptIds);
List<RegionDO> getAllRegion(@Param("eid") String eid); List<RegionDO> getAllRegion();
List<RegionDO> listStoreRegionByIds(@Param("eid")String enterpriseId, @Param("regionIds")List<Long> regionIds); List<RegionDO> listStoreRegionByIds(@Param("regionIds")List<Long> regionIds);
RegionDO getByRegionId(@Param("eid") String eid, @Param("regionId") Long regionId); RegionDO getByRegionId(@Param("regionId") Long regionId);
RegionNode getRegionByRegionId(@Param("eid") String eid, @Param("regionId") String regionId); RegionNode getRegionByRegionId(@Param("regionId") String regionId);
Integer insertOrUpdate(@Param("record") RegionDO regionDO, @Param("eid") String eid); Integer insertOrUpdate(@Param("record") RegionDO regionDO);
List<RegionSyncDTO> getSpecifiedRegionIdAndDeptId(@Param("eid") String eid, @Param("parentId") Long parentId); List<RegionSyncDTO> getSpecifiedRegionIdAndDeptId(@Param("parentId") Long parentId);
List<RegionDO> getRegionByDingDeptIds(@Param("eid")String enterpriseId, @Param("list")List<String> dingDeptIds); List<RegionDO> getRegionByDingDeptIds(@Param("list")List<String> dingDeptIds);
RegionDO getBySynDingDeptId(@Param("eid") String eid, @Param("synDingDeptId") String synDingDeptId); RegionDO getBySynDingDeptId(@Param("synDingDeptId") String synDingDeptId);
Long ignoreInsert(@Param("eid") String eid, @Param("region") RegionDO regionDO); Long ignoreInsert(@Param("region") RegionDO regionDO);
Integer updateSyncRegion(@Param("eid") String eid, @Param("item")RegionDO regionDO); Integer updateSyncRegion(@Param("item")RegionDO regionDO);
Integer removeRegions(@Param("eid")String eid,@Param("regionIds") List<Long> regionIds); Integer removeRegions(@Param("regionIds") List<Long> regionIds);
} }

View File

@@ -1,53 +0,0 @@
package com.cool.store.mapper;
import com.cool.store.dto.region.RegionSyncDTO;
import com.cool.store.dto.store.StoreAreaDTO;
import com.cool.store.entity.StoreDO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author zhangchenbiao
* @date 2023-05-31 11:51
*/
public interface StoreMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-31 11:51
*/
int insertSelective(@Param("record") StoreDO record, @Param("enterpriseId") String enterpriseId);
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-31 11:51
*/
int updateByPrimaryKeySelective(@Param("record") StoreDO record, @Param("enterpriseId") String enterpriseId);
List<StoreAreaDTO> listStoreByRegionIdList(@Param("eid") String eid, @Param("regionIdList") List<String> regionIdList);
List<StoreDO> getStoreListByStoreIds(@Param("enterpriseId") String enterpriseId, @Param("storeIdList") List<String> storeIdList);
List<StoreAreaDTO> listStoreByRegionIdListNotChild(@Param("eid") String eid, @Param("regionIdList") List<String> regionIdList);
Integer countStore(@Param("eid") String eid);
List<String> listStoreIdList(@Param("eid") String eid);
List<RegionSyncDTO> getSpecifiedStoreIdsAndDeptId(@Param("eid") String eid,
@Param("isDelete") String isDelete,
@Param("parentId") Long parentId);
StoreDO getStoreBySynId(@Param("eid") String eid, @Param("synId") String synId);
Integer insertStore(@Param("enterpriseId") String enterpriseId, @Param("storeDO") StoreDO storeDO);
Integer updateStore(@Param("enterpriseId") String enterpriseId, @Param("storeDO") StoreDO storeDO);
List<String> getStoreIdByIdList(@Param("eid") String eid, @Param("ids") List<String> ids);
Integer deleteStoreByStoreIds(@Param("enterpriseId") String enterpriseId, @Param("storeIds") List<String> storeIds, @Param("userId") String userId, @Param("updateTime") Long updateTime);
}

View File

@@ -1,45 +0,0 @@
package com.cool.store.mapper;
import com.cool.store.entity.SubordinateMappingDO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author zhangchenbiao
* @date 2023-05-31 02:27
*/
public interface SubordinateMappingMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-31 02:27
*/
int insertSelective(@Param("record") SubordinateMappingDO record, @Param("enterpriseId") String enterpriseId);
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-31 02:27
*/
int updateByPrimaryKeySelective(@Param("record") SubordinateMappingDO record, @Param("enterpriseId") String enterpriseId);
/**
* 根据用户ids查询直属上级列表
* @param enterpriseId
* @param userIds
* @return
*/
List<SubordinateMappingDO> selectByUserIds(@Param("enterpriseId") String enterpriseId, @Param("userIds") List<String> userIds);
/**
* 批量新增用户的下属部门
* @param enterpriseId
* @param subordinateMappingDOS
*/
void batchInsertSubordinateMapping(@Param("enterpriseId") String enterpriseId,@Param("subordinateMappingDOS") List<SubordinateMappingDO> subordinateMappingDOS);
void deletedByUserIds(@Param("enterpriseId") String enterpriseId,@Param("userIds") List<String> userIds);
}

View File

@@ -18,22 +18,22 @@ public interface SysDepartmentMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-19 03:00 * dateTime:2023-05-19 03:00
*/ */
int insertSelective(@Param("record") SysDepartmentDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") SysDepartmentDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-19 03:00 * dateTime:2023-05-19 03:00
*/ */
int updateByPrimaryKeySelective(@Param("record") SysDepartmentDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") SysDepartmentDO record);
void batchInsertOrUpdate(@Param("list") List<SysDepartmentDO> sysDepartmentDOList, @Param("eid") String eid); void batchInsertOrUpdate(@Param("list") List<SysDepartmentDO> sysDepartmentDOList);
List<QueryDeptChildDTO> getDeptChildListByParentId(@Param("eid") String eid, @Param("parentId") String parentId); List<QueryDeptChildDTO> getDeptChildListByParentId(@Param("parentId") String parentId);
void deleteByNotInIds(@Param("list") List<String> deptIdList, @Param("eid") String eid); void deleteByNotInIds(@Param("list") List<String> deptIdList);
List<SyncTreeNode> getSyncDeptTreeList(@Param("eid") String eid); List<SyncTreeNode> getSyncDeptTreeList();
List<SysDepartmentDO> selectAll(@Param("eid") String eid); List<SysDepartmentDO> selectAll();
} }

View File

@@ -17,17 +17,17 @@ public interface SysRoleMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-19 03:00 * dateTime:2023-05-19 03:00
*/ */
int insertSelective(@Param("record") SysRoleDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") SysRoleDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-19 03:00 * dateTime:2023-05-19 03:00
*/ */
int updateByPrimaryKeySelective(@Param("record") SysRoleDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") SysRoleDO record);
SysRoleDO getHighestPrioritySysRoleDoByUserId(@Param("enterpriseId") String enterpriseId, @Param("userId") String userId); SysRoleDO getHighestPrioritySysRoleDoByUserId(@Param("userId") String userId);
SysRoleDO getRoleByRoleEnum(@Param("eid") String enterpriseId, @Param("roleEnum") String roleEnum); SysRoleDO getRoleByRoleEnum(@Param("roleEnum") String roleEnum);
} }

View File

@@ -14,12 +14,12 @@ public interface SysRoleMenuMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-19 03:01 * dateTime:2023-05-19 03:01
*/ */
int insertSelective(@Param("record") SysRoleMenuDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") SysRoleMenuDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-19 03:01 * dateTime:2023-05-19 03:01
*/ */
int updateByPrimaryKeySelective(@Param("record") SysRoleMenuDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") SysRoleMenuDO record);
} }

View File

@@ -1,39 +0,0 @@
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
*/
public interface UserAuthMappingMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-19 02:54
*/
int insertSelective(@Param("record") UserAuthMappingDO record, @Param("enterpriseId") String enterpriseId);
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* 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);
void deleteAuthMappingByIds(@Param("eid") String eid, @Param("ids") List<Long> ids);
List<Long> selectIdsByUserId(@Param("eid") String eid, @Param("userId") String userId);
void insertUserAuthMapping(@Param("eid") String eid, @Param("auth") UserAuthMappingDO auth);
void deleteAuthMappingByIdAndType(@Param("eid") String eid, @Param("ids") List<String> ids, @Param("type") String type);
}

View File

@@ -16,20 +16,20 @@ public interface UserRegionMappingMapper {
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null * 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-19 03:00 * dateTime:2023-05-19 03:00
*/ */
int insertSelective(@Param("record") UserRegionMappingDO record, @Param("enterpriseId") String enterpriseId); int insertSelective(@Param("record") UserRegionMappingDO record);
/** /**
* *
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的 * 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-19 03:00 * dateTime:2023-05-19 03:00
*/ */
int updateByPrimaryKeySelective(@Param("record") UserRegionMappingDO record, @Param("enterpriseId") String enterpriseId); int updateByPrimaryKeySelective(@Param("record") UserRegionMappingDO record);
void batchInsertRegionMapping(@Param("enterpriseId") String enterpriseId,@Param("userRegionMappingDOS") List<UserRegionMappingDO> userRegionMappingDOS); void batchInsertRegionMapping(@Param("userRegionMappingDOS") List<UserRegionMappingDO> userRegionMappingDOS);
void deletedByUserIds(@Param("enterpriseId") String enterpriseId,@Param("userIds") List<String> userIds); void deletedByUserIds(@Param("userIds") List<String> userIds);
List<UserRegionMappingDO> listUserRegionMappingByUserId(@Param("enterpriseId") String enterpriseId, @Param("userIds") List<String> userIds); List<UserRegionMappingDO> listUserRegionMappingByUserId(@Param("userIds") List<String> userIds);
void deletedByIds(@Param("enterpriseId") String enterpriseId,@Param("ids") List<Integer> ids); void deletedByIds(@Param("ids") List<Integer> ids);
} }

View File

@@ -1,118 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.EnterpriseUserDepartmentMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.EnterpriseUserDepartmentDO">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
<result column="department_id" jdbcType="VARCHAR" property="departmentId"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="is_has_auth" jdbcType="BIT" property="isHasAuth"/>
</resultMap>
<sql id="Base_Column_List">
id, user_id, department_id, create_time, update_time, is_has_auth
</sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into enterprise_user_department_${enterpriseId}
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.userId != null">
user_id,
</if>
<if test="record.departmentId != null">
department_id,
</if>
<if test="record.createTime != null">
create_time,
</if>
<if test="record.updateTime != null">
update_time,
</if>
<if test="record.isHasAuth != null">
is_has_auth,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.userId != null">
#{record.userId},
</if>
<if test="record.departmentId != null">
#{record.departmentId},
</if>
<if test="record.createTime != null">
#{record.createTime},
</if>
<if test="record.updateTime != null">
#{record.updateTime},
</if>
<if test="record.isHasAuth != null">
#{record.isHasAuth},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update enterprise_user_department_${enterpriseId}
<set>
<if test="record.userId != null">
user_id = #{record.userId},
</if>
<if test="record.departmentId != null">
department_id = #{record.departmentId},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
<if test="record.isHasAuth != null">
is_has_auth = #{record.isHasAuth},
</if>
</set>
where id = #{record.id}
</update>
<select id="getIdsByUserId" resultType="java.lang.Integer">
select id from enterprise_user_department_${eid} where user_id = #{userId} and is_has_auth = 0
</select>
<delete id="deleteByIdList">
delete from enterprise_user_department_${eid} where
<if test="list != null and list.size() > 0 ">
id in
<foreach collection="list" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</delete>
<select id="selectUserDeptByUserId"
resultType="com.cool.store.entity.EnterpriseUserDepartmentDO">
select
id,
user_id as userId,
department_id as departmentId,
create_time as createTime,
update_time as updateTime
from enterprise_user_department_${eid} where user_id = #{userId} and is_has_auth = 0
</select>
<insert id="batchInsert">
insert into enterprise_user_department_${eid}
(user_id, department_id, create_time, is_has_auth)
values
<foreach collection="deptUsers" item="deptUser" separator=",">
(#{deptUser.userId}, #{deptUser.departmentId}, now(), #{deptUser.isHasAuth})
</foreach>
</insert>
<select id="selectUserDeptAuthByUserId"
resultType="com.cool.store.entity.EnterpriseUserDepartmentDO">
select
id,
user_id as userId,
department_id as departmentId,
create_time as createTime,
update_time as updateTime
from enterprise_user_department_${eid} where user_id = #{userId} and is_has_auth = 1
</select>
</mapper>

View File

@@ -1,184 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.EnterpriseUserGroupMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.EnterpriseUserGroupDO">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="group_id" jdbcType="VARCHAR" property="groupId"/>
<result column="group_name" jdbcType="VARCHAR" property="groupName"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId"/>
<result column="deleted" jdbcType="BIT" property="deleted"/>
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.entity.EnterpriseUserGroupDO">
<result column="common_edit_userids" jdbcType="LONGVARCHAR" property="commonEditUserids"/>
</resultMap>
<sql id="Base_Column_List">
id, group_id, group_name, create_time, create_user_id, update_time, update_user_id,
deleted
</sql>
<sql id="Blob_Column_List">
common_edit_userids
</sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into enterprise_user_group_${enterpriseId}
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.groupId != null">
group_id,
</if>
<if test="record.groupName != null">
group_name,
</if>
<if test="record.createTime != null">
create_time,
</if>
<if test="record.createUserId != null">
create_user_id,
</if>
<if test="record.updateTime != null">
update_time,
</if>
<if test="record.updateUserId != null">
update_user_id,
</if>
<if test="record.deleted != null">
deleted,
</if>
<if test="record.commonEditUserids != null">
common_edit_userids,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.groupId != null">
#{record.groupId},
</if>
<if test="record.groupName != null">
#{record.groupName},
</if>
<if test="record.createTime != null">
#{record.createTime},
</if>
<if test="record.createUserId != null">
#{record.createUserId},
</if>
<if test="record.updateTime != null">
#{record.updateTime},
</if>
<if test="record.updateUserId != null">
#{record.updateUserId},
</if>
<if test="record.deleted != null">
#{record.deleted},
</if>
<if test="record.commonEditUserids != null">
#{record.commonEditUserids},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update enterprise_user_group_${enterpriseId}
<set>
<if test="record.groupId != null">
group_id = #{record.groupId},
</if>
<if test="record.groupName != null">
group_name = #{record.groupName},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.createUserId != null">
create_user_id = #{record.createUserId},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
<if test="record.updateUserId != null">
update_user_id = #{record.updateUserId},
</if>
<if test="record.deleted != null">
deleted = #{record.deleted},
</if>
<if test="record.commonEditUserids != null">
common_edit_userids = #{record.commonEditUserids},
</if>
</set>
where id = #{record.id}
</update>
<select id="countByGroupName" resultType="int">
select count(1)
from enterprise_user_group_${enterpriseId}
where group_name = #{groupName}
<if test="groupId != null">
and group_id != #{groupId}
</if>
and deleted = 0
</select>
<delete id="deleteByGroupIdList">
delete from enterprise_user_group_${enterpriseId}
where group_id in
<foreach collection="groupIdList" item="groupId" open="(" separator="," close=")">
#{groupId}
</foreach>
</delete>
<select id="listUserGroup" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from enterprise_user_group_${enterpriseId}
<if test="groupName != null and groupName !=''">
where group_name like concat('%',#{groupName},'%')
</if>
</select>
<select id="getByGroupId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from enterprise_user_group_${enterpriseId}
where group_id = #{groupId}
</select>
<select id="listByGroupIdList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from enterprise_user_group_${enterpriseId}
where group_id in
<foreach collection="groupIdList" item="groupId" open="(" separator="," close=")">
#{groupId}
</foreach>
</select>
<update id="updateByGroupId">
update enterprise_user_group_${enterpriseId}
<set>
<if test="record.groupId != null">
group_id = #{record.groupId},
</if>
<if test="record.groupName != null">
group_name = #{record.groupName},
</if>
<if test="record.commonEditUserids != null">
common_edit_userids = #{record.commonEditUserids},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.createUserId != null">
create_user_id = #{record.createUserId},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
<if test="record.updateUserId != null">
update_user_id = #{record.updateUserId},
</if>
<if test="record.deleted != null">
deleted = #{record.deleted},
</if>
</set>
where group_id = #{record.groupId}
</update>
</mapper>

View File

@@ -1,181 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.EnterpriseUserGroupMappingMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.EnterpriseUserGroupMappingDO">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
<result column="group_id" jdbcType="VARCHAR" property="groupId"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId"/>
<result column="deleted" jdbcType="BIT" property="deleted"/>
</resultMap>
<sql id="Base_Column_List">
id, user_id, group_id, create_time, create_user_id, update_time, update_user_id,
deleted
</sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into enterprise_user_group_mapping_${enterpriseId}
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.userId != null">
user_id,
</if>
<if test="record.groupId != null">
group_id,
</if>
<if test="record.createTime != null">
create_time,
</if>
<if test="record.createUserId != null">
create_user_id,
</if>
<if test="record.updateTime != null">
update_time,
</if>
<if test="record.updateUserId != null">
update_user_id,
</if>
<if test="record.deleted != null">
deleted,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.userId != null">
#{record.userId},
</if>
<if test="record.groupId != null">
#{record.groupId},
</if>
<if test="record.createTime != null">
#{record.createTime},
</if>
<if test="record.createUserId != null">
#{record.createUserId},
</if>
<if test="record.updateTime != null">
#{record.updateTime},
</if>
<if test="record.updateUserId != null">
#{record.updateUserId},
</if>
<if test="record.deleted != null">
#{record.deleted},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update enterprise_user_group_mapping_${enterpriseId}
<set>
<if test="record.userId != null">
user_id = #{record.userId},
</if>
<if test="record.groupId != null">
group_id = #{record.groupId},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.createUserId != null">
create_user_id = #{record.createUserId},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
<if test="record.updateUserId != null">
update_user_id = #{record.updateUserId},
</if>
<if test="record.deleted != null">
deleted = #{record.deleted},
</if>
</set>
where id = #{record.id}
</update>
<delete id="deleteUserGroupMappingByGroupId">
delete from enterprise_user_group_mapping_${enterpriseId}
where group_id in (#{groupId})
</delete>
<insert id="batchInsertMapping">
insert into enterprise_user_group_mapping_${enterpriseId}
(
group_id,
user_id
)
values
<foreach collection="userIdList" separator="," item="userId">
(
#{groupId},
#{userId}
)
</foreach>
</insert>
<delete id="deleteMappingByGroupIdList">
delete from enterprise_user_group_mapping_${enterpriseId}
where group_id = #{groupId}
<if test="userIdList != null and userIdList.size > 0">
<foreach collection="userIdList" open="and user_id in (" close=")" separator="," item="userId">
#{userId}
</foreach>
</if>
</delete>
<delete id="deleteMappingByUserIdList">
delete from enterprise_user_group_mapping_${enterpriseId}
where user_id in
<if test="userIdList != null and userIdList.size > 0">
<foreach collection="userIdList" open="(" close=")" separator="," item="userId">
#{userId}
</foreach>
</if>
</delete>
<select id="listByGroupIdList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from enterprise_user_group_mapping_${enterpriseId}
where group_id in (
<foreach collection="groupIdList" item="groupId" separator=",">
#{groupId}
</foreach>
)
</select>
<select id="listByUserIdList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from enterprise_user_group_mapping_${enterpriseId}
where user_id in (
<foreach collection="userIdList" item="userId" separator=",">
#{userId}
</foreach>
)
</select>
<insert id="batchInsertOrUpdateUserGroupMapping">
insert into enterprise_user_group_mapping_${enterpriseId}
(
user_id,
group_id,
create_time,
create_user_id,
update_time,
update_user_id
)
values
<foreach collection="userGroupMappingList" item="entity" separator=",">
(
#{entity.userId},
#{entity.groupId},
now(),
#{entity.createUserId},
now(),
#{entity.updateUserId}
)
</foreach>
ON DUPLICATE KEY UPDATE
update_time = now()
</insert>
</mapper>

View File

@@ -52,7 +52,7 @@
is_leader_in_depts, department, jobnumber, monitored_departments, departments, user_region_ids is_leader_in_depts, department, jobnumber, monitored_departments, departments, user_region_ids
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into enterprise_user_${enterpriseId} insert into enterprise_user
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.userId != null"> <if test="record.userId != null">
user_id, user_id,
@@ -275,7 +275,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update enterprise_user_${enterpriseId} update enterprise_user
<set> <set>
<if test="record.userId != null"> <if test="record.userId != null">
user_id = #{record.userId}, user_id = #{record.userId},
@@ -394,14 +394,14 @@
<include refid="Base_Column_List"/>, <include refid="Base_Column_List"/>,
<include refid="Blob_Column_List"/> <include refid="Blob_Column_List"/>
from from
enterprise_user_${enterpriseId} enterprise_user
where where
user_id = #{userId} user_id = #{userId}
</select> </select>
<insert id="batchInsertOrUpdate" parameterType="java.util.List"> <insert id="batchInsertOrUpdate" parameterType="java.util.List">
insert into enterprise_user_${eid} ( insert into enterprise_user (
id, id,
user_id, user_id,
`name`, `name`,
@@ -469,7 +469,7 @@
</insert> </insert>
<update id="batchUpdateDiffUserDiffRegionIds"> <update id="batchUpdateDiffUserDiffRegionIds">
update enterprise_user_${eid} update enterprise_user
set user_region_ids = set user_region_ids =
<foreach collection="list" item="item" index="index" separator=" " open="case user_id" close="end"> <foreach collection="list" item="item" index="index" separator=" " open="case user_id" close="end">
when #{item.userId} then #{item.userRegionIds} when #{item.userId} then #{item.userRegionIds}
@@ -493,9 +493,9 @@
u.avatar as avatar, u.avatar as avatar,
u.user_status as userStatus, u.user_status as userStatus,
u.unionid as unionid u.unionid as unionid
from enterprise_user_${eid} u from enterprise_user u
left join enterprise_user_role_${eid} ul on u.user_id=ul.user_id left join enterprise_user_role ul on u.user_id=ul.user_id
left join sys_role_${eid} r on ul.role_id=r.id left join sys_role r on ul.role_id=r.id
<where> <where>
u.active = true and u.user_id != 'a100000001' u.active = true and u.user_id != 'a100000001'
<if test="deptId !=null and deptId !=''"> <if test="deptId !=null and deptId !=''">
@@ -544,7 +544,7 @@
departments as departments, departments as departments,
user_status as userStatus, user_status as userStatus,
unionid unionid
from enterprise_user_${eid} from enterprise_user
<where> <where>
active = true and user_id != 'a100000001' active = true and user_id != 'a100000001'
<if test="deptId !=null and deptId !=''"> <if test="deptId !=null and deptId !=''">
@@ -588,7 +588,7 @@
`language`, `language`,
user_status as userStatus, user_status as userStatus,
subordinate_range as subordinateRange subordinate_range as subordinateRange
from enterprise_user_${eid} from enterprise_user
<where> <where>
user_id != 'a100000001' user_id != 'a100000001'
and and
@@ -615,8 +615,8 @@
u.departments as departments, u.departments as departments,
u.user_status as userStatus, u.user_status as userStatus,
u.unionid as unionid u.unionid as unionid
from enterprise_user_${eid} u from enterprise_user u
left join enterprise_user_group_mapping_${eid} ug on u.user_id=ug.user_id left join enterprise_user_group_mapping ug on u.user_id=ug.user_id
<where> <where>
ug.group_id = #{groupId} and u.active = true and u.user_id != 'a100000001' ug.group_id = #{groupId} and u.active = true and u.user_id != 'a100000001'
<if test="userName !=null and userName !=''"> <if test="userName !=null and userName !=''">
@@ -663,7 +663,7 @@
face_url as faceUrl, face_url as faceUrl,
create_time as createTime, create_time as createTime,
`language` as language `language` as language
from enterprise_user_${eid} where user_id != 'a100000001' from enterprise_user where user_id != 'a100000001'
<foreach collection="regionIdList" item="regionId" separator=" or " open="and (" close=" )"> <foreach collection="regionIdList" item="regionId" separator=" or " open="and (" close=" )">
user_region_ids like concat('%/', #{regionId}, '/%') user_region_ids like concat('%/', #{regionId}, '/%')
</foreach> </foreach>
@@ -671,7 +671,7 @@
</select> </select>
<update id="updateEnterpriseUser"> <update id="updateEnterpriseUser">
update enterprise_user_${eid} update enterprise_user
<set> <set>
<if test="enterpriseUserDO.name != null and enterpriseUserDO.name !=''">`name` = #{enterpriseUserDO.name},</if> <if test="enterpriseUserDO.name != null and enterpriseUserDO.name !=''">`name` = #{enterpriseUserDO.name},</if>
<if test="enterpriseUserDO.tel != null and enterpriseUserDO.tel !=''">`tel` = #{enterpriseUserDO.tel},</if> <if test="enterpriseUserDO.tel != null and enterpriseUserDO.tel !=''">`tel` = #{enterpriseUserDO.tel},</if>
@@ -760,20 +760,20 @@
</update> </update>
<select id="getMainAdminUserIds" resultType="string"> <select id="getMainAdminUserIds" resultType="string">
select user_id from enterprise_user_${eid} where main_admin = true and active = true select user_id from enterprise_user where main_admin = true and active = true
</select> </select>
<select id="selectSpecifyNodeUserIds" resultType="string"> <select id="selectSpecifyNodeUserIds" resultType="string">
select select
user_id user_id
from from
enterprise_user_${eid} enterprise_user
where where
departments like concat('%/',#{dingDeptId},'/%') departments like concat('%/',#{dingDeptId},'/%')
</select> </select>
<select id="selectAllUserIds" resultType="java.lang.String"> <select id="selectAllUserIds" resultType="java.lang.String">
select user_id as userId from enterprise_user_${eid} select user_id as userId from enterprise_user
</select> </select>
<select id="selectByUserIdIgnoreActive" resultType="com.cool.store.entity.EnterpriseUserDO"> <select id="selectByUserIdIgnoreActive" resultType="com.cool.store.entity.EnterpriseUserDO">
@@ -810,11 +810,11 @@
third_oa_unique_flag as thirdOaUniqueFlag, third_oa_unique_flag as thirdOaUniqueFlag,
subordinate_change as subordinateChange, subordinate_change as subordinateChange,
subordinate_range as subordinateRange subordinate_range as subordinateRange
from enterprise_user_${enterpriseId} where user_id = #{userId, jdbcType=VARCHAR} from enterprise_user where user_id = #{userId, jdbcType=VARCHAR}
</select> </select>
<insert id="insertEnterpriseUser"> <insert id="insertEnterpriseUser">
insert into enterprise_user_${eid} insert into enterprise_user
( `id`, ( `id`,
`user_id`, `user_id`,
`name`, `name`,

View File

@@ -12,7 +12,7 @@
id, role_id, user_id, create_time, update_time id, role_id, user_id, create_time, update_time
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into enterprise_user_role_${enterpriseId} insert into enterprise_user_role
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.roleId != null"> <if test="record.roleId != null">
role_id, role_id,
@@ -43,7 +43,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update enterprise_user_role_${enterpriseId} update enterprise_user_role
<set> <set>
<if test="record.roleId != null"> <if test="record.roleId != null">
role_id = #{record.roleId}, role_id = #{record.roleId},
@@ -62,7 +62,7 @@
</update> </update>
<insert id="insertBatchUserRole"> <insert id="insertBatchUserRole">
insert ignore into enterprise_user_role_${eid} insert ignore into enterprise_user_role
(role_id, user_id ,create_time) (role_id, user_id ,create_time)
values values
<foreach collection="userRoles" item="userRole" separator=","> <foreach collection="userRoles" item="userRole" separator=",">
@@ -78,7 +78,7 @@
b.role_auth as roleAuth, b.role_auth as roleAuth,
b.role_enum as roleEnum, b.role_enum as roleEnum,
b.priority as priority b.priority as priority
from enterprise_user_role_${eip} a left join sys_role_${eip} b on a.role_id=b.id from enterprise_user_role a left join sys_role b on a.role_id=b.id
<where> <where>
<if test="userIdList != null and userIdList.size>0"> <if test="userIdList != null and userIdList.size>0">
<foreach collection="userIdList" item="userId" separator="," open="a.user_id in (" close=")"> <foreach collection="userIdList" item="userId" separator="," open="a.user_id in (" close=")">
@@ -96,31 +96,31 @@
c.role_auth as roleAuth, c.role_auth as roleAuth,
c.source as source, c.source as source,
c.role_enum as roleEnum c.role_enum as roleEnum
from enterprise_user_role_${eip} b from enterprise_user_role b
left join sys_role_${eip} c on c.id = b.role_id left join sys_role c on c.id = b.role_id
where b.user_id = #{userId} where b.user_id = #{userId}
</select> </select>
<delete id="deleteBatchByPrimaryKey"> <delete id="deleteBatchByPrimaryKey">
delete from enterprise_user_role_${eid} where id in delete from enterprise_user_role where id in
<foreach item="id" collection="ids" open="(" separator="," close=")"> <foreach item="id" collection="ids" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
<select id="selectIdsByUserId" resultType="java.lang.Long"> <select id="selectIdsByUserId" resultType="java.lang.Long">
select id from enterprise_user_role_${eid} where user_id = #{userId} select id from enterprise_user_role where user_id = #{userId}
</select> </select>
<select id="selectByUserIdAndRoleId" resultMap="BaseResultMap"> <select id="selectByUserIdAndRoleId" resultMap="BaseResultMap">
select * from enterprise_user_role_${eid} select * from enterprise_user_role
where user_id = #{userId} and role_id = #{roleId} where user_id = #{userId} and role_id = #{roleId}
order by id asc order by id asc
limit 1 limit 1
</select> </select>
<insert id="save"> <insert id="save">
insert ignore into enterprise_user_role_${eid} insert ignore into enterprise_user_role
( (
`role_id`, `role_id`,
`user_id`, `user_id`,

View File

@@ -17,7 +17,7 @@
update_time, create_user_id, update_user_id update_time, create_user_id, update_user_id
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_advanced_setting_${enterpriseId} insert into hy_advanced_setting
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.partnerUrl != null"> <if test="record.partnerUrl != null">
partner_url, partner_url,
@@ -72,7 +72,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update hy_advanced_setting_${enterpriseId} update hy_advanced_setting
<set> <set>
<if test="record.partnerUrl != null"> <if test="record.partnerUrl != null">
partner_url = #{record.partnerUrl}, partner_url = #{record.partnerUrl},

View File

@@ -25,7 +25,7 @@
content content
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_content_info_${enterpriseId} insert into hy_content_info
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.contentTitle != null"> <if test="record.contentTitle != null">
content_title, content_title,
@@ -98,7 +98,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update hy_content_info_${enterpriseId} update hy_content_info
<set> <set>
<if test="record.contentTitle != null"> <if test="record.contentTitle != null">
content_title = #{record.contentTitle}, content_title = #{record.contentTitle},

View File

@@ -18,7 +18,7 @@
update_time, create_user_id, update_user_id update_time, create_user_id, update_user_id
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_intend_dev_zone_info_${enterpriseId} insert into hy_intend_dev_zone_info
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.zoneName != null"> <if test="record.zoneName != null">
zone_name, zone_name,
@@ -79,7 +79,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update hy_intend_dev_zone_info_${enterpriseId} update hy_intend_dev_zone_info
<set> <set>
<if test="record.zoneName != null"> <if test="record.zoneName != null">
zone_name = #{record.zoneName}, zone_name = #{record.zoneName},

View File

@@ -13,7 +13,7 @@
id, mapping_id, open_area_mapping_id, type, create_time, update_time id, mapping_id, open_area_mapping_id, type, create_time, update_time
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_intend_developement_mapping_${enterpriseId} insert into hy_intend_developement_mapping
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.mappingId != null"> <if test="record.mappingId != null">
mapping_id, mapping_id,
@@ -50,7 +50,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update hy_intend_developement_mapping_${enterpriseId} update hy_intend_developement_mapping
<set> <set>
<if test="record.mappingId != null"> <if test="record.mappingId != null">
mapping_id = #{record.mappingId}, mapping_id = #{record.mappingId},

View File

@@ -19,7 +19,7 @@
deleted, create_time, update_time, update_user_id deleted, create_time, update_time, update_user_id
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_open_area_info_${enterpriseId} insert into hy_open_area_info
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.parentId != null"> <if test="record.parentId != null">
parent_id, parent_id,
@@ -86,7 +86,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update hy_open_area_info_${enterpriseId} update hy_open_area_info
<set> <set>
<if test="record.parentId != null"> <if test="record.parentId != null">
parent_id = #{record.parentId}, parent_id = #{record.parentId},

View File

@@ -28,7 +28,7 @@
pass_reason, certify_file, create_time, update_time pass_reason, certify_file, create_time, update_time
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_partner_base_info_${enterpriseId} insert into hy_partner_base_info
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.partnerId != null"> <if test="record.partnerId != null">
partner_id, partner_id,
@@ -143,7 +143,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update hy_partner_base_info_${enterpriseId} update hy_partner_base_info
<set> <set>
<if test="record.partnerId != null"> <if test="record.partnerId != null">
partner_id = #{record.partnerId}, partner_id = #{record.partnerId},

View File

@@ -32,7 +32,7 @@
signer_real_control_relation_cert, create_time, update_time signer_real_control_relation_cert, create_time, update_time
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_partner_certification_info_${enterpriseId} insert into hy_partner_certification_info
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.partnerId != null"> <if test="record.partnerId != null">
partner_id, partner_id,
@@ -159,7 +159,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update hy_partner_certification_info_${enterpriseId} update hy_partner_certification_info
<set> <set>
<if test="record.partnerId != null"> <if test="record.partnerId != null">
partner_id = #{record.partnerId}, partner_id = #{record.partnerId},

View File

@@ -17,7 +17,7 @@
update_time update_time
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_partner_clerk_${enterpriseId} insert into hy_partner_clerk
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.partnerLineId != null"> <if test="record.partnerLineId != null">
partner_line_id, partner_line_id,
@@ -72,7 +72,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update hy_partner_clerk_${enterpriseId} update hy_partner_clerk
<set> <set>
<if test="record.partnerLineId != null"> <if test="record.partnerLineId != null">
partner_line_id = #{record.partnerLineId}, partner_line_id = #{record.partnerLineId},

View File

@@ -33,7 +33,7 @@
create_time, update_time create_time, update_time
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_partner_intent_info_${enterpriseId} insert into hy_partner_intent_info
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.partnerId != null"> <if test="record.partnerId != null">
partner_id, partner_id,
@@ -172,7 +172,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update hy_partner_intent_info_${enterpriseId} update hy_partner_intent_info
<set> <set>
<if test="record.partnerId != null"> <if test="record.partnerId != null">
partner_id = #{record.partnerId}, partner_id = #{record.partnerId},

View File

@@ -19,7 +19,7 @@
change_before_cpoy change_before_cpoy
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_partner_interview_log_${enterpriseId} insert into hy_partner_interview_log
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.partnerLineId != null"> <if test="record.partnerLineId != null">
partner_line_id, partner_line_id,
@@ -62,7 +62,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update hy_partner_interview_log_${enterpriseId} update hy_partner_interview_log
<set> <set>
<if test="record.partnerLineId != null"> <if test="record.partnerLineId != null">
partner_line_id = #{record.partnerLineId}, partner_line_id = #{record.partnerLineId},

View File

@@ -28,7 +28,7 @@
latest_log_message, pass_reason, certify_file, create_time, update_time latest_log_message, pass_reason, certify_file, create_time, update_time
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_partner_interview_${enterpriseId} insert into hy_partner_interview
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.status != null"> <if test="record.status != null">
status, status,
@@ -143,7 +143,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update hy_partner_interview_${enterpriseId} update hy_partner_interview
<set> <set>
<if test="record.status != null"> <if test="record.status != null">
status = #{record.status}, status = #{record.status},

View File

@@ -25,7 +25,7 @@
deleted, create_time, update_time deleted, create_time, update_time
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_partner_interview_plan_${enterpriseId} insert into hy_partner_interview_plan
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.partnerLineId != null"> <if test="record.partnerLineId != null">
partner_line_id, partner_line_id,
@@ -122,7 +122,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update hy_partner_interview_plan_${enterpriseId} update hy_partner_interview_plan
<set> <set>
<if test="record.partnerLineId != null"> <if test="record.partnerLineId != null">
partner_line_id = #{record.partnerLineId}, partner_line_id = #{record.partnerLineId},

View File

@@ -28,7 +28,7 @@
close_user_id close_user_id
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_partner_line_info_${enterpriseId} insert into hy_partner_line_info
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.partnerId != null"> <if test="record.partnerId != null">
partner_id, partner_id,
@@ -137,7 +137,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update hy_partner_line_info_${enterpriseId} update hy_partner_line_info
<set> <set>
<if test="record.partnerId != null"> <if test="record.partnerId != null">
partner_id = #{record.partnerId}, partner_id = #{record.partnerId},

View File

@@ -24,7 +24,7 @@
field_copy field_copy
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_partner_task_info_log_${enterpriseId} insert into hy_partner_task_info_log
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.partnerLineId != null"> <if test="record.partnerLineId != null">
partner_line_id, partner_line_id,
@@ -91,7 +91,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update hy_partner_task_info_log_${enterpriseId} update hy_partner_task_info_log
<set> <set>
<if test="record.partnerLineId != null"> <if test="record.partnerLineId != null">
partner_line_id = #{record.partnerLineId}, partner_line_id = #{record.partnerLineId},

View File

@@ -19,7 +19,7 @@
invite_code, is_write_partner_know, create_time, update_time invite_code, is_write_partner_know, create_time, update_time
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_partner_user_info_${enterpriseId} insert into hy_partner_user_info
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.partnerId != null"> <if test="record.partnerId != null">
partner_id, partner_id,
@@ -86,7 +86,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update hy_partner_user_info_${enterpriseId} update hy_partner_user_info
<set> <set>
<if test="record.partnerId != null"> <if test="record.partnerId != null">
partner_id = #{record.partnerId}, partner_id = #{record.partnerId},

View File

@@ -14,7 +14,7 @@
id, platform_type, platform_user_id, bind_time, partner_id, create_time, update_time id, platform_type, platform_user_id, bind_time, partner_id, create_time, update_time
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_partner_user_platform_bind_${enterpriseId} insert into hy_partner_user_platform_bind
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.platformType != null"> <if test="record.platformType != null">
platform_type, platform_type,
@@ -57,7 +57,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update hy_partner_user_platform_bind_${enterpriseId} update hy_partner_user_platform_bind
<set> <set>
<if test="record.platformType != null"> <if test="record.platformType != null">
platform_type = #{record.platformType}, platform_type = #{record.platformType},

View File

@@ -13,7 +13,7 @@
id, stage_code, stage_name, stage_order, create_time, update_time id, stage_code, stage_name, stage_order, create_time, update_time
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into hy_workflow_stage_${enterpriseId} insert into hy_workflow_stage
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.stageCode != null"> <if test="record.stageCode != null">
stage_code, stage_code,
@@ -50,7 +50,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update hy_workflow_stage_${enterpriseId} update hy_workflow_stage
<set> <set>
<if test="record.stageCode != null"> <if test="record.stageCode != null">
stage_code = #{record.stageCode}, stage_code = #{record.stageCode},

View File

@@ -10,7 +10,7 @@
id, user_id, create_time id, user_id, create_time
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into login_record_${enterpriseId} insert into login_record
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.userId != null"> <if test="record.userId != null">
user_id, user_id,
@@ -29,7 +29,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update login_record_${enterpriseId} update login_record
<set> <set>
<if test="record.userId != null"> <if test="record.userId != null">
user_id = #{record.userId}, user_id = #{record.userId},

View File

@@ -28,7 +28,7 @@
store_num, store_id, unclassified_flag, order_num, third_dept_id store_num, store_id, unclassified_flag, order_num, third_dept_id
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into region_${enterpriseId} insert into region
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.regionId != null"> <if test="record.regionId != null">
region_id, region_id,
@@ -143,7 +143,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update region_${enterpriseId} update region
<set> <set>
<if test="record.regionId != null"> <if test="record.regionId != null">
region_id = #{record.regionId}, region_id = #{record.regionId},
@@ -207,7 +207,7 @@
<select id="selectRegionIdsBySynDingDeptIds" resultType="java.lang.Long"> <select id="selectRegionIdsBySynDingDeptIds" resultType="java.lang.Long">
select select
id id
from region_${eid} from region
where where
deleted = 0 and syn_ding_dept_id in deleted = 0 and syn_ding_dept_id in
<foreach collection="synDingDeptIds" item="item" separator="," open="(" close=")"> <foreach collection="synDingDeptIds" item="item" separator="," open="(" close=")">
@@ -231,7 +231,7 @@
store_num as storeNum, store_num as storeNum,
store_id as storeId, store_id as storeId,
region_type as regionType region_type as regionType
from region_${eid} where id in from region where id in
<foreach collection="regionIds" index="index" item="regionId" <foreach collection="regionIds" index="index" item="regionId"
separator="," open="(" close=")"> separator="," open="(" close=")">
#{regionId, jdbcType=BIGINT} #{regionId, jdbcType=BIGINT}
@@ -257,13 +257,13 @@
region_path as regionPath, region_path as regionPath,
store_num as storeNum, store_num as storeNum,
unclassified_flag as unclassifiedFlag unclassified_flag as unclassifiedFlag
from region_${enterpriseId} from region
where deleted = 0 and unclassified_flag = 1 where deleted = 0 and unclassified_flag = 1
and (name = #{name} or id = 1) limit 1 and (name = #{name} or id = 1) limit 1
</select> </select>
<insert id="insertRoot"> <insert id="insertRoot">
insert ignore into region_${eid} insert ignore into region
( (
id, id,
region_id, region_id,
@@ -295,7 +295,7 @@
</insert> </insert>
<insert id="batchInsertRegionsByDepartments"> <insert id="batchInsertRegionsByDepartments">
insert into region_${eid} insert into region
( (
id, id,
name, name,
@@ -333,7 +333,7 @@
select select
id, id,
syn_ding_dept_id syn_ding_dept_id
from region_${eid} from region
where deleted = 0 and syn_ding_dept_id in ( where deleted = 0 and syn_ding_dept_id in (
<foreach collection="synDingDeptIds" item="item" separator=","> <foreach collection="synDingDeptIds" item="item" separator=",">
#{item} #{item}
@@ -357,7 +357,7 @@
region_path as regionPath, region_path as regionPath,
deleted as deleted, deleted as deleted,
third_dept_id as thirdDeptId third_dept_id as thirdDeptId
from region_${eid} from region
where deleted = 0 and id > 0 where deleted = 0 and id > 0
and region_type != 'store' and region_type != 'store'
</select> </select>
@@ -378,7 +378,7 @@
deleted as deleted, deleted as deleted,
region_path as regionPath, region_path as regionPath,
store_id as storeId store_id as storeId
from region_${eid} from region
where region_type = 'store' where region_type = 'store'
and id in ( and id in (
<foreach collection="regionIds" item="item" separator=","> <foreach collection="regionIds" item="item" separator=",">
@@ -404,7 +404,7 @@
region_path as regionPath, region_path as regionPath,
deleted, deleted,
store_num as storeNum store_num as storeNum
from region_${eid} from region
where id = #{regionId} where id = #{regionId}
</select> </select>
@@ -423,11 +423,11 @@
region_type as regionType, region_type as regionType,
region_path as regionPath, region_path as regionPath,
store_num as storeCount store_num as storeCount
from region_${eid} where id = #{regionId, jdbcType=BIGINT} and deleted = 0 from region where id = #{regionId, jdbcType=BIGINT} and deleted = 0
</select> </select>
<insert id="insertOrUpdate" useGeneratedKeys="true" keyProperty="record.id"> <insert id="insertOrUpdate" useGeneratedKeys="true" keyProperty="record.id">
insert into region_${eid} insert into region
( (
id, id,
name, name,
@@ -460,7 +460,7 @@
select select
id , id ,
syn_ding_dept_id as synDingDeptId syn_ding_dept_id as synDingDeptId
from region_${eid} from region
where (id > 0 or id = -3) and (deleted = 0 or syn_ding_dept_id is not null) where (id > 0 or id = -3) and (deleted = 0 or syn_ding_dept_id is not null)
<if test="parentId!=null"> <if test="parentId!=null">
and region_path like concat('%/',#{parentId},'/%') and region_path like concat('%/',#{parentId},'/%')
@@ -481,7 +481,7 @@
syn_ding_dept_id as synDingDeptId, syn_ding_dept_id as synDingDeptId,
region_type as regionType, region_type as regionType,
deleted as deleted deleted as deleted
from region_${eid} from region
where deleted = 0 where deleted = 0
and syn_ding_dept_id in ( and syn_ding_dept_id in (
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
@@ -507,12 +507,12 @@
region_path as regionPath, region_path as regionPath,
deleted, deleted,
store_num as storeNum store_num as storeNum
from region_${eid} from region
where syn_ding_dept_id = #{synDingDeptId} where syn_ding_dept_id = #{synDingDeptId}
</select> </select>
<insert id="ignoreInsert" keyColumn="id" keyProperty="region.id" useGeneratedKeys="true"> <insert id="ignoreInsert" keyColumn="id" keyProperty="region.id" useGeneratedKeys="true">
insert ignore into region_${eid} insert ignore into region
( (
region_id, region_id,
name, name,
@@ -554,12 +554,12 @@
<if test="region.synDingDeptId !=null and region.synDingDeptId!=''"> <if test="region.synDingDeptId !=null and region.synDingDeptId!=''">
,#{region.synDingDeptId} ,#{region.synDingDeptId}
</if> </if>
,(SELECT max(order_num)+1 FROM region_${eid} AS num) ,(SELECT max(order_num)+1 FROM region AS num)
) )
</insert> </insert>
<update id="updateSyncRegion" > <update id="updateSyncRegion" >
update region_${eid} update region
set `parent_id` = #{item.parentId}, set `parent_id` = #{item.parentId},
`name` = #{item.name}, `name` = #{item.name},
<if test="item.regionType != null and item.regionType != ''"> <if test="item.regionType != null and item.regionType != ''">
@@ -575,7 +575,7 @@
</update> </update>
<update id="removeRegions"> <update id="removeRegions">
update region_${eid} update region
set set
deleted = 1, deleted = 1,
parent_id = -1 parent_id = -1

View File

@@ -1,637 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.StoreMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.StoreDO">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="store_id" jdbcType="VARCHAR" property="storeId"/>
<result column="store_name" jdbcType="VARCHAR" property="storeName"/>
<result column="store_num" jdbcType="VARCHAR" property="storeNum"/>
<result column="avatar" jdbcType="VARCHAR" property="avatar"/>
<result column="ding_id" jdbcType="VARCHAR" property="dingId"/>
<result column="region_id" jdbcType="BIGINT" property="regionId"/>
<result column="province" jdbcType="VARCHAR" property="province"/>
<result column="city" jdbcType="VARCHAR" property="city"/>
<result column="county" jdbcType="VARCHAR" property="county"/>
<result column="store_address" jdbcType="VARCHAR" property="storeAddress"/>
<result column="location_address" jdbcType="VARCHAR" property="locationAddress"/>
<result column="is_lock" jdbcType="CHAR" property="isLock"/>
<result column="longitude_latitude" jdbcType="VARCHAR" property="longitudeLatitude"/>
<result column="longitude" jdbcType="VARCHAR" property="longitude"/>
<result column="latitude" jdbcType="VARCHAR" property="latitude"/>
<result column="is_delete" jdbcType="CHAR" property="isDelete"/>
<result column="telephone" jdbcType="VARCHAR" property="telephone"/>
<result column="business_hours" jdbcType="VARCHAR" property="businessHours"/>
<result column="store_acreage" jdbcType="VARCHAR" property="storeAcreage"/>
<result column="store_bandwidth" jdbcType="VARCHAR" property="storeBandwidth"/>
<result column="create_time" jdbcType="BIGINT" property="createTime"/>
<result column="create_name" jdbcType="VARCHAR" property="createName"/>
<result column="create_user" jdbcType="VARCHAR" property="createUser"/>
<result column="update_time" jdbcType="BIGINT" property="updateTime"/>
<result column="update_name" jdbcType="VARCHAR" property="updateName"/>
<result column="update_user" jdbcType="VARCHAR" property="updateUser"/>
<result column="aliyun_corp_id" jdbcType="VARCHAR" property="aliyunCorpId"/>
<result column="source" jdbcType="VARCHAR" property="source"/>
<result column="vds_corp_id" jdbcType="VARCHAR" property="vdsCorpId"/>
<result column="syn_ding_dept_id" jdbcType="VARCHAR" property="synDingDeptId"/>
<result column="region_path" jdbcType="VARCHAR" property="regionPath"/>
<result column="has_camera" jdbcType="BIT" property="hasCamera"/>
<result column="store_status" jdbcType="CHAR" property="storeStatus"/>
<result column="third_dept_id" jdbcType="VARCHAR" property="thirdDeptId"/>
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.entity.StoreDO">
<result column="remark" jdbcType="LONGVARCHAR" property="remark"/>
<result column="extend_field" jdbcType="LONGVARCHAR" property="extendField"/>
<result column="address_point" jdbcType="BINARY" property="addressPoint"/>
</resultMap>
<sql id="Base_Column_List">
id, store_id, store_name, store_num, avatar, ding_id, region_id, province, city,
county, store_address, location_address, is_lock, longitude_latitude, longitude,
latitude, is_delete, telephone, business_hours, store_acreage, store_bandwidth, create_time,
create_name, create_user, update_time, update_name, update_user, aliyun_corp_id,
source, vds_corp_id, syn_ding_dept_id, region_path, has_camera, store_status, third_dept_id
</sql>
<sql id="Blob_Column_List">
remark, extend_field, address_point
</sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into store_${enterpriseId}
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.storeId != null">
store_id,
</if>
<if test="record.storeName != null">
store_name,
</if>
<if test="record.storeNum != null">
store_num,
</if>
<if test="record.avatar != null">
avatar,
</if>
<if test="record.dingId != null">
ding_id,
</if>
<if test="record.regionId != null">
region_id,
</if>
<if test="record.province != null">
province,
</if>
<if test="record.city != null">
city,
</if>
<if test="record.county != null">
county,
</if>
<if test="record.storeAddress != null">
store_address,
</if>
<if test="record.locationAddress != null">
location_address,
</if>
<if test="record.isLock != null">
is_lock,
</if>
<if test="record.longitudeLatitude != null">
longitude_latitude,
</if>
<if test="record.longitude != null">
longitude,
</if>
<if test="record.latitude != null">
latitude,
</if>
<if test="record.isDelete != null">
is_delete,
</if>
<if test="record.telephone != null">
telephone,
</if>
<if test="record.businessHours != null">
business_hours,
</if>
<if test="record.storeAcreage != null">
store_acreage,
</if>
<if test="record.storeBandwidth != null">
store_bandwidth,
</if>
<if test="record.createTime != null">
create_time,
</if>
<if test="record.createName != null">
create_name,
</if>
<if test="record.createUser != null">
create_user,
</if>
<if test="record.updateTime != null">
update_time,
</if>
<if test="record.updateName != null">
update_name,
</if>
<if test="record.updateUser != null">
update_user,
</if>
<if test="record.aliyunCorpId != null">
aliyun_corp_id,
</if>
<if test="record.source != null">
source,
</if>
<if test="record.vdsCorpId != null">
vds_corp_id,
</if>
<if test="record.synDingDeptId != null">
syn_ding_dept_id,
</if>
<if test="record.regionPath != null">
region_path,
</if>
<if test="record.hasCamera != null">
has_camera,
</if>
<if test="record.storeStatus != null">
store_status,
</if>
<if test="record.thirdDeptId != null">
third_dept_id,
</if>
<if test="record.remark != null">
remark,
</if>
<if test="record.extendField != null">
extend_field,
</if>
<if test="record.addressPoint != null">
address_point,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.storeId != null">
#{record.storeId},
</if>
<if test="record.storeName != null">
#{record.storeName},
</if>
<if test="record.storeNum != null">
#{record.storeNum},
</if>
<if test="record.avatar != null">
#{record.avatar},
</if>
<if test="record.dingId != null">
#{record.dingId},
</if>
<if test="record.regionId != null">
#{record.regionId},
</if>
<if test="record.province != null">
#{record.province},
</if>
<if test="record.city != null">
#{record.city},
</if>
<if test="record.county != null">
#{record.county},
</if>
<if test="record.storeAddress != null">
#{record.storeAddress},
</if>
<if test="record.locationAddress != null">
#{record.locationAddress},
</if>
<if test="record.isLock != null">
#{record.isLock},
</if>
<if test="record.longitudeLatitude != null">
#{record.longitudeLatitude},
</if>
<if test="record.longitude != null">
#{record.longitude},
</if>
<if test="record.latitude != null">
#{record.latitude},
</if>
<if test="record.isDelete != null">
#{record.isDelete},
</if>
<if test="record.telephone != null">
#{record.telephone},
</if>
<if test="record.businessHours != null">
#{record.businessHours},
</if>
<if test="record.storeAcreage != null">
#{record.storeAcreage},
</if>
<if test="record.storeBandwidth != null">
#{record.storeBandwidth},
</if>
<if test="record.createTime != null">
#{record.createTime},
</if>
<if test="record.createName != null">
#{record.createName},
</if>
<if test="record.createUser != null">
#{record.createUser},
</if>
<if test="record.updateTime != null">
#{record.updateTime},
</if>
<if test="record.updateName != null">
#{record.updateName},
</if>
<if test="record.updateUser != null">
#{record.updateUser},
</if>
<if test="record.aliyunCorpId != null">
#{record.aliyunCorpId},
</if>
<if test="record.source != null">
#{record.source},
</if>
<if test="record.vdsCorpId != null">
#{record.vdsCorpId},
</if>
<if test="record.synDingDeptId != null">
#{record.synDingDeptId},
</if>
<if test="record.regionPath != null">
#{record.regionPath},
</if>
<if test="record.hasCamera != null">
#{record.hasCamera},
</if>
<if test="record.storeStatus != null">
#{record.storeStatus},
</if>
<if test="record.thirdDeptId != null">
#{record.thirdDeptId},
</if>
<if test="record.remark != null">
#{record.remark},
</if>
<if test="record.extendField != null">
#{record.extendField},
</if>
<if test="record.addressPoint != null">
#{record.addressPoint},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update store_${enterpriseId}
<set>
<if test="record.storeId != null">
store_id = #{record.storeId},
</if>
<if test="record.storeName != null">
store_name = #{record.storeName},
</if>
<if test="record.storeNum != null">
store_num = #{record.storeNum},
</if>
<if test="record.avatar != null">
avatar = #{record.avatar},
</if>
<if test="record.dingId != null">
ding_id = #{record.dingId},
</if>
<if test="record.regionId != null">
region_id = #{record.regionId},
</if>
<if test="record.province != null">
province = #{record.province},
</if>
<if test="record.city != null">
city = #{record.city},
</if>
<if test="record.county != null">
county = #{record.county},
</if>
<if test="record.storeAddress != null">
store_address = #{record.storeAddress},
</if>
<if test="record.locationAddress != null">
location_address = #{record.locationAddress},
</if>
<if test="record.isLock != null">
is_lock = #{record.isLock},
</if>
<if test="record.longitudeLatitude != null">
longitude_latitude = #{record.longitudeLatitude},
</if>
<if test="record.longitude != null">
longitude = #{record.longitude},
</if>
<if test="record.latitude != null">
latitude = #{record.latitude},
</if>
<if test="record.isDelete != null">
is_delete = #{record.isDelete},
</if>
<if test="record.telephone != null">
telephone = #{record.telephone},
</if>
<if test="record.businessHours != null">
business_hours = #{record.businessHours},
</if>
<if test="record.storeAcreage != null">
store_acreage = #{record.storeAcreage},
</if>
<if test="record.storeBandwidth != null">
store_bandwidth = #{record.storeBandwidth},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.createName != null">
create_name = #{record.createName},
</if>
<if test="record.createUser != null">
create_user = #{record.createUser},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
<if test="record.updateName != null">
update_name = #{record.updateName},
</if>
<if test="record.updateUser != null">
update_user = #{record.updateUser},
</if>
<if test="record.aliyunCorpId != null">
aliyun_corp_id = #{record.aliyunCorpId},
</if>
<if test="record.source != null">
source = #{record.source},
</if>
<if test="record.vdsCorpId != null">
vds_corp_id = #{record.vdsCorpId},
</if>
<if test="record.synDingDeptId != null">
syn_ding_dept_id = #{record.synDingDeptId},
</if>
<if test="record.regionPath != null">
region_path = #{record.regionPath},
</if>
<if test="record.hasCamera != null">
has_camera = #{record.hasCamera},
</if>
<if test="record.storeStatus != null">
store_status = #{record.storeStatus},
</if>
<if test="record.thirdDeptId != null">
third_dept_id = #{record.thirdDeptId},
</if>
<if test="record.remark != null">
remark = #{record.remark},
</if>
<if test="record.extendField != null">
extend_field = #{record.extendField},
</if>
<if test="record.addressPoint != null">
address_point = #{record.addressPoint},
</if>
</set>
where id = #{record.id}
</update>
<select id="listStoreByRegionIdList" resultType="com.cool.store.dto.store.StoreAreaDTO">
select
store_name as storeName,
store_id as storeId,
region_path as regionPath,
region_id as areaId,
region_id as regionId
from store_${eid}
where is_delete = 'effective'
<foreach collection="regionIdList" item="regionId" separator=" or " open="and (" close=" )">
region_path like concat('%/', #{regionId}, '/%')
</foreach>
</select>
<select id="getStoreListByStoreIds" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from store_${enterpriseId}
where is_delete = 'effective'
and store_id in (
<foreach collection="storeIdList" separator="," item="item">
#{item}
</foreach>
)
</select>
<select id="listStoreByRegionIdListNotChild" resultType="com.cool.store.dto.store.StoreAreaDTO">
select
store_name as storeName,
store_id as storeId,
region_path as regionPath,
region_id as regionId,
region_id as areaId
from store_${eid}
where is_delete = 'effective'
<if test="regionIdList != null and regionIdList.size >0 ">
and region_id in
<foreach collection="regionIdList" item="regionId" separator="," open="(" close=" )">
#{regionId}
</foreach>
</if>
</select>
<select id="countStore" resultType="java.lang.Integer">
select count(store_id) from store_${eid}
where is_delete ='effective'
</select>
<select id="listStoreIdList" resultType="java.lang.String">
select store_id from store_${eid}
where is_delete ='effective'
</select>
<select id="getSpecifiedStoreIdsAndDeptId" resultType="com.cool.store.dto.region.RegionSyncDTO">
select
id,
syn_ding_dept_id as synDingDeptId
from store_${eid}
where 1=1
<if test="isDelete!=null and isDelete!=''">
and (is_delete=#{isDelete} or syn_ding_dept_id is not null)
</if>
<if test="parentId!=null and parentId!=''">
and region_path like concat('%/',#{parentId},'/%')
</if>
</select>
<select id="getStoreBySynId" resultMap="BaseResultMap">
select * from store_${eid} where syn_ding_dept_id = #{synId}
</select>
<insert id="insertStore">
insert into store_${enterpriseId}
(
store_id,
store_name,
store_num,
region_id,
avatar,
province,
city,
county,
store_address,
location_address,
is_lock,
longitude_latitude,
longitude,
latitude,
is_delete,
telephone,
business_hours,
store_acreage,
store_bandwidth,
create_time,
create_name,
remark,
region_path,
extend_field,
syn_ding_dept_id,
source,
store_status,
address_point
)
values
(
#{storeDO.storeId},
#{storeDO.storeName},
#{storeDO.storeNum},
#{storeDO.regionId},
#{storeDO.avatar},
#{storeDO.province},
#{storeDO.city},
#{storeDO.county},
#{storeDO.storeAddress},
#{storeDO.locationAddress},
#{storeDO.isLock,jdbcType=CHAR},
#{storeDO.longitudeLatitude},
#{storeDO.longitude},
#{storeDO.latitude},
#{storeDO.isDelete,jdbcType=CHAR},
#{storeDO.telephone},
#{storeDO.businessHours},
#{storeDO.storeAcreage},
#{storeDO.storeBandwidth},
#{storeDO.createTime},
#{storeDO.createName},
#{storeDO.remark},
#{storeDO.regionPath},
#{storeDO.extendField},
#{storeDO.synDingDeptId},
#{storeDO.source},
#{storeDO.storeStatus},
ST_GeomFromText(#{storeDO.addressPoint})
)
</insert>
<update id="updateStore">
update store_${enterpriseId} set
<trim suffixOverrides=",">
<if test="storeDO.storeName != null ">
store_name = #{storeDO.storeName},
</if>
<if test="storeDO.storeNum != null ">
store_num = #{storeDO.storeNum},
</if>
<if test="storeDO.regionPath!= null ">
region_path = #{storeDO.regionPath},
</if>
<if test="storeDO.regionId!= null and storeDO.regionId != 0 ">
region_id = #{storeDO.regionId},
</if>
<if test="storeDO.avatar!= null ">
avatar = #{storeDO.avatar},
</if>
<if test="storeDO.province!= null ">
province = #{storeDO.province},
</if>
<if test="storeDO.city!= null ">
city = #{storeDO.city},
</if>
<if test="storeDO.county!= null ">
county = #{storeDO.county},
</if>
<if test="storeDO.storeAddress!= null ">
store_address = #{storeDO.storeAddress},
</if>
<if test="storeDO.locationAddress!= null ">
location_address = #{storeDO.locationAddress},
</if>
<if test="storeDO.longitudeLatitude!= null ">
longitude_latitude = #{storeDO.longitudeLatitude},
</if>
<if test="storeDO.longitude!= null ">
longitude = #{storeDO.longitude},
</if>
<if test="storeDO.latitude!= null ">
latitude = #{storeDO.latitude},
</if>
<if test="storeDO.addressPoint!= null ">
address_point = ST_GeomFromText(#{storeDO.addressPoint}),
</if>
<if test="storeDO.telephone!= null ">
telephone = #{storeDO.telephone},
</if>
<if test="storeDO.businessHours!= null ">
business_hours = #{storeDO.businessHours},
</if>
<if test="storeDO.storeAcreage!= null ">
store_acreage = #{storeDO.storeAcreage},
</if>
<if test="storeDO.storeBandwidth!= null ">
store_bandwidth = #{storeDO.storeBandwidth},
</if>
<if test="storeDO.updateTime != null ">
update_time = #{storeDO.updateTime},
</if>
<if test="storeDO.updateName != null ">
update_name = #{storeDO.updateName},
</if>
<if test="storeDO.remark!= null ">
remark = #{storeDO.remark},
</if>
<if test="storeDO.isDelete != null ">
is_delete = #{storeDO.isDelete},
</if>
<if test="storeDO.storeStatus != null ">
store_status = #{storeDO.storeStatus},
</if>
<if test="storeDO.extendField != null ">
extend_field = #{storeDO.extendField}
</if>
</trim>
where store_id=#{storeDO.storeId}
</update>
<select id="getStoreIdByIdList" resultType="java.lang.String">
select store_id from store_${eid}
where id in
<foreach collection="ids" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</select>
<update id="deleteStoreByStoreIds">
update store_${enterpriseId}
set is_delete='invalid',
update_name=#{userId, jdbcType=VARCHAR},
update_time=#{updateTime, jdbcType=BIGINT}
where store_id in
<foreach collection="storeIds" item="storeId" separator="," open="(" close=")">
#{storeId, jdbcType=VARCHAR}
</foreach>
</update>
</mapper>

View File

@@ -1,178 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.SubordinateMappingMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.SubordinateMappingDO">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
<result column="region_id" jdbcType="VARCHAR" property="regionId"/>
<result column="personal_id" jdbcType="VARCHAR" property="personalId"/>
<result column="type" jdbcType="TINYINT" property="type"/>
<result column="create_id" jdbcType="VARCHAR" property="createId"/>
<result column="create_time" jdbcType="BIGINT" property="createTime"/>
<result column="update_id" jdbcType="VARCHAR" property="updateId"/>
<result column="update_time" jdbcType="BIGINT" property="updateTime"/>
<result column="user_range" jdbcType="VARCHAR" property="userRange"/>
<result column="source" jdbcType="VARCHAR" property="source"/>
</resultMap>
<sql id="Base_Column_List">
id, user_id, region_id, personal_id, type, create_id, create_time, update_id, update_time,
user_range, source
</sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into subordinate_mapping_${enterpriseId}
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.userId != null">
user_id,
</if>
<if test="record.regionId != null">
region_id,
</if>
<if test="record.personalId != null">
personal_id,
</if>
<if test="record.type != null">
type,
</if>
<if test="record.createId != null">
create_id,
</if>
<if test="record.createTime != null">
create_time,
</if>
<if test="record.updateId != null">
update_id,
</if>
<if test="record.updateTime != null">
update_time,
</if>
<if test="record.userRange != null">
user_range,
</if>
<if test="record.source != null">
source,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.userId != null">
#{record.userId},
</if>
<if test="record.regionId != null">
#{record.regionId},
</if>
<if test="record.personalId != null">
#{record.personalId},
</if>
<if test="record.type != null">
#{record.type},
</if>
<if test="record.createId != null">
#{record.createId},
</if>
<if test="record.createTime != null">
#{record.createTime},
</if>
<if test="record.updateId != null">
#{record.updateId},
</if>
<if test="record.updateTime != null">
#{record.updateTime},
</if>
<if test="record.userRange != null">
#{record.userRange},
</if>
<if test="record.source != null">
#{record.source},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update subordinate_mapping_${enterpriseId}
<set>
<if test="record.userId != null">
user_id = #{record.userId},
</if>
<if test="record.regionId != null">
region_id = #{record.regionId},
</if>
<if test="record.personalId != null">
personal_id = #{record.personalId},
</if>
<if test="record.type != null">
type = #{record.type},
</if>
<if test="record.createId != null">
create_id = #{record.createId},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.updateId != null">
update_id = #{record.updateId},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
<if test="record.userRange != null">
user_range = #{record.userRange},
</if>
<if test="record.source != null">
source = #{record.source},
</if>
</set>
where id = #{record.id}
</update>
<select id="selectByUserIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from subordinate_mapping_${enterpriseId}
where user_id in
<foreach collection="userIds" open="(" close=")" separator="," item="userId">
#{userId}
</foreach>
and type = 0
</select>
<insert id="batchInsertSubordinateMapping">
insert into subordinate_mapping_${enterpriseId}
(
user_id,
region_id,
personal_id,
`type`,
create_id,
create_time,
update_id,
update_time,
user_range,
source
)
values
<foreach collection="subordinateMappingDOS" item="entity" separator=",">
(
#{entity.userId},
#{entity.regionId},
#{entity.personalId},
#{entity.type},
#{entity.createId},
now(),
#{entity.updateId},
now(),
#{entity.userRange},
#{entity.source}
)
</foreach>
</insert>
<delete id="deletedByUserIds">
delete from subordinate_mapping_${enterpriseId}
where
user_id in
<foreach collection="userIds" open="(" close=")" separator="," item="userId">
#{userId}
</foreach>
and type = 0
</delete>
</mapper>

View File

@@ -32,7 +32,7 @@
parent_ids, sub_ids parent_ids, sub_ids
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into sys_department_${enterpriseId} insert into sys_department
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.name != null"> <if test="record.name != null">
name, name,
@@ -141,7 +141,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update sys_department_${enterpriseId} update sys_department
<set> <set>
<if test="record.name != null"> <if test="record.name != null">
name = #{record.name}, name = #{record.name},
@@ -199,7 +199,7 @@
</update> </update>
<insert id="batchInsertOrUpdate" parameterType="java.util.List"> <insert id="batchInsertOrUpdate" parameterType="java.util.List">
insert into sys_department_${eid} insert into sys_department
( (
id, id,
name, name,
@@ -226,12 +226,12 @@
name, name,
depart_order as departOrder, depart_order as departOrder,
parent_id as parentId parent_id as parentId
from sys_department_${eid} from sys_department
where parent_id = #{parentId} where parent_id = #{parentId}
</select> </select>
<delete id="deleteByNotInIds"> <delete id="deleteByNotInIds">
delete from sys_department_${eid} delete from sys_department
where id not in where id not in
<foreach collection="list" item="item" open="(" separator="," close=")" > <foreach collection="list" item="item" open="(" separator="," close=")" >
#{item} #{item}
@@ -244,7 +244,7 @@
id, id,
name, name,
parent_id as pid parent_id as pid
from sys_department_${eid} from sys_department
</select> </select>
<select id="selectAll" resultType="com.cool.store.entity.SysDepartmentDO"> <select id="selectAll" resultType="com.cool.store.entity.SysDepartmentDO">
@@ -253,6 +253,6 @@
name, name,
parent_id as parentId, parent_id as parentId,
depart_order as departOrder depart_order as departOrder
from sys_department_${eid} from sys_department
</select> </select>
</mapper> </mapper>

View File

@@ -23,7 +23,7 @@
priority, create_time, update_time, role_enum, create_user, update_user, third_unique_id priority, create_time, update_time, role_enum, create_user, update_user, third_unique_id
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into sys_role_${enterpriseId} insert into sys_role
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.roleName != null"> <if test="record.roleName != null">
role_name, role_name,
@@ -114,7 +114,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update sys_role_${enterpriseId} update sys_role
<set> <set>
<if test="record.roleName != null"> <if test="record.roleName != null">
role_name = #{record.roleName}, role_name = #{record.roleName},
@@ -171,9 +171,9 @@
c.app_menu as appMenu, c.app_menu as appMenu,
c.role_enum as roleEnum c.role_enum as roleEnum
from from
enterprise_user_${enterpriseId} a enterprise_user a
left join enterprise_user_role_${enterpriseId} b on a.user_id =b.user_id left join enterprise_user_role b on a.user_id =b.user_id
left join sys_role_${enterpriseId} c on c.id=b.role_id left join sys_role c on c.id=b.role_id
where where
a.user_id= #{userId} and a.active = true a.user_id= #{userId} and a.active = true
order by order by
@@ -193,7 +193,7 @@
position_type as positionType, position_type as positionType,
role_enum as roleEnum role_enum as roleEnum
from from
sys_role_${eid} sys_role
where where
role_enum = #{roleEnum} role_enum = #{roleEnum}
</select> </select>

View File

@@ -11,7 +11,7 @@
id, menu_id, role_id, platform id, menu_id, role_id, platform
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into sys_role_menu_${enterpriseId} insert into sys_role_menu
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.menuId != null"> <if test="record.menuId != null">
menu_id, menu_id,
@@ -36,7 +36,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update sys_role_menu_${enterpriseId} update sys_role_menu
<set> <set>
<if test="record.menuId != null"> <if test="record.menuId != null">
menu_id = #{record.menuId}, menu_id = #{record.menuId},

View File

@@ -1,156 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.UserAuthMappingMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.UserAuthMappingDO">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
<result column="mapping_id" jdbcType="VARCHAR" property="mappingId"/>
<result column="type" jdbcType="VARCHAR" property="type"/>
<result column="source" jdbcType="VARCHAR" property="source"/>
<result column="create_id" jdbcType="VARCHAR" property="createId"/>
<result column="create_time" jdbcType="BIGINT" property="createTime"/>
<result column="update_id" jdbcType="VARCHAR" property="updateId"/>
<result column="update_time" jdbcType="BIGINT" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, user_id, mapping_id, type, source, create_id, create_time, update_id, update_time
</sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into user_auth_mapping_${enterpriseId}
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.userId != null">
user_id,
</if>
<if test="record.mappingId != null">
mapping_id,
</if>
<if test="record.type != null">
type,
</if>
<if test="record.source != null">
source,
</if>
<if test="record.createId != null">
create_id,
</if>
<if test="record.createTime != null">
create_time,
</if>
<if test="record.updateId != null">
update_id,
</if>
<if test="record.updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.userId != null">
#{record.userId},
</if>
<if test="record.mappingId != null">
#{record.mappingId},
</if>
<if test="record.type != null">
#{record.type},
</if>
<if test="record.source != null">
#{record.source},
</if>
<if test="record.createId != null">
#{record.createId},
</if>
<if test="record.createTime != null">
#{record.createTime},
</if>
<if test="record.updateId != null">
#{record.updateId},
</if>
<if test="record.updateTime != null">
#{record.updateTime},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update user_auth_mapping_${enterpriseId}
<set>
<if test="record.userId != null">
user_id = #{record.userId},
</if>
<if test="record.mappingId != null">
mapping_id = #{record.mappingId},
</if>
<if test="record.type != null">
type = #{record.type},
</if>
<if test="record.source != null">
source = #{record.source},
</if>
<if test="record.createId != null">
create_id = #{record.createId},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.updateId != null">
update_id = #{record.updateId},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
</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>
<delete id="deleteAuthMappingByIds">
delete from user_auth_mapping_${eid}
where id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectIdsByUserId" resultType="java.lang.Long">
select id from user_auth_mapping_${eid} where user_id = #{userId}
</select>
<insert id="insertUserAuthMapping">
insert into user_auth_mapping_${eid}
(
`user_id`,
`mapping_id`,
`type`,
`source`,
`create_id`,
`create_time`
)
values
(
#{auth.userId},
#{auth.mappingId},
#{auth.type},
#{auth.source},
#{auth.createId},
#{auth.createTime}
)
</insert>
<delete id="deleteAuthMappingByIdAndType">
delete from user_auth_mapping_${eid}
where type=#{type} and mapping_id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -14,7 +14,7 @@
id, region_id, user_id, create_id, create_time, update_id, update_time id, region_id, user_id, create_id, create_time, update_id, update_time
</sql> </sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into user_region_mapping_${enterpriseId} insert into user_region_mapping
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.regionId != null"> <if test="record.regionId != null">
region_id, region_id,
@@ -57,7 +57,7 @@
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective"> <update id="updateByPrimaryKeySelective">
update user_region_mapping_${enterpriseId} update user_region_mapping
<set> <set>
<if test="record.regionId != null"> <if test="record.regionId != null">
region_id = #{record.regionId}, region_id = #{record.regionId},
@@ -82,14 +82,14 @@
</update> </update>
<delete id="deletedByUserIds"> <delete id="deletedByUserIds">
delete from user_region_mapping_${enterpriseId} where user_id in delete from user_region_mapping where user_id in
<foreach collection="userIds" open="(" close=")" separator="," item="userId"> <foreach collection="userIds" open="(" close=")" separator="," item="userId">
#{userId} #{userId}
</foreach> </foreach>
</delete> </delete>
<insert id="batchInsertRegionMapping"> <insert id="batchInsertRegionMapping">
insert into user_region_mapping_${enterpriseId} insert into user_region_mapping
( (
region_id, region_id,
user_id, user_id,
@@ -114,7 +114,7 @@
<select id="listUserRegionMappingByUserId" resultMap="BaseResultMap"> <select id="listUserRegionMappingByUserId" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from user_region_mapping_${enterpriseId} from user_region_mapping
<if test="userIds !=null and userIds.size >0"> <if test="userIds !=null and userIds.size >0">
where user_id in where user_id in
<foreach collection="userIds" open="(" close=")" separator="," item="userId"> <foreach collection="userIds" open="(" close=")" separator="," item="userId">
@@ -124,7 +124,7 @@
</select> </select>
<delete id="deletedByIds"> <delete id="deletedByIds">
delete from user_region_mapping_${enterpriseId} where id in delete from user_region_mapping where id in
<foreach collection="ids" open="(" close=")" separator="," item="id"> <foreach collection="ids" open="(" close=")" separator="," item="id">
#{id} #{id}
</foreach> </foreach>

View File

@@ -36,7 +36,7 @@ import static org.mybatis.generator.internal.util.messages.Messages.getString;
*/ */
public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Impl { public class MyIntrospectedTableMyBatis3Impl extends IntrospectedTableMyBatis3Impl {
private String enterpriseIdTableSuffix = "_${enterpriseId}"; private String enterpriseIdTableSuffix = "";
@Override @Override
public String getFullyQualifiedTableNameAtRuntime() { public String getFullyQualifiedTableNameAtRuntime() {

View File

@@ -158,7 +158,7 @@ public class MyPluginAdapter extends PluginAdapter {
String tableSuffix = tableName.substring(tableName.lastIndexOf("_") + 1); String tableSuffix = tableName.substring(tableName.lastIndexOf("_") + 1);
if(StringUtils.isNotBlank(tableSuffix) && tableSuffix.length() == 32){ if(StringUtils.isNotBlank(tableSuffix) && tableSuffix.length() == 32){
//企业库 //企业库
return tableName.substring(0, tableName.lastIndexOf("_")) + "_${enterpriseId}"; return tableName.substring(0, tableName.lastIndexOf("_")) + "";
} }
//平台库 //平台库
return tableName; return tableName;

View File

@@ -1,20 +0,0 @@
package com.cool.store.dto.auth;
import lombok.Data;
import java.util.List;
/**
* describe:
*
* @author zhouyiping
* @date 2020/11/17
*/
@Data
public class AuthStoreCountDTO {
private String userId;
private List<String> storeList;
private Integer storeCount;
}

View File

@@ -1,27 +0,0 @@
package com.cool.store.dto.buser;
import lombok.Data;
/**
* @Author suzhuhong
* @Date 2022/2/28 17:27
* @Version 1.0
*/
@Data
public class MySubordinatesDTO {
/**
* 映射ID
*/
String regionId;
String regionName;
String personalId;
String personalName;
/**
* 节点类型 区域 人员
*/
String nodeType;
}

View File

@@ -1,35 +0,0 @@
package com.cool.store.dto.buser;
import lombok.Data;
import java.util.List;
/**
* @ClassName SubordinateUserRangeDTO
* @Description 用户管辖范围
* @author wxp
*/
@Data
public class SubordinateUserRangeDTO {
private String userId;
/**
* 管辖用户范围self-仅自己all-全部人员define-自定义
*/
private String subordinateUserRange;
/**
* auto自动关联 select手动选择
*/
private List<String> sourceList;
/**
* 我的下属集合
*/
private List<MySubordinatesDTO> mySubordinates;
}

View File

@@ -1,48 +0,0 @@
package com.cool.store.dto.store;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import java.util.List;
/**
* describe:
*
* @author zhouyiping
* @date 2020/10/22
*/
@Data
public class StoreAreaDTO {
private String storeId;
private String storeName;
/**
* 门店所属区域的全部节点信息
*/
private String regionPath;
/**
* 门店挂靠的区域Id
*/
private String areaId;
/**
* 门店的挂挂靠的父节点区域ID
*/
private List<String> areaIdList;
/**
* 所属区域id
*/
private Long regionId;
private String storeStatus;
public List<String> getAreaIdList(){
return StrUtil.splitTrim(regionPath,"/");
}
}

View File

@@ -1,33 +0,0 @@
package com.cool.store.dto.usergroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.util.List;
/**
* @author wxp
*/
@ApiModel(value = "分组创建")
@Data
public class UserGroupAddRequest {
@ApiModelProperty("分组id")
private String groupId;
@ApiModelProperty(value = "分组名称", required = true)
@NotBlank(message = "分组名称不能为空")
@Length(max = 100, message = "名称最多100个字")
private String groupName;
@ApiModelProperty("共同编辑人userId集合")
private List<String> commonEditUserIdList;
@ApiModelProperty("配置用户userId集合")
private List<String> userIdList;
}

View File

@@ -1,24 +0,0 @@
package com.cool.store.dto.usergroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 用户分组dto
* @ClassName: UserGroupDTO
* @Author: wxp
* @Date: 2023/1/5 16:04
*/
@Data
public class UserGroupDTO {
@ApiModelProperty("组别id")
private String groupId;
@ApiModelProperty("组别名称")
private String groupName;
}

View File

@@ -1,10 +1,7 @@
package com.cool.store.vo.buser; package com.cool.store.vo.buser;
import com.cool.store.dto.auth.AuthRegionStoreUserDTO; import com.cool.store.dto.auth.AuthRegionStoreUserDTO;
import com.cool.store.dto.buser.MySubordinatesDTO;
import com.cool.store.dto.usergroup.UserGroupDTO;
import com.cool.store.entity.EnterpriseUserDO; import com.cool.store.entity.EnterpriseUserDO;
import com.cool.store.utils.UUIDUtils;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
@@ -79,18 +76,12 @@ public class EnterpriseUserPageVO implements Serializable {
private String department; private String department;
@ApiModelProperty("用户分组")
private List<UserGroupDTO> userGroupList;
@ApiModelProperty("管辖用户范围") @ApiModelProperty("管辖用户范围")
private String subordinateUserRange; private String subordinateUserRange;
@ApiModelProperty("auto自动关联 select手动选择") @ApiModelProperty("auto自动关联 select手动选择")
private List<String> sourceList; private List<String> sourceList;
@ApiModelProperty("我的下属集合")
private List<MySubordinatesDTO> mySubordinates;
private List<AuthRegionStoreUserDTO> authRegionStoreList; private List<AuthRegionStoreUserDTO> authRegionStoreList;
@ApiModelProperty("选取权限 true可选 false不可选") @ApiModelProperty("选取权限 true可选 false不可选")

View File

@@ -1,47 +0,0 @@
package com.cool.store.vo.usergroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class UserGroupVO {
@ApiModelProperty("分组名称")
private String groupName;
@ApiModelProperty("分组id")
private String groupId;
@ApiModelProperty("人员数量")
private Integer userCount;
private List<UserSimpleDTO> commonEditUserList;
@ApiModelProperty("更新人")
private String updateUserName;
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("更新人")
private String updateUserId;
@ApiModelProperty("创建人")
private String createUserName;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("创建人id")
private String createUserId;
@ApiModelProperty("配置用户集合")
private List<UserSimpleDTO> configUserList;
@ApiModelProperty("编辑权限")
private Boolean editFlag;
}

View File

@@ -1,20 +0,0 @@
package com.cool.store.vo.usergroup;
import lombok.Data;
/**
* @author xugangkun
* @date 2022/3/8 14:22
*/
@Data
public class UserSimpleDTO {
/**
* 用户id
*/
private String userId;
/**
* 用户名称
*/
private String userName;
}

View File

@@ -8,8 +8,6 @@ import com.aliyun.openservices.ons.api.bean.Subscription;
import com.cool.store.constants.CommonConstants; import com.cool.store.constants.CommonConstants;
import com.cool.store.enums.RocketMqGroupEnum; import com.cool.store.enums.RocketMqGroupEnum;
import com.cool.store.mq.RocketMqConfig; import com.cool.store.mq.RocketMqConfig;
import com.cool.store.mq.consumer.listener.EnterpriseInitListener;
import com.cool.store.mq.consumer.listener.EnterpriseScriptListener;
import com.cool.store.mq.consumer.listener.TestListener; import com.cool.store.mq.consumer.listener.TestListener;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
@@ -31,10 +29,6 @@ public class ConsumerClient {
@Resource @Resource
private RocketMqConfig rocketMqConfig; private RocketMqConfig rocketMqConfig;
@Resource @Resource
private EnterpriseInitListener enterpriseInitListener;
@Resource
private EnterpriseScriptListener enterpriseScriptListener;
@Resource
private TestListener testListener; private TestListener testListener;
/** /**
@@ -88,36 +82,4 @@ public class ConsumerClient {
return consumerBean; return consumerBean;
} }
/**
* 企业开通
*/
@Bean(initMethod = "start", destroyMethod = "shutdown")
public ConsumerBean enterpriseOpenBean() {
RocketMqGroupEnum groupEnum = RocketMqGroupEnum.ENTERPRISE_OPEN_DATA_SYNC;
ConsumerBean consumerBean = new ConsumerBean();
//配置文件
Properties properties = getCommonProperties(groupEnum);
consumerBean.setProperties(properties);
Map<Subscription, MessageListener> commonSubscriptionTable = getCommonSubscriptionTable(groupEnum, testListener);
//订阅多个topic如上面设置
consumerBean.setSubscriptionTable(commonSubscriptionTable);
return consumerBean;
}
/**
* 企业库脚本开通
*/
@Bean(initMethod = "start", destroyMethod = "shutdown")
public ConsumerBean enterpriseScriptBean() {
RocketMqGroupEnum groupEnum = RocketMqGroupEnum.ENTERPRISE_OPEN_ENTERPRISE_RUN_SCRIPT;
ConsumerBean consumerBean = new ConsumerBean();
//配置文件
Properties properties = getCommonProperties(groupEnum);
consumerBean.setProperties(properties);
Map<Subscription, MessageListener> commonSubscriptionTable = getCommonSubscriptionTable(groupEnum, enterpriseScriptListener);
//订阅多个topic如上面设置
consumerBean.setSubscriptionTable(commonSubscriptionTable);
return consumerBean;
}
} }

View File

@@ -1,80 +0,0 @@
package com.cool.store.mq.consumer.listener;
import com.alibaba.fastjson.JSONObject;
import com.aliyun.openservices.ons.api.Action;
import com.aliyun.openservices.ons.api.ConsumeContext;
import com.aliyun.openservices.ons.api.Message;
import com.aliyun.openservices.ons.api.MessageListener;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dto.enterprise.EnterpriseInitDTO;
import com.cool.store.enums.AppTypeEnum;
import com.cool.store.enums.EnterpriseStatusEnum;
import com.cool.store.service.EnterpriseInitService;
import com.cool.store.utils.RedisUtilPool;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.text.MessageFormat;
import java.util.Arrays;
/**
* 企业开通初始化
*
* @author chenyupeng
* @since 2022/1/26
*/
@Slf4j
@Service
public class EnterpriseInitListener implements MessageListener {
@Resource
private EnterpriseInitService enterpriseInitService;
@Autowired
private RedisUtilPool redisUtilPool;
@Override
public Action consume(Message message, ConsumeContext consumeContext) {
if(message.getReconsumeTimes() + 1 >= Integer.parseInt(CommonConstants.MaxReconsumeTimes)){
//超过最大消费次数
return Action.CommitMessage;
}
String text = new String(message.getBody());
if(StringUtils.isBlank(text)){
return Action.CommitMessage;
}
String lockKey = "EnterpriseInitDataSync:" + message.getMsgID();
EnterpriseInitDTO enterpriseInitDTO = JSONObject.parseObject(text, EnterpriseInitDTO.class);
log.info("EnterpriseInitListener messageId{}try times{} receive data :{}", message.getMsgID(), message.getReconsumeTimes(), JSONObject.toJSONString(enterpriseInitDTO));
boolean lock = redisUtilPool.setNxExpire(lockKey, message.getMsgID(), CommonConstants.ENTERPRISE_OPEN_LOCK_TIMES);
if (lock) {
try {
String appType = enterpriseInitDTO.getAppType();
String enterpriseStatusKey = MessageFormat.format(CommonConstants.ENTERPRISE_OPEN_STATUS_KEY, enterpriseInitDTO.getCorpId(), enterpriseInitDTO.getAppType());
enterpriseInitService.enterpriseInit(enterpriseInitDTO.getCorpId(), AppTypeEnum.getAppType(enterpriseInitDTO.getAppType()),
enterpriseInitDTO.getEid(), enterpriseInitDTO.getDbName(), enterpriseInitDTO.getUserId());
enterpriseInitService.sendOpenSucceededMsg(enterpriseInitDTO.getCorpId(), enterpriseInitDTO.getAppType(), Arrays.asList(enterpriseInitDTO.getUserId()));
//更新企业开通缓存状态
redisUtilPool.setString(enterpriseStatusKey, String.valueOf(EnterpriseStatusEnum.NORMAL.getCode()), CommonConstants.ONE_DAY_SECONDS);
return Action.CommitMessage;
} catch (Exception e) {
log.error("has exception", e);
} finally {
redisUtilPool.delKey(lockKey);
}
}
return Action.CommitMessage;
}
}

View File

@@ -1,52 +0,0 @@
package com.cool.store.mq.consumer.listener;
import com.alibaba.fastjson.JSON;
import com.aliyun.openservices.ons.api.Action;
import com.aliyun.openservices.ons.api.ConsumeContext;
import com.aliyun.openservices.ons.api.Message;
import com.aliyun.openservices.ons.api.MessageListener;
import com.cool.store.dto.enterprise.EnterpriseOpenMsg;
import com.cool.store.enums.RocketMqTagEnum;
import com.cool.store.service.EnterpriseInitService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* 执行企业端脚本消息监听
* @author xugangkun
* @date 2022/2/11 15:32
*/
@Service
@Slf4j
public class EnterpriseScriptListener implements MessageListener {
@Resource
private EnterpriseInitService enterpriseInitService;
@Override
public Action consume(Message message, ConsumeContext consumeContext) {
String text = new String(message.getBody());
log.info("EnterpriseScriptListener messageId:{}, msg:{}", message.getMsgID(), text);
if(StringUtils.isBlank(text)){
return Action.CommitMessage;
}
switch (RocketMqTagEnum.getByTag(message.getTag())){
case ENTERPRISE_OPEN_ENTERPRISE_RUN_SCRIPT:
log.info("run Enterprise Script start");
EnterpriseOpenMsg msg = null;
try {
msg = JSON.parseObject(text, EnterpriseOpenMsg.class);
} catch (Exception e) {
log.error("invalid auth msg={}", text);
}
enterpriseInitService.runEnterpriseScript(msg);
break;
default:
break;
}
return Action.CommitMessage;
}
}

View File

@@ -1,48 +0,0 @@
package com.cool.store.service;
import com.cool.store.dto.auth.AuthRegionStoreDTO;
import com.cool.store.dto.auth.AuthRegionStoreUserDTO;
import com.cool.store.dto.auth.AuthStoreCountDTO;
import java.util.List;
/**
* describe:可视化权限服务
*
* @author zhouyiping
* @date 2020/10/14
*/
public interface AuthVisualService {
/**
* do
* 查询权限区域/门店(配置区域使用)
* @param eid
* @param userId
* @return
*/
List<AuthRegionStoreUserDTO> authRegionStore(String eid, String userId);
/**
* do
* 查询权限区域/门店(配置区域使用)
* @param eid
* @param userIdList
* @return
*/
List<AuthRegionStoreDTO> authRegionStoreByUserList(String eid, List<String> userIdList);
/**
* do
* 获取人员拥有的门店总数
* @param eid
* @param userId
* @param isReturnList 是否返回门店列表
* @return
*/
List<AuthStoreCountDTO> authStoreCount(String eid, List<String> userId, Boolean isReturnList);
}

View File

@@ -8,7 +8,7 @@ import java.util.List;
public interface EnterpriseConfigService { public interface EnterpriseConfigService {
EnterpriseConfigDO selectByEnterpriseId(String enterpriseId); EnterpriseConfigDO selectByEnterpriseId();
/** /**
* 根据dbName获取dbServer * 根据dbName获取dbServer

View File

@@ -13,12 +13,5 @@ import java.util.List;
*/ */
public interface EnterpriseInitService { public interface EnterpriseInitService {
void runEnterpriseScript(EnterpriseOpenMsg msg); void sync(String userName, String userId, Long regionId);
void enterpriseInit(String cropId, AppTypeEnum appType, String eid, String dbName, String openUserId);
void sendOpenSucceededMsg(String corpId, String appType, List<String> userList);
void sync(String eid, String userName, String userId, Long regionId);
} }

View File

@@ -1,55 +0,0 @@
package com.cool.store.service;
import com.cool.store.context.CurrentUser;
import com.cool.store.dto.enterprise.EnterpriseUserDTO;
import com.cool.store.dto.usergroup.UserGroupAddRequest;
import com.cool.store.dto.usergroup.UserGroupDTO;
import com.cool.store.vo.buser.EnterpriseUserPageVO;
import com.cool.store.vo.usergroup.UserGroupVO;
import com.github.pagehelper.PageInfo;
import java.util.List;
import java.util.Map;
/**
* @Author wxp
* @Date 2022/12/29 11:18
* @Version 1.0
*/
public interface EnterpriseUserGroupService {
/**
* 增加用户分组
* @param enterpriseId
* @param userGroupAddRequest
* @param user
* @return
*/
Boolean saveOrUpdateUserGroup(String enterpriseId, UserGroupAddRequest userGroupAddRequest, CurrentUser user);
Boolean updateUserGroup(String enterpriseId,Long userGroupId,List<String> userIdList);
void batchDeleteGroup(String enterpriseId, String groupId, List<String> userIdList);
/**
* 获取用户分组列表
* @param enterpriseId
* @param groupName 分组名,模糊查询用
* @return
*/
List<UserGroupVO> listUserGroup(String enterpriseId, String groupName, CurrentUser user);
UserGroupVO getGroupInfo(String enterpriseId, String groupId, CurrentUser user);
PageInfo<EnterpriseUserPageVO> listUserByGroupId(String enterpriseId, String groupId, String userName, Integer pageNum, Integer pageSize, CurrentUser currentUser);
void updateUserGroup(String enterpriseId, List<String> groupIdList, String userId, CurrentUser currentUser);
Boolean configUser(String enterpriseId, UserGroupAddRequest userGroupAddRequest, CurrentUser user);
Map<String, List<UserGroupDTO>> getUserGroupMap(String enterpriseId, List<String> userIdList);
}

View File

@@ -1,7 +1,5 @@
package com.cool.store.service; package com.cool.store.service;
import com.cool.store.dto.buser.SubordinateUserRangeDTO;
import com.cool.store.dto.enterprise.EnterpriseUserDTO;
import com.cool.store.entity.EnterpriseUserDO; import com.cool.store.entity.EnterpriseUserDO;
import com.cool.store.request.EnterpriseUserRequest; import com.cool.store.request.EnterpriseUserRequest;
import com.cool.store.vo.buser.EnterpriseUserPageVO; import com.cool.store.vo.buser.EnterpriseUserPageVO;
@@ -17,15 +15,13 @@ import java.util.Map;
*/ */
public interface EnterpriseUserService { public interface EnterpriseUserService {
void updateUserRegionPathList(String enterpriseId, List<String> userIds); void updateUserRegionPathList(List<String> userIds);
List<EnterpriseUserPageVO> listUser(String enterpriseId, String userName, String deptId, List<EnterpriseUserPageVO> listUser(String userName, String deptId,
String orderBy, String orderRule, String orderBy, String orderRule,
Long roleId, Integer userStatus, Integer pageNum, Integer pageSize, String jobNumber, String regionId, Boolean hasPage); Long roleId, Integer userStatus, Integer pageNum, Integer pageSize, String jobNumber, String regionId, Boolean hasPage);
List<String> initUserRole(String enterpriseId, List<EnterpriseUserPageVO> enterpriseUserList); List<String> initUserRole(List<EnterpriseUserPageVO> enterpriseUserList);
Map<String, SubordinateUserRangeDTO> fillUserSubordinateNames(String enterpriseId, List<String> userIdList);
/** /**
* 获取人员所属部门 * 获取人员所属部门
@@ -33,7 +29,7 @@ public interface EnterpriseUserService {
* @param userIdList * @param userIdList
* @return * @return
*/ */
Map<String, String> getUserRegion(String enterpriseId, List<String> userIdList); Map<String, String> getUserRegion(List<String> userIdList);
/** /**
* 更新用户的部门全路径 * 更新用户的部门全路径
@@ -42,6 +38,6 @@ public interface EnterpriseUserService {
*/ */
void updateUserDeptPath(EnterpriseUserRequest user, Map<String, String> deptIdMap); void updateUserDeptPath(EnterpriseUserRequest user, Map<String, String> deptIdMap);
EnterpriseUserDO selectByUserIdIgnoreActive(String enterpriseId, String userId); EnterpriseUserDO selectByUserIdIgnoreActive(String userId);
} }

View File

@@ -12,10 +12,8 @@ import java.util.List;
*/ */
public interface RegionService { public interface RegionService {
void saveRegionAndStore(String eid, RegionDO regionDO, String userId); void saveRegionAndStore(RegionDO regionDO, String userId);
void removeRegions(String eid, List<Long> regionIds); void removeRegions(List<Long> regionIds);
void deleteByStoreIds(String enterpriseId, List<String> storeIds, String userId);
} }

View File

@@ -1,33 +0,0 @@
package com.cool.store.service;
import java.util.List;
public interface SubordinateMappingService {
/**
* 判断用户是否管辖全部用户
* @param enterpriseId
* @param currentUserId
* @return
*/
Boolean checkHaveAllSubordinateUser(String enterpriseId, String currentUserId);
/**
* 获取管辖用户
* @param enterpriseId
* @param currentUserId
* @return
*/
List<String> getSubordinateUserIdList(String enterpriseId, String currentUserId,Boolean addCurrentFlag);
/**
* 保留管辖用户
* @param enterpriseId
* @param currentUserId
* @param userIdList
* @return
*/
List<String> retainSubordinateUserIdList(String enterpriseId, String currentUserId, List<String> userIdList,Boolean addCurrentFlag);
}

View File

@@ -1,365 +0,0 @@
package com.cool.store.service.impl;
import com.cool.store.dao.*;
import com.cool.store.dto.auth.AuthRegionStoreDTO;
import com.cool.store.dto.auth.AuthRegionStoreUserDTO;
import com.cool.store.dto.auth.AuthStoreCountDTO;
import com.cool.store.dto.buser.UserRoleDTO;
import com.cool.store.dto.store.StoreAreaDTO;
import com.cool.store.entity.RegionDO;
import com.cool.store.entity.StoreDO;
import com.cool.store.entity.UserAuthMappingDO;
import com.cool.store.enums.*;
import com.cool.store.service.AuthVisualService;
import com.cool.store.utils.CommonNodeUtils;
import com.cool.store.utils.RedisConstantUtil;
import com.cool.store.utils.RedisUtilPool;
import javafx.util.Pair;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
/**
* describe:
*
* @author zhouyiping
* @date 2020/10/14
*/
@Service
public class AuthVisualServiceImpl implements AuthVisualService {
@Resource
private UserAuthMappingDAO userAuthMappingDAO;
@Resource
private RegionDAO regionDAO;
@Autowired
private RedisUtilPool redisUtilPool;
@Autowired
private EnterpriseUserRoleDAO enterpriseUserRoleDAO;
@Resource
private UserRegionMappingDAO userRegionMappingDAO;
@Resource
private RedisConstantUtil redisConstantUtil;
@Resource
private StoreDAO storeDAO;
@Override
public List<AuthRegionStoreUserDTO> authRegionStore(String eid, String userId) {
List<UserAuthMappingDO> userAuthMappingList = userAuthMappingDAO.listUserAuthMappingByUserId(eid, userId);
return getAuthRegionStoreUserDTO(eid, userAuthMappingList);
}
public List<AuthRegionStoreUserDTO> getAuthRegionStoreUserDTO(String eid, List<UserAuthMappingDO> userAuthMappingList) {
List<AuthRegionStoreUserDTO> authRegionStoreDTOList = new ArrayList<>();
Pair<List<String>, List<String>> listListTwoResultTuple = splitUserAuthMapping(userAuthMappingList);
List<String> storeIdList = listListTwoResultTuple.getKey();
List<String> regionIdList = listListTwoResultTuple.getValue();
//将组织架构权限中的区域转换
if (CollectionUtils.isNotEmpty(regionIdList)) {
List<RegionDO> regionByRegionIds = regionDAO.getRegionByRegionIds(eid, regionIdList);
List<AuthRegionStoreUserDTO> regionAuthRegionStoreList = ListUtils.emptyIfNull(regionByRegionIds).stream()
.map(data -> mapAuthRegionStoreByRegion(data.getName(), data.getRegionId(), false, data.getStoreId()))
.collect(Collectors.toList());
List<String> regionStoreIdList = ListUtils.emptyIfNull(regionByRegionIds).stream()
.filter(e -> StringUtils.isNotBlank(e.getStoreId()) && RegionTypeEnum.STORE.getType().equals(e.getRegionType()))
.map(RegionDO::getStoreId)
.collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(regionAuthRegionStoreList)) {
authRegionStoreDTOList.addAll(regionAuthRegionStoreList);
}
// 是否需要展示区域对应门店权限数据
if (storeIdList != null && CollectionUtils.isNotEmpty(regionStoreIdList)
&& StringUtils.isNotBlank(redisUtilPool.getString(redisConstantUtil.getShowStoreAuthKey()))) {
storeIdList.addAll(regionStoreIdList);
}
}
//将组织架构权限中的门店转换
if (CollectionUtils.isNotEmpty(storeIdList) && StringUtils.isNotBlank(redisUtilPool.getString(redisConstantUtil.getShowStoreAuthKey()))) {
List<StoreDO> storeListByStoreIds = storeDAO.getStoreListByStoreIds(eid, storeIdList);
List<AuthRegionStoreUserDTO> storeAuthRegionStoreList = ListUtils.emptyIfNull(storeListByStoreIds).stream()
.map(data -> mapAuthRegionStoreByRegion(data.getStoreName(), data.getStoreId(), true, data.getStoreId()))
.collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(storeAuthRegionStoreList)) {
authRegionStoreDTOList.addAll(storeAuthRegionStoreList);
}
}
return authRegionStoreDTOList;
}
public Pair<List<String>, List<String>> splitUserAuthMapping(List<UserAuthMappingDO> userAuthMappingList) {
List<UserAuthMappingDO> store = new ArrayList<>();
List<UserAuthMappingDO> region = new ArrayList<>();
ListUtils.emptyIfNull(userAuthMappingList)
.forEach(data -> {
if (data.getType().equals(UserAuthMappingTypeEnum.STORE.getCode())) {
store.add(data);
} else {
region.add(data);
}
});
List<String> storeIdList = ListUtils.emptyIfNull(store).stream()
.map(UserAuthMappingDO::getMappingId).distinct().filter(Objects::nonNull).collect(Collectors.toList());
List<String> regionIdList = ListUtils.emptyIfNull(region).stream()
.map(UserAuthMappingDO::getMappingId).distinct().filter(Objects::nonNull).collect(Collectors.toList());
return new Pair(storeIdList, regionIdList);
}
@Override
public List<AuthRegionStoreDTO> authRegionStoreByUserList(String eid, List<String> userIdList) {
List<UserAuthMappingDO> userAuthMappingList = userAuthMappingDAO.listUserAuthMappingByUserIds(eid, userIdList);
List<AuthRegionStoreUserDTO> authRegionStoreUserDTO = getAuthRegionStoreUserDTO(eid, userAuthMappingList);
Map<String, AuthRegionStoreUserDTO> regionStoreUserMap = ListUtils.emptyIfNull(authRegionStoreUserDTO)
.stream()
.collect(Collectors.toMap(AuthRegionStoreUserDTO::getId, data -> data, (a, b) -> a));
Map<String, List<UserAuthMappingDO>> userAuthGroup = ListUtils.emptyIfNull(userAuthMappingList)
.stream()
.collect(Collectors.groupingBy(UserAuthMappingDO::getUserId));
return userIdList.stream()
.map(data -> mapAuthRegionStoreDTO(regionStoreUserMap, userAuthGroup, data))
.filter(Objects::nonNull)
.collect(Collectors.toList());
}
@Override
public List<AuthStoreCountDTO> authStoreCount(String eid, List<String> userIdList, Boolean isReturnList) {
/**
* 1.查询出所有关于用户的权限门店
* 1.权限区域角色权限
* 2.权限门店
* 2.分组聚合
* 3.去重统计门店数
*/
//用户配置的区域权限
List<UserAuthMappingDO> userAuthMappingDOList = userAuthMappingDAO.listUserAuthMappingByUserIds(eid, userIdList);
List<String> allAuthRegionList = ListUtils.emptyIfNull(userAuthMappingDOList)
.stream()
.filter(data -> StringUtils.equals(UserAuthMappingTypeEnum.REGION.getCode(), data.getType()))
.map(UserAuthMappingDO::getMappingId)
.distinct()
.filter(Objects::nonNull)
.collect(Collectors.toList());
List<StoreAreaDTO> storeAreaDTOS = storeDAO.listStoreByRegionIdList(eid, allAuthRegionList);
Map<String, List<String>> storeAreaMap = ListUtils.emptyIfNull(storeAreaDTOS)
.stream()
.collect(Collectors.groupingBy(StoreAreaDTO::getAreaId,
Collectors.mapping(StoreAreaDTO::getStoreId, Collectors.toList())));
Map<String, List<UserAuthMappingDO>> authMappingMap = ListUtils.emptyIfNull(userAuthMappingDOList)
.stream()
.collect(Collectors.groupingBy(UserAuthMappingDO::getUserId));
//用户角色可视化范围
List<UserRoleDTO> userRoleList = enterpriseUserRoleDAO.getUserAndRolesByUserId(eid, userIdList);
//取优先级最大角色去查询权限
//todo role
Map<String, UserRoleDTO> userRoleMap = ListUtils.emptyIfNull(userRoleList)
.stream()
.collect(Collectors.toMap(UserRoleDTO::getUserId, data -> data, (a, b) -> {
if (a.getPriority() == null || b.getPriority() == null) {
return a;
}
return a.getPriority() > b.getPriority() ? b : a;
}));
List<UserRoleDTO> minUserRoleList = new ArrayList<UserRoleDTO>(userRoleMap.values());
List<String> allStoreList = storeDAO.getAllStoreList(eid, isReturnList);
Integer allStoreCount = storeDAO.getStoreCount(eid);
//子区域计算
List<Long> all = null;
Map<Long, List<Long>> regionParentGroupMap = null;
Map<String, String> regionIdStoreIdMap = null;
if (CollectionUtils.isNotEmpty(allAuthRegionList)) {
List<RegionDO> allRegion = regionDAO.getAllRegion(eid);
ListUtils.emptyIfNull(allRegion).forEach(this::initRoot);
all = ListUtils.emptyIfNull(allRegion)
.stream()
.map(RegionDO::getId)
.collect(Collectors.toList());
regionParentGroupMap = ListUtils.emptyIfNull(allRegion)
.stream()
.collect(Collectors.groupingBy(data -> Long.valueOf(data.getParentId()),
Collectors.mapping(RegionDO::getId, Collectors.toList())));
List<Long> storeRegionIdList = allAuthRegionList.stream()
.map(e -> Long.valueOf(e)).collect(Collectors.toList());
List<RegionDO> storeRegionList = regionDAO.listStoreRegionByIds(eid, storeRegionIdList);
regionIdStoreIdMap = ListUtils.emptyIfNull(storeRegionList).stream()
.filter(e -> StringUtils.isNotBlank(e.getStoreId()) && !e.getDeleted() && RegionTypeEnum.STORE.getType().equals(e.getRegionType()))
.collect(Collectors.toMap(data->String.valueOf(data.getId()), RegionDO::getStoreId, (a, b) -> a));
}
List<Long> finalAll = all;
Map<Long, List<Long>> finalRegionParentGroupMap = regionParentGroupMap;
Map<String, String> finalRegionIdStoreIdMap = regionIdStoreIdMap;
return ListUtils.emptyIfNull(minUserRoleList).stream()
.map(data -> mapAuStoreCountDTO(data, authMappingMap, storeAreaMap, allStoreList, allStoreCount, finalAll, finalRegionParentGroupMap, finalRegionIdStoreIdMap))
.collect(Collectors.toList());
}
private AuthRegionStoreDTO mapAuthRegionStoreDTO(Map<String, AuthRegionStoreUserDTO> regionStoreUserMap, Map<String, List<UserAuthMappingDO>> userAuthGroup, String data) {
if (MapUtils.isNotEmpty(userAuthGroup) && CollectionUtils.isNotEmpty(userAuthGroup.get(data)) && MapUtils.isNotEmpty(regionStoreUserMap)) {
List<AuthRegionStoreUserDTO> authRegionStoreUserDTOList = ListUtils.emptyIfNull(userAuthGroup.get(data))
.stream()
.map(userAuthMappingDO -> regionStoreUserMap.get(userAuthMappingDO.getMappingId()))
.distinct()
.filter(Objects::nonNull)
.collect(Collectors.toList());
AuthRegionStoreDTO authRegionStoreDTO = new AuthRegionStoreDTO();
authRegionStoreDTO.setUserId(data);
authRegionStoreDTO.setAuthRegionStoreUserList(authRegionStoreUserDTOList);
return authRegionStoreDTO;
}
return null;
}
private void initRoot(RegionDO regionDO) {
if (regionDO.getParentId() == null) {
regionDO.setParentId("0");
}
}
/**
* 获取区域下的门店(不包含子节点)
* @param storeIdList
* @param areaStoreList
* @return
*/
private List<String> authStoreId(List<String> storeIdList,
List<String> areaStoreList) {
List<String> allStoreIdList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(storeIdList)) {
allStoreIdList.addAll(storeIdList);
}
//聚合区域下的门店信息
if (CollectionUtils.isNotEmpty(areaStoreList)) {
allStoreIdList.addAll(areaStoreList);
}
//去除重复的StoreId
return ListUtils.emptyIfNull(allStoreIdList).stream()
.distinct()
.collect(Collectors.toList());
}
private AuthStoreCountDTO mapAuStoreCountDTO(UserRoleDTO userRoleDTO,
Map<String, List<UserAuthMappingDO>> authMappingMap,
Map<String, List<String>> storeAreaMap,
List<String> invalidStores,
Integer allStoreCount,
List<Long> all,
Map<Long, List<Long>> regionParentGroupMap, Map<String, String> regionIdStoreIdMap) {
AuthStoreCountDTO authStoreCountDTO = new AuthStoreCountDTO();
if (userRoleDTO == null || userRoleDTO.getRoleAuth() == null) {
return authStoreCountDTO;
}
String userId = userRoleDTO.getUserId();
authStoreCountDTO.setUserId(userId);
//全企业数据或者管理员 直接返回企业下所有的门店总数
if (StringUtils.equals(userRoleDTO.getRoleEnum(), (RoleEnum.MASTER.getRoleEnum()))) {
authStoreCountDTO.setStoreList(invalidStores);
authStoreCountDTO.setStoreCount(allStoreCount);
return authStoreCountDTO;
}
List<String> storeIdList = new ArrayList<>();
List<String> regionIdList = new ArrayList<>();
List<String> areaStoreList;
if (MapUtils.isNotEmpty(authMappingMap)) {
List<UserAuthMappingDO> userAuthMappingDOList = authMappingMap.get(userId);
Pair<List<String>, List<String>> listListTwoResultTuple = splitUserAuthMapping(userAuthMappingDOList);
storeIdList = listListTwoResultTuple.getKey();
regionIdList = listListTwoResultTuple.getValue();
if(CollectionUtils.isNotEmpty(regionIdList) && regionIdStoreIdMap != null){
List<String> finalStoreIdList = storeIdList;
regionIdList.forEach(regionId -> {
String regionStoreId = regionIdStoreIdMap.get(regionId);
if (StringUtils.isNotBlank(regionStoreId)) {
finalStoreIdList.add(regionStoreId);
}
});
}
}
switch (AuthRoleEnum.getByCode(userRoleDTO.getRoleAuth())) {
case ALL:
authStoreCountDTO.setStoreList(invalidStores);
authStoreCountDTO.setStoreCount(allStoreCount);
break;
case INCLUDE_SUBORDINATE:
areaStoreList = ListUtils.emptyIfNull(regionIdList)
.stream()
.map(data -> CommonNodeUtils.getAllChildListContainSelf(0L,
Long.valueOf(data), all, regionParentGroupMap))
.flatMap(Collection::stream)
.map(data -> data.toString())
.map(data -> {
if (MapUtils.isNotEmpty(storeAreaMap)) {
return storeAreaMap.get(data);
}
return null;
})
.filter(Objects::nonNull)
.flatMap(Collection::stream)
.collect(Collectors.toList());
List<String> includeSubordinateStoreIdList = authStoreId(storeIdList, areaStoreList);
if (CollectionUtils.isNotEmpty(includeSubordinateStoreIdList)) {
authStoreCountDTO.setStoreList(includeSubordinateStoreIdList);
authStoreCountDTO.setStoreCount(ListUtils.emptyIfNull(includeSubordinateStoreIdList).size());
}
break;
case PERSONAL:
areaStoreList = ListUtils.emptyIfNull(regionIdList)
.stream()
.map(data -> CommonNodeUtils.getAllChildListContainSelf(0L,
Long.valueOf(data), all, regionParentGroupMap))
.flatMap(Collection::stream)
.map(data -> data.toString())
.map(data -> {
if (MapUtils.isNotEmpty(storeAreaMap)) {
return storeAreaMap.get(data);
}
return null;
})
.filter(Objects::nonNull)
.flatMap(Collection::stream)
.collect(Collectors.toList());
List<String> personalStoreIdList = authStoreId(storeIdList, areaStoreList);
if (CollectionUtils.isNotEmpty(personalStoreIdList)) {
authStoreCountDTO.setStoreList(personalStoreIdList);
authStoreCountDTO.setStoreCount(ListUtils.emptyIfNull(personalStoreIdList).size());
}
break;
default:
break;
}
return authStoreCountDTO;
}
private AuthRegionStoreUserDTO mapAuthRegionStoreByRegion(String name, String regionId, boolean b, String storeId) {
AuthRegionStoreUserDTO authRegionStoreDTO = new AuthRegionStoreUserDTO();
authRegionStoreDTO.setName(name);
authRegionStoreDTO.setId(regionId);
authRegionStoreDTO.setStoreFlag(b);
authRegionStoreDTO.setStoreId(storeId);
return authRegionStoreDTO;
}
}

View File

@@ -21,8 +21,9 @@ public class EnterpriseConfigServiceImpl implements EnterpriseConfigService {
private EnterpriseConfigDAO enterpriseConfigDAO; private EnterpriseConfigDAO enterpriseConfigDAO;
@Override @Override
public EnterpriseConfigDO selectByEnterpriseId(String enterpriseId) { public EnterpriseConfigDO selectByEnterpriseId() {
return enterpriseConfigDAO.selectByEnterpriseId(enterpriseId); //return enterpriseConfigDAO.selectByEnterpriseId(enterpriseId);
return null;
} }
@Override @Override

Some files were not shown because too many files have changed in this diff Show More