Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner
# Conflicts: # coolstore-partner-common/src/main/java/com/cool/store/enums/ErrorCodeEnum.java
This commit is contained in:
@@ -39,6 +39,9 @@ public class EnterpriseUserDAO {
|
||||
* @param excludeUserIds
|
||||
*/
|
||||
public void deleteUser(List<String> excludeUserIds){
|
||||
if(CollectionUtils.isEmpty(excludeUserIds)){
|
||||
return;
|
||||
}
|
||||
enterpriseUserMapper.deleteUser(excludeUserIds);
|
||||
}
|
||||
}
|
||||
@@ -29,11 +29,18 @@ public class EnterpriseUserRoleDAO {
|
||||
return enterpriseUserRoleMapper.batchInsertOrUpdate(recordList);
|
||||
}
|
||||
|
||||
public Integer deleteUserRole(String roleId, DataSourceEnum dataSourceEnum, List<String> userIds){
|
||||
if(StringUtils.isBlank(roleId) || Objects.isNull(dataSourceEnum)){
|
||||
public Integer deleteRoleInUser(String roleId, DataSourceEnum dataSourceEnum, List<String> excludeUserIds){
|
||||
if(StringUtils.isBlank(roleId) || Objects.isNull(dataSourceEnum) || CollectionUtils.isEmpty(excludeUserIds)){
|
||||
return null;
|
||||
}
|
||||
return enterpriseUserRoleMapper.deleteUserRole(roleId, dataSourceEnum.getCode(), userIds);
|
||||
return enterpriseUserRoleMapper.deleteRoleInUser(roleId, dataSourceEnum.getCode(), excludeUserIds);
|
||||
}
|
||||
|
||||
public Integer deleteUserInRole(String userId, DataSourceEnum dataSourceEnum, String excludeRoleId){
|
||||
if(StringUtils.isAnyBlank(userId, excludeRoleId) || Objects.isNull(dataSourceEnum)){
|
||||
return null;
|
||||
}
|
||||
return enterpriseUserRoleMapper.deleteUserInRole(userId, dataSourceEnum.getCode(), excludeRoleId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
|
||||
import com.cool.store.entity.HyPartnerIntentInfoDO;
|
||||
import com.cool.store.mapper.HyPartnerIntentInfoMapper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
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 suzhuhong
|
||||
* @Date 2023/6/9 15:02
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public class HyPartnerIntentInfoDAO {
|
||||
|
||||
|
||||
@Resource
|
||||
HyPartnerIntentInfoMapper hyPartnerIntentInfoMapper;
|
||||
|
||||
public int insertSelective( HyPartnerIntentInfoDO record){
|
||||
return hyPartnerIntentInfoMapper.insertSelective(record);
|
||||
}
|
||||
|
||||
public int updateByPrimaryKeySelective(HyPartnerIntentInfoDO record){
|
||||
return hyPartnerIntentInfoMapper.updateByPrimaryKeySelective(record);
|
||||
}
|
||||
|
||||
public HyPartnerIntentInfoDO selectByPrimaryKeySelective(Long id){
|
||||
if (id==null){
|
||||
return null;
|
||||
}
|
||||
return hyPartnerIntentInfoMapper.selectByPrimaryKeySelective(id);
|
||||
}
|
||||
|
||||
|
||||
public PageInfo<PartnerIntentApplyInfoDTO> selectPartnerIntentApplyInfoList(String userId, String workflowStage, String workflowStatus){
|
||||
if (StringUtils.isEmpty(userId)){
|
||||
return new PageInfo<>();
|
||||
}
|
||||
return hyPartnerIntentInfoMapper.selectPartnerIntentApplyInfoList(userId,workflowStage,workflowStatus);
|
||||
}
|
||||
|
||||
|
||||
public PartnerIntentApplyInfoDTO selectByLineId(Long lineId){
|
||||
if (lineId==null){
|
||||
return null;
|
||||
}
|
||||
return hyPartnerIntentInfoMapper.selectByLineId(lineId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.dto.partner.PartnerInterviewInfoDTO;
|
||||
import com.cool.store.dto.partner.SpecialDateRangeInterviewCountDTO;
|
||||
import com.cool.store.entity.HyPartnerInterviewPlanDO;
|
||||
import com.cool.store.mapper.HyPartnerInterviewPlanMapper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2023/6/8 14:54
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public class HyPartnerInterviewPlanDAO {
|
||||
|
||||
@Resource
|
||||
HyPartnerInterviewPlanMapper hyPartnerInterviewPlanMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询当前用户当天是否有面试
|
||||
* @param userId
|
||||
* @param currentDate
|
||||
* @return
|
||||
*/
|
||||
public Integer getCurrentDateInterviewCount(String userId,String currentDate){
|
||||
if (StringUtils.isEmpty(userId)){
|
||||
return 0;
|
||||
}
|
||||
return hyPartnerInterviewPlanMapper.getCurrentDateInterviewCount(userId,currentDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询指定日期面试数量 与未来7天面试数量
|
||||
* @param userId
|
||||
* @param currentDate
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
public SpecialDateRangeInterviewCountDTO getInterviewCount(String userId, String currentDate, String startTime, String endTime){
|
||||
if (StringUtils.isEmpty(userId)){
|
||||
return new SpecialDateRangeInterviewCountDTO();
|
||||
}
|
||||
return hyPartnerInterviewPlanMapper.getInterviewCount(userId,currentDate,startTime,endTime);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 当天还有几场面试
|
||||
* @param userId
|
||||
* @param currentDate
|
||||
* @return
|
||||
*/
|
||||
public List<HyPartnerInterviewPlanDO> getInterviewPlanList(String userId, String currentDate){
|
||||
if (StringUtils.isEmpty(userId)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return hyPartnerInterviewPlanMapper.getInterviewPlanList(userId,currentDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工作台 招商经理 预约面试时间 合格资格面试 列表
|
||||
* @param userId
|
||||
* @param workflowStage
|
||||
* @param workflowStatus
|
||||
* @return
|
||||
*/
|
||||
public PageInfo<PartnerInterviewInfoDTO> getPartnerInterviewInfoList(String userId, String workflowStage,String workflowStatus){
|
||||
if (StringUtils.isEmpty(userId)){
|
||||
return new PageInfo();
|
||||
}
|
||||
return hyPartnerInterviewPlanMapper.getPartnerInterviewInfoList(userId,workflowStage,workflowStatus);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.dto.partner.PartnerBlackListDTO;
|
||||
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
|
||||
import com.cool.store.dto.partner.PartnerLineInfoAndBaseInfoDTO;
|
||||
import com.cool.store.dto.partner.StageCountDTO;
|
||||
import com.cool.store.entity.HyPartnerLineInfoDO;
|
||||
import com.cool.store.mapper.HyPartnerLineInfoMapper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
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 suzhuhong
|
||||
* @Date 2023/6/8 15:10
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public class HyPartnerLineInfoDAO {
|
||||
|
||||
|
||||
@Resource
|
||||
HyPartnerLineInfoMapper hyPartnerLineInfoMapper;
|
||||
|
||||
|
||||
public int insertSelective(HyPartnerLineInfoDO hyPartnerLineInfoDO){
|
||||
return hyPartnerLineInfoMapper.insertSelective(hyPartnerLineInfoDO);
|
||||
}
|
||||
|
||||
public int batchInsert(List<HyPartnerLineInfoDO> hyPartnerLineInfoDOS){
|
||||
if (CollectionUtils.isEmpty(hyPartnerLineInfoDOS)){
|
||||
return -1;
|
||||
}
|
||||
return hyPartnerLineInfoMapper.batchInsert(hyPartnerLineInfoDOS);
|
||||
}
|
||||
|
||||
|
||||
public int batchDeleted(List<Long> lineIdList){
|
||||
if (CollectionUtils.isEmpty(lineIdList)){
|
||||
return -1;
|
||||
}
|
||||
return hyPartnerLineInfoMapper.batchDeleted(lineIdList);
|
||||
}
|
||||
|
||||
public HyPartnerLineInfoDO selectByPrimaryKeySelective(Long id){
|
||||
if (id==null){
|
||||
return null;
|
||||
}
|
||||
return hyPartnerLineInfoMapper.selectByPrimaryKeySelective(id);
|
||||
}
|
||||
|
||||
public int updateByPrimaryKeySelective(HyPartnerLineInfoDO hyPartnerLineInfoDO){
|
||||
return hyPartnerLineInfoMapper.updateByPrimaryKeySelective(hyPartnerLineInfoDO);
|
||||
}
|
||||
|
||||
|
||||
public Integer getAdventLineCount( String userId, String currentDate){
|
||||
if (StringUtils.isEmpty(userId)){
|
||||
return 0;
|
||||
}
|
||||
return hyPartnerLineInfoMapper.getAdventLineCount(userId,currentDate);
|
||||
}
|
||||
|
||||
public StageCountDTO selectStagePendingCount(String userId){
|
||||
if (StringUtils.isEmpty(userId)){
|
||||
return new StageCountDTO(0,0);
|
||||
}
|
||||
return hyPartnerLineInfoMapper.selectStagePendingCount(userId);
|
||||
}
|
||||
|
||||
public StageCountDTO selectStageFollowCount(String userId){
|
||||
if (StringUtils.isEmpty(userId)){
|
||||
return new StageCountDTO(0,0,0);
|
||||
}
|
||||
return hyPartnerLineInfoMapper.selectStageFollowCount(userId);
|
||||
}
|
||||
|
||||
|
||||
public PartnerLineInfoAndBaseInfoDTO selectPartnerLineInfoAndBaseInfo(Long lineId){
|
||||
if (lineId==null){
|
||||
return null;
|
||||
}
|
||||
return hyPartnerLineInfoMapper.selectPartnerLineInfoAndBaseInfo(lineId);
|
||||
}
|
||||
|
||||
public PageInfo<HyPartnerLineInfoDO> lastMonthCloseLine(String userId, String lastMonthTodayDate){
|
||||
if (userId==null){
|
||||
return new PageInfo<>();
|
||||
}
|
||||
return hyPartnerLineInfoMapper.lastMonthCloseLine(userId,lastMonthTodayDate);
|
||||
}
|
||||
|
||||
public int updateInvestmentManager(String userId, List<Long> lineIdList){
|
||||
if (StringUtils.isEmpty(userId)||CollectionUtils.isEmpty(lineIdList)){
|
||||
return -1;
|
||||
}
|
||||
return hyPartnerLineInfoMapper.updateInvestmentManager(lineIdList,userId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<HyPartnerLineInfoDO> getLineListByLineIds( List<Long> lineIdList){
|
||||
if (CollectionUtils.isEmpty(lineIdList)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return hyPartnerLineInfoMapper.getLineListByLineIds(lineIdList);
|
||||
}
|
||||
|
||||
|
||||
public PageInfo<PartnerBlackListDTO> getBlackList( String keyWord, String intentArea , Integer acceptAdjustType){
|
||||
return hyPartnerLineInfoMapper.getBlackList(keyWord,intentArea,acceptAdjustType);
|
||||
}
|
||||
|
||||
|
||||
public Boolean joinAndRemoveBlack( Long lineId, Integer status, String joinReason, String removeReason){
|
||||
if (lineId==null){
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
return hyPartnerLineInfoMapper.joinAndRemoveBlack(lineId,status,joinReason,removeReason);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.entity.HyPartnerUserInfoDO;
|
||||
import com.cool.store.mapper.HyPartnerUserInfoMapper;
|
||||
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 suzhuhong
|
||||
* @Date 2023/6/8 19:41
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Repository
|
||||
public class HyPartnerUserInfoDAO {
|
||||
|
||||
|
||||
@Resource
|
||||
HyPartnerUserInfoMapper hyPartnerUserInfoMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 根据PartnerId查询用户
|
||||
* @param partnerId
|
||||
* @return
|
||||
*/
|
||||
public HyPartnerUserInfoDO selectByPartnerId(String partnerId){
|
||||
if (StringUtils.isEmpty(partnerId)){
|
||||
return null;
|
||||
}
|
||||
return hyPartnerUserInfoMapper.selectByPartnerId(partnerId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据PartnerIds批量查询用户
|
||||
* @param partnerIds
|
||||
* @return
|
||||
*/
|
||||
public List<HyPartnerUserInfoDO> selectByPartnerIds(List<String> partnerIds){
|
||||
if (CollectionUtils.isEmpty(partnerIds)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return hyPartnerUserInfoMapper.selectByPartnerIds(partnerIds);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.cool.store.dao;
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.entity.RegionDO;
|
||||
import com.cool.store.mapper.RegionMapper;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@@ -37,4 +38,15 @@ public class RegionDAO {
|
||||
return regionMapper.deleteNotExistRegion(regionIds);
|
||||
}
|
||||
|
||||
public List<RegionDO> getRegionByRegionIds(List<String> regionIds){
|
||||
if(CollectionUtils.isEmpty(regionIds)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return regionMapper.getRegionByRegionIds(regionIds);
|
||||
}
|
||||
|
||||
public List<RegionDO> getRegionBaseInfoList(){
|
||||
return regionMapper.getRegionBaseInfoList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -43,4 +43,11 @@ public class SysRoleDAO {
|
||||
}
|
||||
return sysRoleMapper.getHighestPriorityRoleByUserId(userId);
|
||||
}
|
||||
|
||||
public SysRoleDO getRoleByName(String roleName, DataSourceEnum dataSource){
|
||||
if(StringUtils.isBlank(roleName) || Objects.isNull(dataSource)){
|
||||
return null;
|
||||
}
|
||||
return sysRoleMapper.getRoleByName(roleName, dataSource.getCode());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,4 +37,18 @@ public class UserRegionMappingDAO {
|
||||
return userRegionMappingMapper.deleteUserRegion(regionId, dataSourceEnum.getCode(), excludeUserIds);
|
||||
}
|
||||
|
||||
public Integer deleteRegionUserByExcludeRegionIds(List<String> excludeRegionIds){
|
||||
if(CollectionUtils.isEmpty(excludeRegionIds)){
|
||||
return null;
|
||||
}
|
||||
return userRegionMappingMapper.deleteRegionUserByExcludeRegionIds(excludeRegionIds);
|
||||
}
|
||||
|
||||
public Integer deleteRegionUserByExcludeUserIds(List<String> excludeUserIds){
|
||||
if(CollectionUtils.isEmpty(excludeUserIds)){
|
||||
return null;
|
||||
}
|
||||
return userRegionMappingMapper.deleteRegionUserByExcludeUserIds(excludeUserIds);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -32,5 +32,7 @@ public interface EnterpriseUserRoleMapper {
|
||||
* @param userIds
|
||||
* @return
|
||||
*/
|
||||
int deleteUserRole(@Param("roleId") String roleId, @Param("type") Integer type, @Param("userIds") List<String> userIds);
|
||||
int deleteRoleInUser(@Param("roleId") String roleId, @Param("type") Integer type, @Param("excludeUserIds") List<String> excludeUserIds);
|
||||
|
||||
int deleteUserInRole(@Param("userId") String userId, @Param("type") Integer type, @Param("excludeRoleId") String excludeRoleId);
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
|
||||
import com.cool.store.entity.HyPartnerIntentInfoDO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-29 03:52
|
||||
@@ -16,10 +20,31 @@ public interface HyPartnerIntentInfoMapper {
|
||||
*/
|
||||
int insertSelective(@Param("record") HyPartnerIntentInfoDO record);
|
||||
|
||||
HyPartnerIntentInfoDO selectByPrimaryKeySelective(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
*
|
||||
* 默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的
|
||||
* dateTime:2023-05-29 03:52
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") HyPartnerIntentInfoDO record);
|
||||
|
||||
|
||||
/**
|
||||
* 工作台 招商经理 意向申请阶段 待处理 待跟进 列表
|
||||
* @param userId
|
||||
* @param workflowStage
|
||||
* @param workflowStatus
|
||||
* @return
|
||||
*/
|
||||
PageInfo<PartnerIntentApplyInfoDTO> selectPartnerIntentApplyInfoList(@Param("userId") String userId,
|
||||
@Param("workflowStage") String workflowStage ,
|
||||
@Param("workflowStatus") String workflowStatus);
|
||||
|
||||
/**
|
||||
* 根据线索ID查询数据
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
PartnerIntentApplyInfoDTO selectByLineId(@Param("lineId") Long lineId);
|
||||
}
|
||||
@@ -1,8 +1,14 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.partner.PartnerInterviewInfoDTO;
|
||||
import com.cool.store.dto.partner.SpecialDateRangeInterviewCountDTO;
|
||||
import com.cool.store.entity.HyPartnerInterviewPlanDO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-29 03:52
|
||||
@@ -22,4 +28,46 @@ public interface HyPartnerInterviewPlanMapper {
|
||||
* dateTime:2023-05-29 03:52
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") HyPartnerInterviewPlanDO record);
|
||||
|
||||
/**
|
||||
* 查询当天面试数量
|
||||
* @param userId
|
||||
* @param currentDate
|
||||
* @return
|
||||
*/
|
||||
Integer getCurrentDateInterviewCount(@Param("userId") String userId, @Param("currentDate") String currentDate);
|
||||
|
||||
/**
|
||||
* todo 当天面试数据需要修改
|
||||
* 查询指定日期面试数量 与未来7天面试数量
|
||||
* @param userId
|
||||
* @param currentDate
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
SpecialDateRangeInterviewCountDTO getInterviewCount(@Param("userId") String userId,
|
||||
@Param("currentDate") String currentDate,
|
||||
@Param("startTime") String startTime,
|
||||
@Param("endTime") String endTime);
|
||||
|
||||
/**
|
||||
* 查询面试列表
|
||||
* @param userId
|
||||
* @param currentDate
|
||||
* @return
|
||||
*/
|
||||
List<HyPartnerInterviewPlanDO> getInterviewPlanList(@Param("userId") String userId,
|
||||
@Param("currentDate") String currentDate);
|
||||
|
||||
/**
|
||||
* 工作台 招商经理 预约面试时间 合格资格面试 列表
|
||||
* @param userId
|
||||
* @param workflowStage
|
||||
* @param workflowStatus
|
||||
* @return
|
||||
*/
|
||||
PageInfo<PartnerInterviewInfoDTO> getPartnerInterviewInfoList(@Param("userId") String userId,
|
||||
@Param("workflowStage") String workflowStage ,
|
||||
@Param("workflowStatus") String workflowStatus);
|
||||
}
|
||||
@@ -1,9 +1,16 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.partner.PartnerBlackListDTO;
|
||||
import com.cool.store.dto.partner.PartnerIntentApplyInfoDTO;
|
||||
import com.cool.store.dto.partner.PartnerLineInfoAndBaseInfoDTO;
|
||||
import com.cool.store.dto.partner.StageCountDTO;
|
||||
import com.cool.store.entity.HyPartnerLineInfoDO;
|
||||
import com.cool.store.entity.HyPartnerLineInfoDO;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-29 03:52
|
||||
@@ -17,10 +24,112 @@ public interface HyPartnerLineInfoMapper {
|
||||
*/
|
||||
int insertSelective(@Param("record") HyPartnerLineInfoDO record);
|
||||
|
||||
/**
|
||||
* 批量新增线索
|
||||
* @param recordList
|
||||
* @return
|
||||
*/
|
||||
int batchInsert(@Param("recordList") List<HyPartnerLineInfoDO> recordList);
|
||||
|
||||
/**
|
||||
* 批量将线索置为删除状态
|
||||
* @param lineIdList
|
||||
* @return
|
||||
*/
|
||||
int batchDeleted(@Param("lineIdList") List<Long> lineIdList);
|
||||
|
||||
/**
|
||||
* 根据ID查询数据
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
HyPartnerLineInfoDO selectByPrimaryKeySelective(Long id);
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 默认更新方法,根据主键更新,不会把null值更新到数据库,避免覆盖之前有值的
|
||||
* dateTime:2023-05-29 03:52
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") HyPartnerLineInfoDO record);
|
||||
|
||||
/**
|
||||
* 当前用户指定时间 临期线索
|
||||
* @param userId
|
||||
* @param currentDate
|
||||
* @return
|
||||
*/
|
||||
Integer getAdventLineCount(@Param("userId") String userId, @Param("currentDate") String currentDate);
|
||||
|
||||
/**
|
||||
* 招商经理 对应各阶段待处理数据
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
StageCountDTO selectStagePendingCount(@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* 招商经理 对应各个阶段 待跟进数据
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
StageCountDTO selectStageFollowCount(@Param("userId") String userId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询线索信息与加盟商基本信息
|
||||
* @param lineId
|
||||
* @return
|
||||
*/
|
||||
PartnerLineInfoAndBaseInfoDTO selectPartnerLineInfoAndBaseInfo(@Param("lineId") Long lineId);
|
||||
|
||||
/**
|
||||
* 最近30天结束的线索
|
||||
* @param userId
|
||||
* @param lastMonthTodayDate
|
||||
* @return
|
||||
*/
|
||||
PageInfo<HyPartnerLineInfoDO> lastMonthCloseLine(@Param("userId") String userId,
|
||||
@Param("lastMonthTodayDate") String lastMonthTodayDate);
|
||||
|
||||
/**
|
||||
* 修改招商经理
|
||||
* @param lineIdList
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
int updateInvestmentManager(@Param("lineIdList") List<Long> lineIdList, @Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* 根据线索ID查询线索
|
||||
* @param lineIdList
|
||||
* @return
|
||||
*/
|
||||
List<HyPartnerLineInfoDO> getLineListByLineIds(List<Long> lineIdList);
|
||||
|
||||
/**
|
||||
* 查询黑名单列表
|
||||
* @param keyWord
|
||||
* @param intentArea
|
||||
* @param acceptAdjustType
|
||||
* @return
|
||||
*/
|
||||
PageInfo<PartnerBlackListDTO> getBlackList(@Param("keyWord") String keyWord,
|
||||
@Param("intentArea") String intentArea ,
|
||||
@Param("acceptAdjustType") Integer acceptAdjustType);
|
||||
|
||||
|
||||
/**
|
||||
* 加入/移除 黑名单
|
||||
* @param lineId
|
||||
* @param status
|
||||
* @param joinReason
|
||||
* @param removeReason
|
||||
* @return
|
||||
*/
|
||||
Boolean joinAndRemoveBlack(@Param("lineId") Long lineId,
|
||||
@Param("status") Integer status,
|
||||
@Param("joinReason") String joinReason,
|
||||
@Param("removeReason") String removeReason);
|
||||
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.cool.store.mapper;
|
||||
import com.cool.store.entity.HyPartnerUserInfoDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-05-29 03:53
|
||||
@@ -22,4 +24,18 @@ public interface HyPartnerUserInfoMapper {
|
||||
* dateTime:2023-05-29 03:53
|
||||
*/
|
||||
int updateByPrimaryKeySelective(@Param("record") HyPartnerUserInfoDO record);
|
||||
|
||||
/**
|
||||
* 根据partnerID查询用户信息
|
||||
* @param partnerId
|
||||
* @return
|
||||
*/
|
||||
HyPartnerUserInfoDO selectByPartnerId(@Param("partnerId") String partnerId);
|
||||
|
||||
/**
|
||||
* 根据partnerIDs批量查询用户信息
|
||||
* @param partnerIdList
|
||||
* @return
|
||||
*/
|
||||
List<HyPartnerUserInfoDO> selectByPartnerIds(@Param("partnerIdList") List<String> partnerIdList);
|
||||
}
|
||||
@@ -31,4 +31,17 @@ public interface RegionMapper {
|
||||
* @return
|
||||
*/
|
||||
int deleteNotExistRegion(@Param("regionIds")List<String> regionIds);
|
||||
|
||||
/**
|
||||
* 根据regionIds获取region
|
||||
* @param regionIds
|
||||
* @return
|
||||
*/
|
||||
List<RegionDO> getRegionByRegionIds(@Param("regionIds")List<String> regionIds);
|
||||
|
||||
/**
|
||||
* 获取区域基本信息
|
||||
* @return
|
||||
*/
|
||||
List<RegionDO> getRegionBaseInfoList();
|
||||
}
|
||||
@@ -33,4 +33,11 @@ public interface SysRoleMapper {
|
||||
* @return
|
||||
*/
|
||||
SysRoleDO getHighestPriorityRoleByUserId(@Param("userId") String userId);
|
||||
|
||||
/**
|
||||
* 获取角色
|
||||
* @param roleName
|
||||
* @return
|
||||
*/
|
||||
SysRoleDO getRoleByName(@Param("roleName") String roleName, @Param("roleType")Integer roleType);
|
||||
}
|
||||
@@ -33,4 +33,18 @@ public interface UserRegionMappingMapper {
|
||||
* @return
|
||||
*/
|
||||
int deleteUserRegion(@Param("regionId") String regionId, @Param("type")Integer type, @Param("excludeUserIds") List<String> excludeUserIds);
|
||||
|
||||
/**
|
||||
* 删除没有的部门映射关系
|
||||
* @param excludeRegionIds
|
||||
* @return
|
||||
*/
|
||||
Integer deleteRegionUserByExcludeRegionIds(@Param("excludeRegionIds") List<String> excludeRegionIds);
|
||||
|
||||
/**
|
||||
* 删除用户不在的区域
|
||||
* @param excludeUserIds
|
||||
* @return
|
||||
*/
|
||||
Integer deleteRegionUserByExcludeUserIds(@Param("excludeUserIds") List<String> excludeUserIds);
|
||||
}
|
||||
@@ -5,12 +5,13 @@
|
||||
<id column="id" jdbcType="INTEGER" property="id"/>
|
||||
<result column="role_id" jdbcType="VARCHAR" property="roleId"/>
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
|
||||
<result column="type" jdbcType="INTEGER" property="type"/>
|
||||
<result column="deleted" jdbcType="BIT" property="deleted"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, role_id, user_id, deleted, create_time, update_time
|
||||
id, role_id, user_id, type, deleted, create_time, update_time
|
||||
</sql>
|
||||
<insert id="batchInsertOrUpdate">
|
||||
<foreach collection="recordList" separator=";" item="record">
|
||||
@@ -22,6 +23,9 @@
|
||||
<if test="record.userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="record.deleted != null">
|
||||
deleted,
|
||||
</if>
|
||||
@@ -39,6 +43,9 @@
|
||||
<if test="record.userId != null">
|
||||
#{record.userId},
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
#{record.type},
|
||||
</if>
|
||||
<if test="record.deleted != null">
|
||||
#{record.deleted},
|
||||
</if>
|
||||
@@ -61,6 +68,9 @@
|
||||
<if test="userId != null">
|
||||
user_id = #{userId},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type},
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted = #{deleted},
|
||||
</if>
|
||||
@@ -74,7 +84,11 @@
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteUserRole">
|
||||
update enterprise_user_role set deleted = 1 where role_id = #{roleId} and user_id not in <foreach collection="userIds" item="userId" separator="," open="(" close=")">#{userId}</foreach>
|
||||
<update id="deleteRoleInUser">
|
||||
update enterprise_user_role set deleted = 1 where role_id = #{roleId} and type = #{type} and user_id not in <foreach collection="excludeUserIds" item="userId" separator="," open="(" close=")">#{userId}</foreach>
|
||||
</update>
|
||||
|
||||
<update id="deleteUserInRole">
|
||||
update enterprise_user_role set deleted = 1 where role_id != #{excludeRoleId} and user_id = #{userId} and type = #{type}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -32,6 +32,14 @@
|
||||
work_exp, is_consumer, other_band, brand_strength, need_improve, strength, weakness,
|
||||
create_time, update_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKeySelective" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_partner_intent_info
|
||||
<where>
|
||||
and id = #{id}
|
||||
</where>
|
||||
</select>
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
||||
insert into hy_partner_intent_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
@@ -243,4 +251,41 @@
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
|
||||
<select id="selectPartnerIntentApplyInfoList" resultType="com.cool.store.dto.partner.PartnerIntentApplyInfoDTO">
|
||||
select
|
||||
a.id as partnerLineId,
|
||||
a.partner_id as partnerId,
|
||||
a.workflow_stage as workflowStage,
|
||||
a.workflow_status as workflowStatus,
|
||||
b.id as id,
|
||||
b.create_time as partnerSubmitTime,
|
||||
b.live_area as liveArea,
|
||||
b.want_shop_area as wantShopArea,
|
||||
b.accept_adjust_type as acceptAdjustType,
|
||||
b.deadline as deadline
|
||||
from hy_partner_intent_info b left join hy_partner_line_info a on a.id = b.partner_line_id
|
||||
<where>
|
||||
<if test="userId!=null and userId!=''">
|
||||
and a.investment_manager = #{userId}
|
||||
</if>
|
||||
<if test="workflowStage!=null and workflowStage!=''">
|
||||
and a.workflow_stage= #{workflowStage}
|
||||
</if>
|
||||
<if test="workflowStatus!=null and workflowStatus!=''">
|
||||
and a.workflow_status = #{workflowStatus}
|
||||
</if>
|
||||
</where>
|
||||
order by b.create_time
|
||||
</select>
|
||||
|
||||
<select id="selectByLineId" resultType="com.cool.store.dto.partner.PartnerIntentApplyInfoDTO">
|
||||
select
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_partner_intent_info
|
||||
<where>
|
||||
and partner_line_id = #{lineId}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -172,4 +172,69 @@
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
|
||||
<select id="getCurrentDateInterviewCount" resultType="java.lang.Integer">
|
||||
select count(1) from hy_partner_interview_plan
|
||||
<where>
|
||||
<if test="userId!=null and userId!=''">
|
||||
and interviewer = #{userId}
|
||||
</if>
|
||||
<if test="currentDate!=null and currentDate!=''">
|
||||
and interview_date = #{currentDate}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getInterviewCount" resultType="com.cool.store.dto.partner.SpecialDateRangeInterviewCountDTO">
|
||||
select
|
||||
sum(if(interview_date=#{currentDate},1,0)) as currentDayInterviewCount,
|
||||
sum(if(start_time>#{startTime} and #{endTime},1,0)) as lastSevenDayInterviewCount
|
||||
FROM hy_partner_interview_plan
|
||||
where interviewer = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="getInterviewPlanList" resultMap="BaseResultMap">
|
||||
select * from hy_partner_interview_plan
|
||||
<where>
|
||||
<if test="userId!=null and userId!=''">
|
||||
and interviewer = #{userId}
|
||||
</if>
|
||||
<if test="currentDate!=null and currentDate!=''">
|
||||
and interview_date = #{currentDate}
|
||||
</if>
|
||||
and (start_time>now() or (start_time<![CDATA[<]]>now() and room_status!=2))
|
||||
order by start_time
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getPartnerInterviewInfoList" resultType="com.cool.store.dto.partner.PartnerInterviewInfoDTO">
|
||||
select
|
||||
a.id as id,
|
||||
a.deadline as deadline,
|
||||
a.status as status,
|
||||
a.auth_code as authCode,
|
||||
a.approve_time as approveTime,
|
||||
a.process_info as processInfo,
|
||||
b.id as interviewId,
|
||||
b.partner_line_id as partnerLineId,
|
||||
b.partner_id as partnerId,
|
||||
b.start_time as startTime,
|
||||
b.end_time as endTime,
|
||||
b.interviewer as interviewer,
|
||||
b.create_time as createTime,
|
||||
b.room_id as roomId
|
||||
from hy_partner_interview a inner join hy_partner_interview_plan b on a.interview_plan_id = b.id
|
||||
<where>
|
||||
<if test="userId!=null and userId!=''">
|
||||
and a.interviewer = #{userId}
|
||||
</if>
|
||||
<if test="workflowStage!=null and workflowStage!=''">
|
||||
and a.workflow_stage= #{workflowStage}
|
||||
</if>
|
||||
<if test="workflowStatus!=null and workflowStatus!=''">
|
||||
and a.workflow_status = #{workflowStatus}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -27,6 +27,49 @@
|
||||
reject_real_reason, certify_file, deleted, create_time, update_time, close_time,
|
||||
close_user_id
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKeySelective" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_partner_line_info
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="batchInsert">
|
||||
insert into
|
||||
hy_partner_line_info
|
||||
(
|
||||
partner_id,
|
||||
workflow_stage,
|
||||
workflow_status,
|
||||
line_status,
|
||||
investment_manager
|
||||
)
|
||||
values
|
||||
<foreach collection="recordList" item="record" separator=",">
|
||||
(#{record.partnerId},
|
||||
#{record.workflowStage},
|
||||
#{record.workflowStatus},
|
||||
#{record.lineStatus},
|
||||
#{record.investmentManager})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="batchDeleted">
|
||||
update hy_partner_line_info
|
||||
set deleted = 1
|
||||
<where>
|
||||
<if test="lineIdList!=null and lineIdList.size>0">
|
||||
<foreach collection="lineIdList" open="and id in (" close=")" separator="," item="lineId">
|
||||
#{lineId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
||||
insert into hy_partner_line_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
@@ -190,7 +233,154 @@
|
||||
<if test="record.closeUserId != null">
|
||||
close_user_id = #{record.closeUserId},
|
||||
</if>
|
||||
<if test="record.joinBlackReason != null">
|
||||
join_black_reason = #{record.joinBlackReason},
|
||||
</if>
|
||||
<if test="record.removeBlackReason != null">
|
||||
remove_black_reason = #{record.removeBlackReason},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{record.id}
|
||||
</update>
|
||||
|
||||
<select id="getAdventLineCount" resultType="java.lang.Integer">
|
||||
select count(1) from hy_partner_line_info
|
||||
<where>
|
||||
<if test="userId!=null and userId!=''">
|
||||
and investment_manager = #{userId}
|
||||
</if>
|
||||
<if test="currentDate!=null and currentDate!=''">
|
||||
and deadline = #{currentDate}
|
||||
</if>
|
||||
and
|
||||
(
|
||||
(workflow_stage = 1 and workflow_status = 0) or
|
||||
(workflow_stage = 2 and workflow_status = 0) or
|
||||
(workflow_stage = 3 and workflow_status = 4)
|
||||
)
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectStagePendingCount" resultType="com.cool.store.dto.partner.StageCountDTO">
|
||||
select
|
||||
IFNULL(sum(if(workflow_stage=1 and workflow_status = 1,1,0)),0) as intentApplyApproveCount,
|
||||
IFNULL(sum(if(workflow_stage=3 and workflow_status = 3,1,0)),0) as qualifiedInterviewCount
|
||||
from hy_partner_line_info
|
||||
<where>
|
||||
<if test="userId!=null and userId!=''">
|
||||
and investment_manager = #{userId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectStageFollowCount" resultType="com.cool.store.dto.partner.StageCountDTO">
|
||||
select
|
||||
IFNULL(sum(if(workflow_stage=1 and workflow_status = 1,1,0)),0) as intentApplyApproveCount,
|
||||
IFNULL(sum(if(workflow_stage=2 and workflow_status = 0,1,0)),0) as reservationInterviewCount,
|
||||
IFNULL(sum(if(workflow_stage=3 and workflow_status = 4,1,0)),0) as qualifiedInterviewCount
|
||||
from hy_partner_line_info
|
||||
<where>
|
||||
<if test="userId!=null and userId!=''">
|
||||
and investment_manager = #{userId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectPartnerLineInfoAndBaseInfo" resultType="com.cool.store.dto.partner.PartnerLineInfoAndBaseInfoDTO">
|
||||
select
|
||||
a.id as id,
|
||||
a.partner_id as partnerId,
|
||||
a.workflow_stage as workflowStage,
|
||||
a.workflow_status as workflowStatus,
|
||||
a.partner_id as partnerUserId,
|
||||
a.investment_manager as investmentManager,
|
||||
b.user_portrait as user_portrait
|
||||
from hy_partner_line_info a inner join hy_partner_base_info b
|
||||
on a.id = b.partner_line_id
|
||||
<where>
|
||||
<if test="lineId!=null">
|
||||
and a.id = #{id}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="lastMonthCloseLine" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_partner_line_info
|
||||
<where>
|
||||
<if test="userId">
|
||||
and investment_manager = #{userId}
|
||||
</if>
|
||||
<if test="lastMonthTodayDate!=null">
|
||||
and close_time > #{lastMonthTodayDate} and close_time <![CDATA[<]]> now
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<update id="updateInvestmentManager">
|
||||
update hy_partner_line_info
|
||||
set investment_manager = #{userId}
|
||||
<if test="lineIdList!=null and lineIdList.size>0">
|
||||
<foreach collection="lineIdList" open="where id in (" close=")" separator="," item="lineId">
|
||||
#{lineId}
|
||||
</foreach>
|
||||
</if>
|
||||
</update>
|
||||
|
||||
|
||||
<select id="getLineListByLineIds" resultMap="BaseResultMap" >
|
||||
select
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_partner_line_info
|
||||
where deleted = 0
|
||||
<if test="lineIdList!=null and lineIdList.size>0">
|
||||
<foreach collection="lineIdList" open="and id in (" close=")" separator="," item="lineId">
|
||||
#{lineId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getBlackList" resultType="com.cool.store.dto.partner.PartnerBlackListDTO" >
|
||||
select
|
||||
b.partner_id as partnerId,
|
||||
b.mobile as mobile,
|
||||
b.username as partnerUserName,
|
||||
a.id as lineId,
|
||||
a.create_time as createTime,
|
||||
a.close_user_id as closeUserId,
|
||||
a.close_time as closeTime,
|
||||
a.join_black_reason as joinBlackReason
|
||||
from hy_partner_line_info a inner join hy_partner_user_info b where a.partner_id = b.partner_id
|
||||
where deleted = 0
|
||||
and line_status = 3
|
||||
<if test="keyWord!=null and keyWord !=''">
|
||||
and (b.username like concat('%', #{keyWord}, '%') or b.mobile like concat('%', #{keyWord}, '%'))
|
||||
</if>
|
||||
<if test="intentArea!=null and intentArea!=''">
|
||||
and b.want_shop_area = #{intentArea}
|
||||
</if>
|
||||
<if test="acceptAdjustType!=null">
|
||||
and b.accept_adjust_type =#{acceptAdjustType}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<update id="joinAndRemoveBlack">
|
||||
update hy_partner_line_info
|
||||
<set>
|
||||
<if test="line_status != null">
|
||||
line_status = #{status},
|
||||
</if>
|
||||
<if test="joinCause != null and joinCause!=''">
|
||||
join_black_reason = #{joinCause},
|
||||
</if>
|
||||
<if test="removeReason != null and removeReason!=''">
|
||||
remove_black_reason = #{removeReason},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{lineId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -18,6 +18,25 @@
|
||||
id, partner_id, mobile, username, live_area, want_shop_area, accept_adjust_type,
|
||||
invite_code, is_write_partner_know, create_time, update_time
|
||||
</sql>
|
||||
<select id="selectByPartnerId" resultMap="BaseResultMap" >
|
||||
select
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_partner_user_info
|
||||
where partner_id = #{partnerId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectByPartnerIds" resultMap="BaseResultMap" >
|
||||
select
|
||||
<include refid="Base_Column_List"></include>
|
||||
from hy_partner_user_info
|
||||
<if test="partnerIdList!=null and partnerIdList.size>0">
|
||||
<foreach collection="partnerIdList" open="and partner_id in (" close=")" separator="," item="partnerId">
|
||||
#{partnerId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
|
||||
insert into hy_partner_user_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
@@ -158,4 +158,23 @@
|
||||
<update id="deleteNotExistRegion">
|
||||
update region set deleted = 1 , update_time = UNIX_TIMESTAMP() where region_id not in <foreach collection="regionIds" separator="," item="regionId" open="(" close=")"> #{regionId}</foreach>
|
||||
</update>
|
||||
|
||||
<select id="getRegionByRegionIds" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from
|
||||
region
|
||||
where
|
||||
region_id in <foreach collection="regionIds" item="regionId" separator="," open="(" close=")">#{regionId}</foreach>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getRegionBaseInfoList" resultMap="BaseResultMap">
|
||||
select
|
||||
region_id, name, parent_id
|
||||
from
|
||||
region
|
||||
where
|
||||
deleted = 0
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -126,7 +126,16 @@
|
||||
from
|
||||
sys_role r inner join enterprise_user_role e on r.role_id = e.role_id
|
||||
where
|
||||
e.user_id = #{userId}
|
||||
e.user_id = #{userId} and r.deleted = 0
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="getRoleByName" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from
|
||||
sys_role
|
||||
where
|
||||
role_name = #{roleName} and role_type = #{roleType} and deleted = 0 limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -104,10 +104,19 @@
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteUserRegion">
|
||||
<update id="deleteUserRegion">
|
||||
update user_region_mapping set deleted = 1 where region_id = #{regionId} and type = #{type}
|
||||
<if test="excludeUserIds != null and excludeUserIds.size() > 0">
|
||||
and user_id not in <foreach collection="excludeUserIds" separator="," open="(" close=")" item="userId" >#{userId}</foreach>
|
||||
</if>
|
||||
</delete>
|
||||
</update>
|
||||
|
||||
<update id="deleteRegionUserByExcludeRegionIds">
|
||||
update user_region_mapping set deleted = 1 where region_id not in <foreach collection="excludeRegionIds" open="(" close=")" separator="," item="regionId">#{regionId}</foreach>
|
||||
</update>
|
||||
|
||||
<update id="deleteRegionUserByExcludeUserIds">
|
||||
update user_region_mapping set deleted = 1 where user_id not in <foreach collection="excludeUserIds" open="(" close=")" separator="," item="userId">#{userId}</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user