企业同步
This commit is contained in:
@@ -112,6 +112,21 @@
|
||||
<orderEntry type="library" name="Maven: com.aliyun:openapiutil:0.1.9" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.65" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.65" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:3.0.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.2.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.2.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.lettuce:lettuce-core:5.2.2.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.48.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.48.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.48.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.48.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.48.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.48.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.3.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.18" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:3.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.20" level="project" />
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.cool.store.dao;
|
||||
import com.cool.store.mapper.EnterpriseConfigMapper;
|
||||
import com.cool.store.entity.EnterpriseConfigDO;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
@@ -14,7 +14,7 @@ import java.util.List;
|
||||
* @Description:
|
||||
* @date 2023-05-18 11:15
|
||||
*/
|
||||
@Service
|
||||
@Repository
|
||||
public class EnterpriseConfigDAO {
|
||||
|
||||
@Resource
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.cool.store.dao;
|
||||
import com.cool.store.entity.EnterpriseDO;
|
||||
import com.cool.store.mapper.EnterpriseMapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@@ -13,7 +13,7 @@ import javax.annotation.Resource;
|
||||
* @Description:
|
||||
* @date 2023-05-23 13:52
|
||||
*/
|
||||
@Service
|
||||
@Repository
|
||||
public class EnterpriseDAO {
|
||||
|
||||
@Resource
|
||||
|
||||
@@ -1,23 +1,24 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.dto.enterprise.EnterpriseUserDTO;
|
||||
import com.cool.store.entity.EnterpriseUserDO;
|
||||
import com.cool.store.enums.UserSelectRangeEnum;
|
||||
import com.cool.store.enums.UserStatusEnum;
|
||||
import com.cool.store.mapper.EnterpriseUserMapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 02:58
|
||||
*/
|
||||
@Service
|
||||
@Repository
|
||||
public class EnterpriseUserDAO {
|
||||
|
||||
@Resource
|
||||
@@ -94,4 +95,54 @@ public class EnterpriseUserDAO {
|
||||
}
|
||||
return enterpriseUserMapper.listByRegionIdList(eid, regionIdList);
|
||||
}
|
||||
|
||||
public Boolean insertEnterpriseUser(String eid, EnterpriseUserDO entity) {
|
||||
if(Objects.isNull(entity.getUserStatus())){
|
||||
entity.setUserStatus(UserStatusEnum.NORMAL.getCode());
|
||||
}
|
||||
if(Objects.isNull(entity.getActive())){
|
||||
entity.setActive(true);
|
||||
}
|
||||
if(StringUtils.isBlank(entity.getThirdOaUniqueFlag())){
|
||||
entity.setThirdOaUniqueFlag(null);
|
||||
}
|
||||
entity.setSubordinateRange(UserSelectRangeEnum.ALL.getCode());
|
||||
if (StringUtils.isBlank(entity.getUnionid()) || StringUtils.isBlank(entity.getUserId())) {
|
||||
return false;
|
||||
}
|
||||
if (StringUtils.isBlank(entity.getName())) {
|
||||
entity.setName(entity.getUserId());
|
||||
}
|
||||
enterpriseUserMapper.insertEnterpriseUser(eid, entity);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void updateEnterpriseUser(String eid,EnterpriseUserDO enterpriseUser){
|
||||
if(StringUtils.isBlank(eid) || Objects.isNull(enterpriseUser)){
|
||||
return;
|
||||
}
|
||||
enterpriseUserMapper.updateEnterpriseUser(eid, enterpriseUser);
|
||||
}
|
||||
|
||||
public List<String> getMainAdminUserIds(String eid){
|
||||
if(StringUtils.isBlank(eid)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return enterpriseUserMapper.getMainAdminUserIds(eid);
|
||||
}
|
||||
|
||||
public List<String> selectSpecifyNodeUserIds(String eid, String dingDeptId) {
|
||||
return enterpriseUserMapper.selectSpecifyNodeUserIds(eid,dingDeptId);
|
||||
}
|
||||
|
||||
public List<String> selectAllUserId(String eid) {
|
||||
if(StringUtils.isBlank(eid)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return enterpriseUserMapper.selectAllUserIds(eid);
|
||||
}
|
||||
|
||||
public EnterpriseUserDO selectByUserIdIgnoreActive(String enterpriseId, String userId) {
|
||||
return enterpriseUserMapper.selectByUserIdIgnoreActive(enterpriseId, userId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -4,22 +4,22 @@ import com.cool.store.dto.buser.UserRoleDTO;
|
||||
import com.cool.store.dto.enterprise.EnterpriseUserRole;
|
||||
import com.cool.store.entity.SysRoleDO;
|
||||
import com.cool.store.enums.RoleEnum;
|
||||
import com.cool.store.mapper.EnterpriseUserMapper;
|
||||
import com.cool.store.mapper.EnterpriseUserRoleMapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 02:59
|
||||
*/
|
||||
@Service
|
||||
@Repository
|
||||
public class EnterpriseUserRoleDAO {
|
||||
|
||||
@Resource
|
||||
@@ -45,5 +45,31 @@ public class EnterpriseUserRoleDAO {
|
||||
.anyMatch(role-> StringUtils.equals(RoleEnum.MASTER.getRoleEnum(),role.getRoleEnum()));
|
||||
}
|
||||
|
||||
public void deleteBatchByPrimaryKey(String enterpriseId, List<Long> ids){
|
||||
if(StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(ids)){
|
||||
return;
|
||||
}
|
||||
enterpriseUserRoleMapper.deleteBatchByPrimaryKey(enterpriseId, ids);
|
||||
}
|
||||
|
||||
public List<Long> selectIdsByUserId(String enterpriseId, String userId){
|
||||
if(StringUtils.isAnyBlank(enterpriseId, userId)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return enterpriseUserRoleMapper.selectIdsByUserId(enterpriseId, userId);
|
||||
}
|
||||
|
||||
public EnterpriseUserRole selectByUserIdAndRoleId(String enterpriseId, String userId, String roleId){
|
||||
if(StringUtils.isAnyBlank(enterpriseId, userId, roleId)){
|
||||
return null;
|
||||
}
|
||||
return enterpriseUserRoleMapper.selectByUserIdAndRoleId(enterpriseId, userId, roleId);
|
||||
}
|
||||
|
||||
public void save(String enterpriseId, EnterpriseUserRole entity){
|
||||
if(StringUtils.isBlank(enterpriseId) || Objects.isNull(entity)){
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.LoginRecordDO;
|
||||
import com.cool.store.mapper.LoginRecordMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@@ -12,7 +12,7 @@ import javax.annotation.Resource;
|
||||
* @Description:
|
||||
* @date 2023-05-23 15:48
|
||||
*/
|
||||
@Service
|
||||
@Repository
|
||||
public class LoginRecordDAO {
|
||||
|
||||
@Resource
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dto.region.RegionNode;
|
||||
import com.cool.store.dto.region.RegionPathDTO;
|
||||
import com.cool.store.dto.region.RegionSyncDTO;
|
||||
import com.cool.store.entity.RegionDO;
|
||||
import com.cool.store.enums.RegionTypeEnum;
|
||||
import com.cool.store.mapper.RegionMapper;
|
||||
@@ -9,8 +11,7 @@ import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
@@ -20,7 +21,7 @@ import java.util.stream.Collectors;
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 02:59
|
||||
*/
|
||||
@Service
|
||||
@Repository
|
||||
public class RegionDAO {
|
||||
|
||||
@Resource
|
||||
@@ -53,14 +54,14 @@ public class RegionDAO {
|
||||
regionDO.setCreateTime(Calendar.getInstance().getTimeInMillis());
|
||||
regionDO.setRegionPath("/" + CommonConstants.ROOT_DEPT_ID_STR + "/");
|
||||
regionDO.setUnclassifiedFlag(CommonConstants.ONE);
|
||||
insertRoot(enterpriseId, regionDO);
|
||||
insertRegion(enterpriseId, regionDO);
|
||||
regionDO.setRegionId(regionDO.getId().toString());
|
||||
return regionDO;
|
||||
}
|
||||
return unclassified;
|
||||
}
|
||||
|
||||
public Long insertRoot(String eid, RegionDO regionDO) {
|
||||
public Long insertRegion(String eid, RegionDO regionDO) {
|
||||
return regionMapper.insertRoot(eid, regionDO);
|
||||
}
|
||||
|
||||
@@ -104,4 +105,61 @@ public class RegionDAO {
|
||||
return regionPathDTO;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public RegionDO getByRegionId(String eid, Long regionId){
|
||||
if(StringUtils.isBlank(eid) || Objects.isNull(regionId)){
|
||||
return null;
|
||||
}
|
||||
return regionMapper.getByRegionId(eid, regionId);
|
||||
}
|
||||
|
||||
public RegionNode getRegionById(String eid, String regionId){
|
||||
return regionMapper.getRegionByRegionId(eid, regionId);
|
||||
}
|
||||
|
||||
public void insertOrUpdate(RegionDO regionDO, String eid){
|
||||
regionMapper.insertOrUpdate(regionDO,eid);
|
||||
}
|
||||
|
||||
public List<RegionSyncDTO> getSpecifiedRegionIdAndDeptId(String eid, Long parentId){
|
||||
return regionMapper.getSpecifiedRegionIdAndDeptId(eid,parentId);
|
||||
}
|
||||
|
||||
public List<RegionDO> getRegionByDingDeptIds(String enterpriseId, List<String> dingDeptIds){
|
||||
if(StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(dingDeptIds)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return regionMapper.getRegionByDingDeptIds(enterpriseId, dingDeptIds);
|
||||
}
|
||||
|
||||
public RegionDO getBySynDingDeptId(String eid, String synDingDeptId){
|
||||
if(StringUtils.isAnyBlank(eid, synDingDeptId)){
|
||||
return null;
|
||||
}
|
||||
return regionMapper.getBySynDingDeptId(eid, synDingDeptId);
|
||||
}
|
||||
|
||||
public Long ignoreInsert(String eid, RegionDO regionDO) {
|
||||
if(StringUtils.isBlank(eid) || Objects.isNull(regionDO)){
|
||||
return 0L;
|
||||
}
|
||||
return regionMapper.ignoreInsert(eid, regionDO);
|
||||
}
|
||||
|
||||
public Integer updateSyncRegion(String eid, RegionDO regionDO){
|
||||
if(StringUtils.isBlank(eid) || Objects.isNull(regionDO)){
|
||||
return 0;
|
||||
}
|
||||
return regionMapper.updateSyncRegion(eid, regionDO);
|
||||
}
|
||||
|
||||
public void removeRegion(String eid, List<Long> regionIds) {
|
||||
if (regionIds.contains(CommonConstants.UNGROUPED_DEPT_ID)) {
|
||||
regionIds.remove(CommonConstants.UNGROUPED_DEPT_ID);
|
||||
}
|
||||
if(CollectionUtils.isEmpty(regionIds)) {
|
||||
return;
|
||||
}
|
||||
regionMapper.removeRegions(eid, regionIds);
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,18 @@
|
||||
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.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
@@ -20,7 +20,7 @@ import java.util.List;
|
||||
* @Description:
|
||||
* @date 2023-05-31 11:52
|
||||
*/
|
||||
@Service
|
||||
@Repository
|
||||
public class StoreDAO {
|
||||
|
||||
@Resource
|
||||
@@ -52,10 +52,55 @@ public class StoreDAO {
|
||||
}
|
||||
|
||||
public List<String> getAllStoreList (String eid,Boolean isReturnList){
|
||||
List<String> invalidStores=new ArrayList<>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.cool.store.mapper.SubordinateMappingMapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
@@ -17,7 +17,7 @@ import java.util.stream.Collectors;
|
||||
* @Description:
|
||||
* @date 2023-05-31 14:27
|
||||
*/
|
||||
@Service
|
||||
@Repository
|
||||
public class SubordinateMappingDAO {
|
||||
|
||||
@Resource
|
||||
@@ -40,4 +40,12 @@ public class SubordinateMappingDAO {
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.dto.dept.SyncTreeNode;
|
||||
import com.cool.store.dto.enterprise.QueryDeptChildDTO;
|
||||
import com.cool.store.entity.SysDepartmentDO;
|
||||
import com.cool.store.mapper.SysDepartmentMapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
@@ -15,7 +16,7 @@ import java.util.List;
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 03:00
|
||||
*/
|
||||
@Service
|
||||
@Repository
|
||||
public class SysDepartmentDAO {
|
||||
|
||||
@Resource
|
||||
@@ -35,4 +36,24 @@ public class SysDepartmentDAO {
|
||||
return sysDepartmentMapper.getDeptChildListByParentId(eid, parentId);
|
||||
}
|
||||
|
||||
public void deleteByNotInIds(String enterpriseId, List<String> deptIds){
|
||||
if(StringUtils.isBlank(enterpriseId) || CollectionUtils.isEmpty(deptIds)){
|
||||
return;
|
||||
}
|
||||
sysDepartmentMapper.deleteByNotInIds(deptIds, enterpriseId);
|
||||
}
|
||||
|
||||
public List<SyncTreeNode> getSyncDeptTreeList(String eid) {
|
||||
if(StringUtils.isBlank(eid)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return sysDepartmentMapper.getSyncDeptTreeList(eid);
|
||||
}
|
||||
|
||||
public List<SysDepartmentDO> selectAllDepts(String enterpriseId){
|
||||
if(StringUtils.isBlank(enterpriseId)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return sysDepartmentMapper.selectAll(enterpriseId);
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import com.cool.store.entity.SysRoleDO;
|
||||
import com.cool.store.enums.RoleEnum;
|
||||
import com.cool.store.mapper.SysRoleMapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@@ -12,7 +12,7 @@ import javax.annotation.Resource;
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 03:00
|
||||
*/
|
||||
@Service
|
||||
@Repository
|
||||
public class SysRoleDAO {
|
||||
|
||||
@Resource
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 03:01
|
||||
*/
|
||||
@Service
|
||||
@Repository
|
||||
public class SysRoleMenuDAO {
|
||||
|
||||
}
|
||||
@@ -5,16 +5,17 @@ import com.cool.store.mapper.UserAuthMappingMapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 02:54
|
||||
*/
|
||||
@Service
|
||||
@Repository
|
||||
public class UserAuthMappingDAO {
|
||||
|
||||
@Resource
|
||||
@@ -34,4 +35,32 @@ public class UserAuthMappingDAO {
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import com.cool.store.mapper.UserRegionMappingMapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
@@ -15,7 +15,7 @@ import java.util.stream.Collectors;
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-19 03:00
|
||||
*/
|
||||
@Service
|
||||
@Repository
|
||||
public class UserRegionMappingDAO {
|
||||
|
||||
@Resource
|
||||
@@ -50,4 +50,14 @@ public class UserRegionMappingDAO {
|
||||
return userRegionMappingMapper.listUserRegionMappingByUserId(enterpriseId, userIds);
|
||||
}
|
||||
|
||||
public void deletedByIds(String enterpriseId, List<Integer> ids){
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return;
|
||||
}
|
||||
List<Integer> distinctData = ids.stream()
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
userRegionMappingMapper.deletedByIds(enterpriseId, distinctData);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
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);
|
||||
}
|
||||
@@ -86,4 +86,17 @@ public interface EnterpriseUserMapper {
|
||||
|
||||
List<EnterpriseUserDO> listByRegionIdList(@Param("eid") String eid, @Param("regionIdList") List<String> regionIdList);
|
||||
|
||||
void updateEnterpriseUser(@Param("eid") String eid,@Param("enterpriseUserDO") EnterpriseUserDO enterpriseUserDO);
|
||||
|
||||
|
||||
List<String> getMainAdminUserIds(@Param("eid")String eid);
|
||||
|
||||
List<String> selectSpecifyNodeUserIds(@Param("eid") String eid, @Param("dingDeptId") String dingDeptId);
|
||||
|
||||
List<String> selectAllUserIds(@Param("eid") String eid);
|
||||
|
||||
EnterpriseUserDO selectByUserIdIgnoreActive(@Param("enterpriseId") String enterpriseId, @Param("userId") String userId);
|
||||
|
||||
void insertEnterpriseUser(@Param("eid") String eid, @Param("entity") EnterpriseUserDO entity);
|
||||
|
||||
}
|
||||
@@ -39,4 +39,12 @@ public interface EnterpriseUserRoleMapper {
|
||||
List<UserRoleDTO> getUserAndRolesByUserId(@Param("eip") String enterpriseId, @Param("userIdList") List<String> userIdList);
|
||||
|
||||
List<SysRoleDO> listRoleByUserId(@Param("eip") String enterpriseId, @Param("userId") String userId);
|
||||
|
||||
void deleteBatchByPrimaryKey(@Param("eid") String enterpriseId, @Param("ids") List<Long> ids);
|
||||
|
||||
List<Long> selectIdsByUserId(@Param("eid") String enterpriseId, @Param("userId") String userId);
|
||||
|
||||
EnterpriseUserRole selectByUserIdAndRoleId(@Param("eid") String enterpriseId, @Param("userId") String userId, @Param("roleId") String roleId);
|
||||
|
||||
void save(@Param("eid") String enterpriseId, @Param("entity") EnterpriseUserRole entity);
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.region.RegionNode;
|
||||
import com.cool.store.dto.region.RegionSyncDTO;
|
||||
import com.cool.store.entity.RegionDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -41,4 +43,23 @@ public interface RegionMapper {
|
||||
List<RegionDO> getAllRegion(@Param("eid") String eid);
|
||||
|
||||
List<RegionDO> listStoreRegionByIds(@Param("eid")String enterpriseId, @Param("regionIds")List<Long> regionIds);
|
||||
|
||||
RegionDO getByRegionId(@Param("eid") String eid, @Param("regionId") Long regionId);
|
||||
|
||||
RegionNode getRegionByRegionId(@Param("eid") String eid, @Param("regionId") String regionId);
|
||||
|
||||
Integer insertOrUpdate(@Param("record") RegionDO regionDO, @Param("eid") String eid);
|
||||
|
||||
List<RegionSyncDTO> getSpecifiedRegionIdAndDeptId(@Param("eid") String eid, @Param("parentId") Long parentId);
|
||||
|
||||
List<RegionDO> getRegionByDingDeptIds(@Param("eid")String enterpriseId, @Param("list")List<String> dingDeptIds);
|
||||
|
||||
RegionDO getBySynDingDeptId(@Param("eid") String eid, @Param("synDingDeptId") String synDingDeptId);
|
||||
|
||||
Long ignoreInsert(@Param("eid") String eid, @Param("region") RegionDO regionDO);
|
||||
|
||||
Integer updateSyncRegion(@Param("eid") String eid, @Param("item")RegionDO regionDO);
|
||||
|
||||
Integer removeRegions(@Param("eid")String eid,@Param("regionIds") List<Long> regionIds);
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
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;
|
||||
@@ -35,4 +36,18 @@ public interface StoreMapper {
|
||||
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);
|
||||
}
|
||||
@@ -40,4 +40,6 @@ public interface SubordinateMappingMapper {
|
||||
* @param subordinateMappingDOS
|
||||
*/
|
||||
void batchInsertSubordinateMapping(@Param("enterpriseId") String enterpriseId,@Param("subordinateMappingDOS") List<SubordinateMappingDO> subordinateMappingDOS);
|
||||
|
||||
void deletedByUserIds(@Param("enterpriseId") String enterpriseId,@Param("userIds") List<String> userIds);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.dept.SyncTreeNode;
|
||||
import com.cool.store.dto.enterprise.QueryDeptChildDTO;
|
||||
import com.cool.store.entity.SysDepartmentDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -29,4 +30,10 @@ public interface SysDepartmentMapper {
|
||||
void batchInsertOrUpdate(@Param("list") List<SysDepartmentDO> sysDepartmentDOList, @Param("eid") String eid);
|
||||
|
||||
List<QueryDeptChildDTO> getDeptChildListByParentId(@Param("eid") String eid, @Param("parentId") String parentId);
|
||||
|
||||
void deleteByNotInIds(@Param("list") List<String> deptIdList, @Param("eid") String eid);
|
||||
|
||||
List<SyncTreeNode> getSyncDeptTreeList(@Param("eid") String eid);
|
||||
|
||||
List<SysDepartmentDO> selectAll(@Param("eid") String eid);
|
||||
}
|
||||
@@ -27,6 +27,13 @@ public interface UserAuthMappingMapper {
|
||||
|
||||
List<UserAuthMappingDO> listUserAuthMappingByUserId(@Param("eid") String eid, @Param("userId") String userId);
|
||||
|
||||
List<UserAuthMappingDO> listUserAuthMappingByUserIds(@Param("eid") String eid,
|
||||
@Param("userIds") List<String> userIds);
|
||||
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);
|
||||
}
|
||||
@@ -30,4 +30,6 @@ public interface UserRegionMappingMapper {
|
||||
void deletedByUserIds(@Param("enterpriseId") String enterpriseId,@Param("userIds") List<String> userIds);
|
||||
|
||||
List<UserRegionMappingDO> listUserRegionMappingByUserId(@Param("enterpriseId") String enterpriseId, @Param("userIds") List<String> userIds);
|
||||
|
||||
void deletedByIds(@Param("enterpriseId") String enterpriseId,@Param("ids") List<Integer> ids);
|
||||
}
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
<select id="getDistinctDbServer" resultMap="BaseResultMap">
|
||||
select
|
||||
distinct db_server, db_port, db_user, db_pwd
|
||||
distinct db_server, db_port, db_user, db_pwd, db_name
|
||||
from
|
||||
enterprise_config
|
||||
</select>
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
<?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>
|
||||
@@ -670,4 +670,219 @@
|
||||
order by id
|
||||
</select>
|
||||
|
||||
<update id="updateEnterpriseUser">
|
||||
update enterprise_user_${eid}
|
||||
<set>
|
||||
<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.workPlace != null and enterpriseUserDO.workPlace !=''">`work_place` =
|
||||
#{enterpriseUserDO.workPlace},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.mobile != null and enterpriseUserDO.mobile !=''">`mobile` =
|
||||
#{enterpriseUserDO.mobile},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.email != null and enterpriseUserDO.email !=''">`email` = #{enterpriseUserDO.email},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.orgEmail != null and enterpriseUserDO.orgEmail !=''">`org_email` =
|
||||
#{enterpriseUserDO.orgEmail},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.active != null">`active` =
|
||||
#{enterpriseUserDO.active},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.orderInDepts != null and enterpriseUserDO.orderInDepts !=''">`order_in_depts` =
|
||||
#{enterpriseUserDO.orderInDepts},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.mainAdmin != null">`main_admin` = #{enterpriseUserDO.mainAdmin},</if>
|
||||
<if test="enterpriseUserDO.isAdmin != null">`is_admin` = #{enterpriseUserDO.isAdmin},</if>
|
||||
<if test="enterpriseUserDO.isBoss != null">`is_boss` = #{enterpriseUserDO.isBoss},</if>
|
||||
<if test="enterpriseUserDO.dingid != null and enterpriseUserDO.dingid !=''">`dingId` =
|
||||
#{enterpriseUserDO.dingid},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.unionid != null and enterpriseUserDO.unionid !=''">`unionid` =
|
||||
#{enterpriseUserDO.unionid},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.isLeaderInDepts != null and enterpriseUserDO.isLeaderInDepts !=''">
|
||||
`is_leader_in_depts` = #{enterpriseUserDO.isLeaderInDepts},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.isHide != null">`is_hide` = #{enterpriseUserDO.isHide},</if>
|
||||
|
||||
<if test="enterpriseUserDO.position != null and enterpriseUserDO.position !=''">`position` =
|
||||
#{enterpriseUserDO.position},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.avatar != null and enterpriseUserDO.avatar !=''">`avatar` =
|
||||
#{enterpriseUserDO.avatar},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.jobnumber != null and enterpriseUserDO.jobnumber !=''">`jobnumber` =
|
||||
#{enterpriseUserDO.jobnumber},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.extattr != null and enterpriseUserDO.extattr !=''">`extattr` =
|
||||
#{enterpriseUserDO.extattr},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.isEnterprise != null">`is_enterprise` =
|
||||
#{enterpriseUserDO.isEnterprise},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.roles != null and enterpriseUserDO.roles !=''">`roles` = #{enterpriseUserDO.roles},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.monitoredDepartments != null and enterpriseUserDO.monitoredDepartments !=''">`
|
||||
monitored_departments` = #{enterpriseUserDO.monitoredDepartments},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.departments != null and enterpriseUserDO.departments !=''">`departments` =
|
||||
#{enterpriseUserDO.departments},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.isLeader != null">`is_leader` = #{enterpriseUserDO.isLeader},</if>
|
||||
<if test="enterpriseUserDO.faceUrl != null and enterpriseUserDO.faceUrl !=''">`face_url` =
|
||||
#{enterpriseUserDO.faceUrl},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.createTime != null">`create_time` = #{enterpriseUserDO.createTime},</if>
|
||||
<if test="enterpriseUserDO.language != null and enterpriseUserDO.language !=''">`language` =
|
||||
#{enterpriseUserDO.language},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.userStatus != null">`user_status` =
|
||||
#{enterpriseUserDO.userStatus},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.thirdOaUniqueFlag != null and enterpriseUserDO.thirdOaUniqueFlag !=''">`third_oa_unique_flag` =
|
||||
#{enterpriseUserDO.thirdOaUniqueFlag},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.userRegionIds != null and enterpriseUserDO.userRegionIds !=''">
|
||||
`user_region_ids` = #{enterpriseUserDO.userRegionIds},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.subordinateChange != null and enterpriseUserDO.subordinateChange !=''">
|
||||
`subordinate_change` = #{enterpriseUserDO.subordinateChange},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.subordinateRange != null and enterpriseUserDO.subordinateRange !=''">
|
||||
`subordinate_range` = #{enterpriseUserDO.subordinateRange},
|
||||
</if>
|
||||
<if test="enterpriseUserDO.remark != null and enterpriseUserDO.remark !=''">
|
||||
`remark` = #{enterpriseUserDO.remark},
|
||||
</if>
|
||||
</set>
|
||||
where user_id =#{enterpriseUserDO.userId}
|
||||
</update>
|
||||
|
||||
<select id="getMainAdminUserIds" resultType="string">
|
||||
select user_id from enterprise_user_${eid} where main_admin = true and active = true
|
||||
</select>
|
||||
|
||||
<select id="selectSpecifyNodeUserIds" resultType="string">
|
||||
select
|
||||
user_id
|
||||
from
|
||||
enterprise_user_${eid}
|
||||
where
|
||||
departments like concat('%/',#{dingDeptId},'/%')
|
||||
</select>
|
||||
|
||||
<select id="selectAllUserIds" resultType="java.lang.String">
|
||||
select user_id as userId from enterprise_user_${eid}
|
||||
</select>
|
||||
|
||||
<select id="selectByUserIdIgnoreActive" resultType="com.cool.store.entity.EnterpriseUserDO">
|
||||
select
|
||||
id as id,
|
||||
user_id as userId,
|
||||
`name` as name,
|
||||
tel as tel,
|
||||
work_place as workPlace,
|
||||
remark as remark,
|
||||
mobile as mobile,
|
||||
email as email,
|
||||
org_email as orgEmail,
|
||||
active as active,
|
||||
order_in_depts as orderInDepts,
|
||||
is_admin as isAdmin,
|
||||
is_boss as isBoss,
|
||||
dingId as dingId,
|
||||
unionid as unionid,
|
||||
is_leader_in_depts as isLeaderInDepts,
|
||||
is_hide as isHide,
|
||||
`position` as position,
|
||||
avatar as avatar,
|
||||
face_url as faceUrl,
|
||||
jobnumber as jobnumber,
|
||||
extattr as extattr,
|
||||
is_enterprise as isEnterprise,
|
||||
roles as roles,
|
||||
monitored_departments as monitoredDepartments,
|
||||
departments as departments,
|
||||
is_leader as isLeader,
|
||||
create_time as createTime,
|
||||
`language` as language,
|
||||
third_oa_unique_flag as thirdOaUniqueFlag,
|
||||
subordinate_change as subordinateChange,
|
||||
subordinate_range as subordinateRange
|
||||
from enterprise_user_${enterpriseId} where user_id = #{userId, jdbcType=VARCHAR}
|
||||
</select>
|
||||
|
||||
<insert id="insertEnterpriseUser">
|
||||
insert into enterprise_user_${eid}
|
||||
( `id`,
|
||||
`user_id`,
|
||||
`name`,
|
||||
`tel`,
|
||||
`work_place`,
|
||||
`remark`,
|
||||
`mobile`,
|
||||
`email`,
|
||||
`org_email`,
|
||||
`active`,
|
||||
`order_in_depts`,
|
||||
`main_admin`,
|
||||
`is_admin`,
|
||||
`is_boss`,
|
||||
`dingId`,
|
||||
`unionid`,
|
||||
`is_leader_in_depts`,
|
||||
`is_hide`,
|
||||
`position`,
|
||||
`avatar`,
|
||||
`jobnumber`,
|
||||
`extattr`,
|
||||
`is_enterprise`,
|
||||
`roles`,
|
||||
`monitored_departments`,
|
||||
`departments`,
|
||||
`is_leader`,
|
||||
`face_url`,
|
||||
`create_time`,
|
||||
`user_status`,
|
||||
`third_oa_unique_flag`,
|
||||
`subordinate_range`
|
||||
)
|
||||
values
|
||||
(
|
||||
#{entity.id},
|
||||
#{entity.userId},
|
||||
#{entity.name},
|
||||
#{entity.tel},
|
||||
#{entity.workPlace},
|
||||
#{entity.remark},
|
||||
#{entity.mobile},
|
||||
#{entity.email},
|
||||
#{entity.orgEmail},
|
||||
#{entity.active},
|
||||
#{entity.orderInDepts},
|
||||
#{entity.mainAdmin},
|
||||
#{entity.isAdmin},
|
||||
#{entity.isBoss},
|
||||
#{entity.dingid},
|
||||
#{entity.unionid},
|
||||
#{entity.isLeaderInDepts},
|
||||
#{entity.isHide},
|
||||
#{entity.position},
|
||||
#{entity.avatar},
|
||||
#{entity.jobnumber},
|
||||
#{entity.extattr},
|
||||
#{entity.isEnterprise},
|
||||
#{entity.roles},
|
||||
#{entity.monitoredDepartments},
|
||||
#{entity.departments},
|
||||
#{entity.isLeader},
|
||||
#{entity.faceUrl},
|
||||
now(),
|
||||
#{entity.userStatus},
|
||||
#{entity.thirdOaUniqueFlag},
|
||||
#{entity.subordinateRange}
|
||||
)
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@@ -100,4 +100,37 @@
|
||||
left join sys_role_${eip} c on c.id = b.role_id
|
||||
where b.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteBatchByPrimaryKey">
|
||||
delete from enterprise_user_role_${eid} where id in
|
||||
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectIdsByUserId" resultType="java.lang.Long">
|
||||
select id from enterprise_user_role_${eid} where user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="selectByUserIdAndRoleId" resultMap="BaseResultMap">
|
||||
select * from enterprise_user_role_${eid}
|
||||
where user_id = #{userId} and role_id = #{roleId}
|
||||
order by id asc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<insert id="save">
|
||||
insert ignore into enterprise_user_role_${eid}
|
||||
(
|
||||
`role_id`,
|
||||
`user_id`,
|
||||
`create_time`
|
||||
)
|
||||
values
|
||||
(
|
||||
#{entity.roleId},
|
||||
#{entity.userId},
|
||||
#{entity.createTime}
|
||||
)
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -376,6 +376,7 @@
|
||||
syn_ding_dept_id as synDingDeptId,
|
||||
region_type as regionType,
|
||||
deleted as deleted,
|
||||
region_path as regionPath,
|
||||
store_id as storeId
|
||||
from region_${eid}
|
||||
where region_type = 'store'
|
||||
@@ -385,4 +386,204 @@
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="getByRegionId" resultType="com.cool.store.entity.RegionDO">
|
||||
select
|
||||
id ,
|
||||
id as regionId,
|
||||
name as name ,
|
||||
parent_id as parentId,
|
||||
group_id as groupId,
|
||||
create_time as createTime,
|
||||
create_name as createName,
|
||||
update_time as updateTime,
|
||||
update_name as updateName,
|
||||
syn_ding_dept_id as synDingDeptId,
|
||||
store_id as storeId,
|
||||
region_type as regionType,
|
||||
region_path as regionPath,
|
||||
deleted,
|
||||
store_num as storeNum
|
||||
from region_${eid}
|
||||
where id = #{regionId}
|
||||
</select>
|
||||
|
||||
<select id="getRegionByRegionId" resultType="com.cool.store.dto.region.RegionNode">
|
||||
select
|
||||
id ,
|
||||
id as regionId,
|
||||
name as name ,
|
||||
parent_id as parentId,
|
||||
group_id as groupId,
|
||||
create_time as createTime,
|
||||
create_name as createName,
|
||||
update_time as updateTime,
|
||||
update_name as updateName,
|
||||
syn_ding_dept_id as synDingDeptId,
|
||||
region_type as regionType,
|
||||
region_path as regionPath,
|
||||
store_num as storeCount
|
||||
from region_${eid} where id = #{regionId, jdbcType=BIGINT} and deleted = 0
|
||||
</select>
|
||||
|
||||
<insert id="insertOrUpdate" useGeneratedKeys="true" keyProperty="record.id">
|
||||
insert into region_${eid}
|
||||
(
|
||||
id,
|
||||
name,
|
||||
<if test="record.parentId != null">
|
||||
parent_id,
|
||||
</if>
|
||||
region_type,
|
||||
create_time,
|
||||
syn_ding_dept_id,
|
||||
unclassified_flag,
|
||||
third_dept_id
|
||||
) value
|
||||
(
|
||||
#{record.id, jdbcType=BIGINT},
|
||||
#{record.name, jdbcType=VARCHAR},
|
||||
<if test="record.parentId != null">
|
||||
#{record.parentId, jdbcType=BIGINT},
|
||||
</if>
|
||||
#{record.regionType, jdbcType=VARCHAR},
|
||||
#{record.createTime, jdbcType=BIGINT},
|
||||
#{record.synDingDeptId, jdbcType=VARCHAR},
|
||||
#{record.unclassifiedFlag},
|
||||
#{record.thirdDeptId}
|
||||
)
|
||||
ON DUPLICATE KEY UPDATE name=values(name), parent_id=values(parent_id), syn_ding_dept_id=values(syn_ding_dept_id),third_dept_id=values(third_dept_id),
|
||||
update_time = values(update_time), region_type = values(region_type), deleted = values(deleted)
|
||||
</insert>
|
||||
|
||||
<select id="getSpecifiedRegionIdAndDeptId" resultType="com.cool.store.dto.region.RegionSyncDTO">
|
||||
select
|
||||
id ,
|
||||
syn_ding_dept_id as synDingDeptId
|
||||
from region_${eid}
|
||||
where (id > 0 or id = -3) and (deleted = 0 or syn_ding_dept_id is not null)
|
||||
<if test="parentId!=null">
|
||||
and region_path like concat('%/',#{parentId},'/%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getRegionByDingDeptIds" resultType="com.cool.store.entity.RegionDO">
|
||||
select
|
||||
id ,
|
||||
region_id as regionId,
|
||||
name as name ,
|
||||
parent_id as parentId,
|
||||
group_id as groupId,
|
||||
create_time as createTime,
|
||||
create_name as createName,
|
||||
update_time as updateTime,
|
||||
update_name as updateName,
|
||||
syn_ding_dept_id as synDingDeptId,
|
||||
region_type as regionType,
|
||||
deleted as deleted
|
||||
from region_${eid}
|
||||
where deleted = 0
|
||||
and syn_ding_dept_id in (
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="getBySynDingDeptId" resultType="com.cool.store.entity.RegionDO">
|
||||
select
|
||||
id ,
|
||||
id as regionId,
|
||||
name as name ,
|
||||
parent_id as parentId,
|
||||
group_id as groupId,
|
||||
create_time as createTime,
|
||||
create_name as createName,
|
||||
update_time as updateTime,
|
||||
update_name as updateName,
|
||||
syn_ding_dept_id as synDingDeptId,
|
||||
store_id as storeId,
|
||||
region_type as regionType,
|
||||
region_path as regionPath,
|
||||
deleted,
|
||||
store_num as storeNum
|
||||
from region_${eid}
|
||||
where syn_ding_dept_id = #{synDingDeptId}
|
||||
</select>
|
||||
|
||||
<insert id="ignoreInsert" keyColumn="id" keyProperty="region.id" useGeneratedKeys="true">
|
||||
insert ignore into region_${eid}
|
||||
(
|
||||
region_id,
|
||||
name,
|
||||
parent_id,
|
||||
group_id,
|
||||
create_time,
|
||||
create_name
|
||||
<if test="region.regionPath !=null and region.regionPath!=''">
|
||||
,region_path
|
||||
</if>
|
||||
<if test="region.regionType !=null and region.regionType!=''">
|
||||
,region_type
|
||||
</if>
|
||||
<if test="region.storeId !=null and region.storeId!=''">
|
||||
,store_id
|
||||
</if>
|
||||
<if test="region.synDingDeptId !=null and region.synDingDeptId!=''">
|
||||
,syn_ding_dept_id
|
||||
</if>
|
||||
,order_num
|
||||
)
|
||||
values
|
||||
(
|
||||
#{region.regionId, jdbcType=VARCHAR},
|
||||
#{region.name, jdbcType=VARCHAR},
|
||||
#{region.parentId, jdbcType=VARCHAR},
|
||||
#{region.groupId, jdbcType=VARCHAR},
|
||||
#{region.createTime, jdbcType=BIGINT},
|
||||
#{region.createName, jdbcType=VARCHAR}
|
||||
<if test="region.regionPath !=null and region.regionPath!=''">
|
||||
,#{region.regionPath}
|
||||
</if>
|
||||
<if test="region.regionType !=null and region.regionType!=''">
|
||||
,#{region.regionType}
|
||||
</if>
|
||||
<if test="region.storeId !=null and region.storeId!=''">
|
||||
,#{region.storeId}
|
||||
</if>
|
||||
<if test="region.synDingDeptId !=null and region.synDingDeptId!=''">
|
||||
,#{region.synDingDeptId}
|
||||
</if>
|
||||
,(SELECT max(order_num)+1 FROM region_${eid} AS num)
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateSyncRegion" >
|
||||
update region_${eid}
|
||||
set `parent_id` = #{item.parentId},
|
||||
`name` = #{item.name},
|
||||
<if test="item.regionType != null and item.regionType != ''">
|
||||
`region_type` = #{item.regionType},
|
||||
</if>
|
||||
`deleted` = #{item.deleted},
|
||||
`update_time` = #{item.updateTime},
|
||||
<if test="item.storeId != null and item.storeId != ''">
|
||||
store_id = #{item.storeId},
|
||||
</if>
|
||||
`region_path` = #{item.regionPath}
|
||||
where id = #{item.id}
|
||||
</update>
|
||||
|
||||
<update id="removeRegions">
|
||||
update region_${eid}
|
||||
set
|
||||
deleted = 1,
|
||||
parent_id = -1
|
||||
where id in
|
||||
<foreach collection="regionIds" index="index" item="regionId"
|
||||
separator="," open="(" close=")">
|
||||
#{regionId, jdbcType=BIGINT}
|
||||
</foreach>
|
||||
and id != 1
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -437,7 +437,7 @@
|
||||
<if test="regionIdList != null and regionIdList.size >0 ">
|
||||
and region_id in
|
||||
<foreach collection="regionIdList" item="regionId" separator="," open="(" close=" )">
|
||||
#{regionId,jdbcType=BIGINT}
|
||||
#{regionId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
@@ -451,4 +451,187 @@
|
||||
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>
|
||||
@@ -164,4 +164,15 @@
|
||||
)
|
||||
</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>
|
||||
@@ -229,4 +229,30 @@
|
||||
from sys_department_${eid}
|
||||
where parent_id = #{parentId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByNotInIds">
|
||||
delete from sys_department_${eid}
|
||||
where id not in
|
||||
<foreach collection="list" item="item" open="(" separator="," close=")" >
|
||||
#{item}
|
||||
</foreach>
|
||||
and id != '1'
|
||||
</delete>
|
||||
|
||||
<select id="getSyncDeptTreeList" resultType="com.cool.store.dto.dept.SyncTreeNode">
|
||||
select
|
||||
id,
|
||||
name,
|
||||
parent_id as pid
|
||||
from sys_department_${eid}
|
||||
</select>
|
||||
|
||||
<select id="selectAll" resultType="com.cool.store.entity.SysDepartmentDO">
|
||||
select
|
||||
id,
|
||||
name,
|
||||
parent_id as parentId,
|
||||
depart_order as departOrder
|
||||
from sys_department_${eid}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -112,4 +112,45 @@
|
||||
#{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>
|
||||
@@ -122,4 +122,11 @@
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<delete id="deletedByIds">
|
||||
delete from user_region_mapping_${enterpriseId} where id in
|
||||
<foreach collection="ids" open="(" close=")" separator="," item="id">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -3,4 +3,4 @@ jdbc.url = jdbc:mysql://dingpushcoolcollege.mysql.rds.aliyuncs.com:3306/coolcoll
|
||||
jdbc.user= coolstore
|
||||
jdbc.password = CSCErYcXniNYm7bT
|
||||
|
||||
table.name = enterprise_user_group_mapping_e88b6a2bc1334164b54977a4dbfe5d9d
|
||||
table.name = enterprise_user_department_e88b6a2bc1334164b54977a4dbfe5d9d
|
||||
Reference in New Issue
Block a user