Merge branch 'master' into cc_20250211_v2.6

# Conflicts:
#	coolstore-partner-service/src/main/java/com/cool/store/service/impl/ShopServiceImpl.java
This commit is contained in:
shuo.wang
2025-02-14 16:18:00 +08:00
105 changed files with 3388 additions and 1274 deletions

View File

@@ -119,6 +119,9 @@ public class EnterpriseUserDAO {
public Map<String, EnterpriseUserDO> getUserInfoMap(List<String> userIds){
List<EnterpriseUserDO> userList = getUserInfoByUserIds(userIds);
if (CollectionUtils.isEmpty(userList)){
return new HashMap<>();
}
return userList.stream().collect(Collectors.toMap(k -> k.getUserId(), Function.identity()));
}

View File

@@ -100,6 +100,9 @@ public class HyOpenAreaInfoDAO {
return Maps.newHashMap();
}
List<HyOpenAreaInfoDO> hyOpenAreaInfoDOS = hyOpenAreaInfoMapper.selectByIds(ids);
if (CollectionUtils.isEmpty(hyOpenAreaInfoDOS)){
return Maps.newHashMap();
}
return ListUtils.emptyIfNull(hyOpenAreaInfoDOS).stream().collect(Collectors.toMap(k->k.getId(), v->v.getAreaPath().replace("/"," ").trim()));
}
@@ -171,4 +174,11 @@ public class HyOpenAreaInfoDAO {
List<HyOpenAreaInfoDO> openAreaInfoList = selectByIds(wantShopAreaIds);
return openAreaInfoList.stream().collect(Collectors.toMap(k->k.getId(), v->v, (k1, k2)->k1));
}
public List<Long> getChildrenListByParentIds(List<Long> parentIds) {
if (CollectionUtils.isEmpty(parentIds)) {
return Lists.newArrayList();
}
return hyOpenAreaInfoMapper.getChildrenListByParentIds(parentIds);
}
}

View File

@@ -2,10 +2,14 @@ package com.cool.store.dao;
import com.cool.store.entity.InvoicingDO;
import com.cool.store.mapper.InvoicingMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @Author suzhuhong
@@ -41,5 +45,14 @@ public class InvoicingDAO {
return invoicingMapper.selectByPrimaryKey(id);
}
public List<InvoicingDO> listByShopIds(List<Long> shopIds){
if (CollectionUtils.isEmpty(shopIds)){
return new ArrayList<>();
}
Example example = new Example(InvoicingDO.class);
example.createCriteria().andIn("shopId", shopIds);
return invoicingMapper.selectByExample(example);
}
}

View File

@@ -2,6 +2,7 @@ package com.cool.store.dao;
import com.cool.store.entity.LineFollowLogDO;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.entity.ShopInfoDO;
import com.cool.store.mapper.LineFollowLogMapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
@@ -24,9 +25,9 @@ public class LineFollowLogDAO {
@Resource
private LineFollowLogMapper lineFollowLogMapper;
public Page<LineFollowLogDO> getFollowLogPage(Long lineId, Integer pageNum, Integer pageSize){
public Page<LineFollowLogDO> getFollowLogPage(Long lineId, Integer pageNum, Integer pageSize,Integer type){
PageHelper.startPage(pageNum, pageSize);
return lineFollowLogMapper.getFollowLogPage(lineId);
return lineFollowLogMapper.getFollowLogPage(lineId,type);
}
/**
@@ -37,11 +38,19 @@ public class LineFollowLogDAO {
* @param message
* @return
*/
public Long addFollowLog(LineInfoDO lineInfo, String operateUserId, String operateUsername, String message){
public Long addFollowLog(LineInfoDO lineInfo,String operateUserId, String operateUsername, String message,Integer type){
if(Objects.isNull(lineInfo)){
return null;
}
LineFollowLogDO followLog = new LineFollowLogDO(lineInfo.getPartnerId(), lineInfo.getId(), operateUserId, operateUsername, lineInfo.getWorkflowStage(), lineInfo.getWorkflowSubStage(), lineInfo.getWorkflowSubStageStatus(), message);
LineFollowLogDO followLog = new LineFollowLogDO(lineInfo.getPartnerId(), lineInfo.getId(), operateUserId, operateUsername, lineInfo.getWorkflowStage(), lineInfo.getWorkflowSubStage(), lineInfo.getWorkflowSubStageStatus(), message,type);
lineFollowLogMapper.insertSelective(followLog);
return followLog.getId();
}
public Long addFollowLogByShop(ShopInfoDO shopInfoDO, String operateUserId, String operateUsername, String message,Integer type){
if(Objects.isNull(shopInfoDO)){
return null;
}
LineFollowLogDO followLog = new LineFollowLogDO(shopInfoDO.getPartnerId(), shopInfoDO.getId(), operateUserId, operateUsername,null,null,null, message,type);
lineFollowLogMapper.insertSelective(followLog);
return followLog.getId();
}

View File

@@ -1,5 +1,6 @@
package com.cool.store.dao;
import com.aliyun.openservices.shade.com.google.common.collect.Lists;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dto.InvestmentCountDTO;
import com.cool.store.dto.PendingCountDTO;
@@ -15,6 +16,7 @@ import com.cool.store.request.PartnerRequest;
import com.cool.store.request.PointLinePageRequest;
import com.cool.store.request.PublicLineListRequest;
import com.cool.store.utils.RandomEightCharCodeUtils;
import com.cool.store.vo.LineVO;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.google.common.collect.Maps;
@@ -26,6 +28,7 @@ import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -52,14 +55,15 @@ public class LineInfoDAO {
}
return null;
}
public Boolean getLineInfoByMobile(String mobile) {
public LineInfoDO getLineByMobile(String mobile) {
Example example = new Example(LineInfoDO.class);
example.createCriteria().andEqualTo("mobile", mobile);
List<LineInfoDO> lineInfoDOS = lineInfoMapper.selectByExample(example);
if(CollectionUtils.isNotEmpty(lineInfoDOS)) {
return true;
}
return false;
return lineInfoMapper.selectOneByExample(example);
}
public Boolean getLineInfoByMobile(String mobile) {
return Objects.nonNull(getLineByMobile(mobile));
}
public Integer updateLineInfo(LineInfoDO param){
@@ -198,4 +202,24 @@ public class LineInfoDAO {
}
return lineInfoMapper.batchUpdateInvestmentManager(lineIds, status, investmentManager,regionId);
}
public List<LineVO> getLines(String keyword){
return lineInfoMapper.getLinesByKeyword(keyword);
}
public List<LineInfoDO> getByLineIds(List<Long> lineIds){
if (CollectionUtils.isEmpty(lineIds)){
return Lists.newArrayList();
}
return lineInfoMapper.getByLineIds(lineIds);
}
public Map<Long, String> getUserNameMap(List<Long> lineIds){
if(CollectionUtils.isEmpty(lineIds)){
return Maps.newHashMap();
}
List<LineInfoDO> lineMobile = lineInfoMapper.getByLineIds(lineIds);
return lineMobile.stream().filter(o->StringUtils.isNotBlank(o.getMobile())).collect(Collectors.toMap(LineInfoDO::getId, LineInfoDO::getUsername, (k1, k2)-> k1));
}
}

View File

@@ -99,11 +99,11 @@ public class PointInfoDAO {
return pointInfoMapper.getRecommendPointList(request);
}
public Integer updateSelectedDevelopmentManager(Long lineId, String developmentManager) {
if(Objects.isNull(lineId) || StringUtils.isBlank(developmentManager)){
public Integer updateSelectedDevelopmentManager(Long shopId, String developmentManager) {
if(Objects.isNull(shopId) || StringUtils.isBlank(developmentManager)){
return null;
}
return pointInfoMapper.updateSelectedDevelopmentManager(lineId, developmentManager);
return pointInfoMapper.updateSelectedDevelopmentManager(shopId, developmentManager);
}
public Page<PointInfoDO> getTeamPointPage(AllPointPageRequest request) {

View File

@@ -3,6 +3,7 @@ package com.cool.store.dao;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dto.point.LineCountDTO;
import com.cool.store.dto.point.MiniPointPageDTO;
import com.cool.store.dto.point.ShopCountDTO;
import com.cool.store.entity.PointRecommendDO;
import com.cool.store.enums.point.PointRecommendStatusEnum;
import com.cool.store.mapper.PointRecommendMapper;
@@ -70,6 +71,7 @@ public class PointRecommendDAO {
* @param lineIds
* @return
*/
@Deprecated
public Map<Long, Integer> getPushShopNumMap(List<Long> lineIds) {
if(CollectionUtils.isEmpty(lineIds)){
return Maps.newHashMap();
@@ -78,6 +80,15 @@ public class PointRecommendDAO {
return pushShopNumMap.stream().collect(Collectors.toMap(k->k.getLineId(), v->v.getRecommendShopNum()));
}
public Map<Long, Integer> getShopPushPointNumMap(List<Long> shopIds) {
if(CollectionUtils.isEmpty(shopIds)){
return Maps.newHashMap();
}
List<ShopCountDTO> pushShopNumMap = pointRecommendMapper.getShopPushPointNumMap(shopIds);
return pushShopNumMap.stream().collect(Collectors.toMap(k->k.getShopId(), v->v.getRecommendShopNum()));
}
/**
* 获取推荐列表
* @param lineId
@@ -90,6 +101,13 @@ public class PointRecommendDAO {
return pointRecommendMapper.getRecommendPointList(lineId);
}
public List<PointRecommendDO> getShopRecommendPointList(Long lineId) {
if(Objects.isNull(lineId)){
return Lists.newArrayList();
}
return pointRecommendMapper.getShopRecommendPointList(lineId);
}
public Integer addRecommendPoint(List<PointRecommendDO> recommendList) {
if(CollectionUtils.isEmpty(recommendList)){
return CommonConstants.ZERO;
@@ -102,8 +120,8 @@ public class PointRecommendDAO {
* @param lineId
* @return
*/
public Integer turnLineUpdateRecommendStatus(Long lineId, String developmentManager) {
return pointRecommendMapper.turnLineUpdateRecommendStatus(lineId, developmentManager);
public Integer turnLineUpdateRecommendStatus(Long shopId, String developmentManager) {
return pointRecommendMapper.turnLineUpdateRecommendStatus(shopId, developmentManager);
}
/**
@@ -116,11 +134,11 @@ public class PointRecommendDAO {
return pointRecommendMapper.getLineRecommendPointPage(request);
}
public Integer updateStatusByPointIdAndLineId(Long pointId, Long lineId){
if(Objects.isNull(pointId) || Objects.isNull(lineId)){
public Integer updateStatusByPointIdAndLineId(Long pointId,Long shopId){
if(Objects.isNull(pointId) || Objects.isNull(shopId)){
return 0;
}
return pointRecommendMapper.updateStatusByPointIdAndLineId(pointId, lineId);
return pointRecommendMapper.updateStatusByPointIdAndLineId(pointId,shopId);
}
/**
@@ -130,11 +148,11 @@ public class PointRecommendDAO {
* @param reason
* @return
*/
public Integer rejectPoint(Long lineId, Long pointId, String reason) {
if(Objects.isNull(lineId) || Objects.isNull(pointId)){
public Integer rejectPoint(Long shopId, Long pointId, String reason) {
if(Objects.isNull(shopId) || Objects.isNull(pointId)){
return CommonConstants.ZERO;
}
return pointRecommendMapper.rejectPoint(lineId, pointId, reason);
return pointRecommendMapper.rejectPoint(shopId, pointId, reason);
}
/**
@@ -148,4 +166,16 @@ public class PointRecommendDAO {
}
return pointRecommendMapper.getRecommendPointListByPointId(pointId);
}
public List<PointRecommendDO> getAllRecommendPointList(Long lineId) {
return pointRecommendMapper.getAllRecommendPointList(lineId);
}
public Boolean batchUpdateShopId(List<PointRecommendDO> recommendList) {
if (CollectionUtils.isEmpty(recommendList)){
return Boolean.TRUE;
}
return pointRecommendMapper.batchUpdateShopId(recommendList);
}
}

View File

@@ -5,11 +5,15 @@ import com.cool.store.dto.LicenseSyncDTO;
import com.cool.store.dto.Preparation.PreparationDTO;
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
import com.cool.store.dto.point.LineCountDTO;
import com.cool.store.dto.point.ShopPointDTO;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.entity.ShopInfoDO;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.ShopInfoMapper;
import com.cool.store.request.BranchShopRequest;
import com.cool.store.request.PlanListRequest;
import com.cool.store.request.PointLinePageRequest;
import com.cool.store.request.PreparationRequest;
import com.cool.store.request.platformBuildListRequest;
import com.cool.store.response.PlatformBuildListResponse;
@@ -72,6 +76,13 @@ public class ShopInfoDAO {
return shopInfoMapper.getShopList(lineId);
}
public List<ShopInfoDO> getShopListByRegion(Long lineId,List<Long> regionIdList,String userId){
if(Objects.isNull(lineId)){
return new ArrayList<>();
}
return shopInfoMapper.getShopListByRegion(lineId,regionIdList,userId);
}
/**
* 新增门店信息
* @param shopInfo
@@ -150,6 +161,10 @@ public class ShopInfoDAO {
public List<PreparationDTO> ListByCondition(PreparationRequest request){
return shopInfoMapper.ListByCondition(request);
}
public List<PreparationDTO> ListByBranchShopRequest(BranchShopRequest request,String userId){
return shopInfoMapper.ListByBranchShopRequest(request,userId);
}
public Long getRegionIdByid(Long shopId){
return shopInfoMapper.getRegionIdByid(shopId);
}
@@ -181,5 +196,27 @@ public class ShopInfoDAO {
return shopInfoMapper.getShopAndStoreList(eid,shopIds);
}
public List<ShopPointDTO> getShopPointListByDevelopmentManager(PointLinePageRequest request) {
PageHelper.startPage(request.getPageNum(), request.getPageSize());
return shopInfoMapper.getShopPointListByDevelopmentManager(request);
}
public List<ShopInfoDO> selectAllDataOrByLineId(Long shopId) {
return shopInfoMapper.selectAllDataOrByLineId(shopId);
}
public Boolean batchUpdate(List<ShopInfoDO> list) {
if (CollectionUtils.isEmpty(list)){
return Boolean.FALSE;
}
return shopInfoMapper.batchUpdate(list);
}
public List<ShopInfoDO> selectInvestmentByLines(List<Long> lineIds) {
if (CollectionUtils.isEmpty(lineIds)) {
return new ArrayList<>();
}
return shopInfoMapper.selectInvestmentByList(lineIds);
}
}

View File

@@ -13,6 +13,7 @@ import com.cool.store.vo.shop.RentInfoToDoVO;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.google.common.collect.Lists;
import tk.mybatis.mapper.entity.Example;
import io.swagger.models.auth.In;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.annotations.Param;
@@ -41,10 +42,10 @@ public class ShopStageInfoDAO {
* 初始化店铺阶段信息
* @param lineId
* @param shopIds
* @return
* @return flag =true:表示意向加盟节点完成正常初始化。false:表示意向加盟节点未完成新建分店阶段都为未开始-100。
*/
public Integer initShopStageInfo(Long lineId, List<Long> shopIds) {
if(CollectionUtils.isEmpty(shopIds)){
public Integer initShopStageInfo(Long lineId, List<Long> shopIds, Boolean flag) {
if (CollectionUtils.isEmpty(shopIds)) {
return CommonConstants.ZERO;
}
List<ShopStageInfoDO> addShopStageList = new ArrayList<>();
@@ -57,9 +58,12 @@ public class ShopStageInfoDAO {
ShopStageEnum shopStageEnum = shopSubStageEnum.getShopStageEnum();
shopStageInfo.setShopStage(shopStageEnum.getShopStage());
shopStageInfo.setShopSubStage(shopSubStageEnum.getShopSubStage());
ShopSubStageStatusEnum initStatus = shopSubStageEnum.getInitStatus();
ShopSubStageStatusEnum initStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00;
if (flag) {
initStatus = shopSubStageEnum.getInitStatus();
}
shopStageInfo.setShopSubStageStatus(initStatus.getShopSubStageStatus());
shopStageInfo.setRemark(shopSubStageEnum.getShopSubStageName() + CommonConstants.PATH_BAR +shopSubStageEnum.getInitStatus().getShopSubStageStatusName());
shopStageInfo.setRemark(shopSubStageEnum.getShopSubStageName() + CommonConstants.PATH_BAR + shopSubStageEnum.getInitStatus().getShopSubStageStatusName());
shopStageInfo.setIsTerminated(Boolean.FALSE);
shopStageInfo.setPlanCompleteTime(shopSubStageEnum.getPlanCompleteTime(selectStartDate));
addShopStageList.add(shopStageInfo);
@@ -69,22 +73,22 @@ public class ShopStageInfoDAO {
return shopStageInfoMapper.batchInsert(addShopStageList);
}
public Integer batchInsert( List<ShopStageInfoDO> addShopStageList){
if(CollectionUtils.isEmpty(addShopStageList)){
public Integer batchInsert(List<ShopStageInfoDO> addShopStageList) {
if (CollectionUtils.isEmpty(addShopStageList)) {
return 0;
}
return shopStageInfoMapper.batchInsert(addShopStageList);
}
public Integer insertSelective(ShopStageInfoDO shopStageInfoDO) {
if(Objects.isNull(shopStageInfoDO)){
if (Objects.isNull(shopStageInfoDO)) {
return 0;
}
return shopStageInfoMapper.insertSelective(shopStageInfoDO);
}
public Integer updateByPrimaryKeySelective(ShopStageInfoDO shopStageInfoDO) {
if(Objects.isNull(shopStageInfoDO)){
if (Objects.isNull(shopStageInfoDO)) {
return 0;
}
return shopStageInfoMapper.updateByPrimaryKeySelective(shopStageInfoDO);
@@ -92,7 +96,7 @@ public class ShopStageInfoDAO {
public Integer batchUpdate(List<ShopStageInfoDO> shopStageList) {
if(CollectionUtils.isEmpty(shopStageList)){
if (CollectionUtils.isEmpty(shopStageList)) {
return 0;
}
return shopStageInfoMapper.batchUpdate(shopStageList);
@@ -104,36 +108,38 @@ public class ShopStageInfoDAO {
* @return
*/
public List<ShopStageInfoDO> getShopStageInfo(Long shopId, Integer shopStage) {
if(Objects.isNull(shopId)){
if (Objects.isNull(shopId)) {
return Lists.newArrayList();
}
return shopStageInfoMapper.getShopStageInfo(shopId, shopStage);
}
public PreparationProcessVO getPreparationProcess(Long shopId) {
if(Objects.isNull(shopId)){
if (Objects.isNull(shopId)) {
return null;
}
return shopStageInfoMapper.getPreparationProcess(shopId);
}
public Integer getAllCompletionCount(Long shopId) {
if(Objects.isNull(shopId)){
if (Objects.isNull(shopId)) {
return 0;
}
return shopStageInfoMapper.getAllCompletionCount(shopId);
}
/**
* @Auther: wangshuo
* @Date: 2024/5/3
* @description:更新完成时间byshopId
*/
public Integer updateByShopId( ShopStageInfoDO shopStageInfoDO){
if (Objects.isNull(shopStageInfoDO)){
public Integer updateByShopId(ShopStageInfoDO shopStageInfoDO) {
if (Objects.isNull(shopStageInfoDO)) {
return CommonConstants.ZERO;
}
return shopStageInfoMapper.updateByShopId(shopStageInfoDO);
}
/**
* 获取子阶段信息
* @param shopId
@@ -141,17 +147,17 @@ public class ShopStageInfoDAO {
* @return
*/
public ShopStageInfoDO getShopSubStageInfo(Long shopId, ShopSubStageEnum shopSubStageEnum) {
if(Objects.isNull(shopId) || Objects.isNull(shopSubStageEnum)){
if (Objects.isNull(shopId) || Objects.isNull(shopSubStageEnum)) {
return null;
}
return shopStageInfoMapper.getShopSubStageInfo(shopId, shopSubStageEnum.getShopSubStage());
}
public Integer updateShopStageInfo(Long shopId, ShopSubStageStatusEnum shopStageInfo) {
if(Objects.isNull(shopId) || Objects.isNull(shopStageInfo)){
if (Objects.isNull(shopId) || Objects.isNull(shopStageInfo)) {
return CommonConstants.ZERO;
}
String remark = shopStageInfo.getShopSubStageName() + CommonConstants.PATH_BAR +shopStageInfo.getShopSubStageStatusName();
String remark = shopStageInfo.getShopSubStageName() + CommonConstants.PATH_BAR + shopStageInfo.getShopSubStageStatusName();
boolean isTerminated = shopStageInfo.isTerminated();
return shopStageInfoMapper.updateShopStageInfo(shopId, shopStageInfo.getShopSubStageEnum().getShopSubStage(), shopStageInfo.getShopSubStageStatus(), isTerminated, remark);
}
@@ -164,10 +170,35 @@ public class ShopStageInfoDAO {
* @return
*/
public Integer batchUpdateShopStageStatus(Long shopId, List<ShopSubStageStatusEnum> subStageStatusList) {
if(Objects.isNull(shopId) || CollectionUtils.isEmpty(subStageStatusList)){
if (Objects.isNull(shopId) || CollectionUtils.isEmpty(subStageStatusList)) {
return CommonConstants.ZERO;
}
List<ShopStageInfoDO> shopStageList = Lists.newArrayList();
extracted(subStageStatusList, shopId, shopStageList);
return shopStageInfoMapper.batchUpdateShopStageStatus(shopId, shopStageList);
}
/**
* 批量更新店铺状态
* @param shopIds
* @param subStageStatusList
* @return
*/
public Integer batchUpdateByShopIdsAndSubStageStatus(List<Long> shopIds, List<ShopSubStageStatusEnum> subStageStatusList) {
if (CollectionUtils.isEmpty(shopIds) || CollectionUtils.isEmpty(subStageStatusList)) {
return CommonConstants.ZERO;
}
List<ShopStageInfoDO> shopStageList = Lists.newArrayList();
for (Long shopId : shopIds) {
extracted(subStageStatusList, shopId, shopStageList);
}
return shopStageInfoMapper.batchUpdateByShopIdsAndSubStageStatus(shopIds, shopStageList);
}
private static void extracted(List<ShopSubStageStatusEnum> subStageStatusList, Long shopId, List<ShopStageInfoDO> shopStageList) {
for (ShopSubStageStatusEnum subStageStatus : subStageStatusList) {
String remark = subStageStatus.getShopSubStageName() + CommonConstants.PATH_BAR + subStageStatus.getShopSubStageStatusName();
ShopStageInfoDO shopStageInfo = new ShopStageInfoDO();
@@ -178,8 +209,6 @@ public class ShopStageInfoDAO {
shopStageInfo.setIsTerminated(subStageStatus.isTerminated());
shopStageList.add(shopStageInfo);
}
return shopStageInfoMapper.batchUpdateShopStageStatus(shopId, shopStageList);
}
/**
@@ -189,7 +218,7 @@ public class ShopStageInfoDAO {
* @return
*/
public Integer updateShopStageToNotStarted(Long shopId, ShopSubStageEnum shopSubStageEnum) {
if(Objects.isNull(shopId) || Objects.isNull(shopSubStageEnum)){
if (Objects.isNull(shopId) || Objects.isNull(shopSubStageEnum)) {
return CommonConstants.ZERO;
}
return shopStageInfoMapper.updateShopStageToNotStarted(shopId, shopSubStageEnum.getShopSubStage());
@@ -202,50 +231,57 @@ public class ShopStageInfoDAO {
* @return
*/
public Integer updateShopStageAndAuditInfo(Long shopId, ShopSubStageStatusEnum shopStageInfo, Long auditId) {
if(Objects.isNull(shopId) || Objects.isNull(shopStageInfo)){
if (Objects.isNull(shopId) || Objects.isNull(shopStageInfo)) {
return CommonConstants.ZERO;
}
String remark = shopStageInfo.getShopSubStageName() + CommonConstants.PATH_BAR +shopStageInfo.getShopSubStageStatusName();
String remark = shopStageInfo.getShopSubStageName() + CommonConstants.PATH_BAR + shopStageInfo.getShopSubStageStatusName();
boolean isTerminated = shopStageInfo.isTerminated();
return shopStageInfoMapper.updateShopStageAndAuditInfo(shopId, shopStageInfo.getShopSubStageEnum().getShopSubStage(), shopStageInfo.getShopSubStageStatus(), isTerminated, remark, auditId);
}
public Page<RentInfoToDoVO> getRentContractToDoPage(String userId, Integer pageNum, Integer pageSize){
public Page<RentInfoToDoVO> getRentContractToDoPage(String userId, Integer pageNum, Integer pageSize) {
PageHelper.startPage(pageNum, pageSize);
ShopSubStageStatusEnum shopSubStageStatus = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_21;
return shopStageInfoMapper.getRentContractToDoPage(userId, shopSubStageStatus.getShopSubStageEnum().getShopSubStage(), shopSubStageStatus.getShopSubStageStatus());
}
public List<ShopStageInfoDO> getShopIdListByStageStatus(Integer shopSubStageStatus){
if (shopSubStageStatus == null ||shopSubStageStatus ==CommonConstants.ZERO){
public List<ShopStageInfoDO> getShopIdListByStageStatus(Integer shopSubStageStatus) {
if (shopSubStageStatus == null || shopSubStageStatus == CommonConstants.ZERO) {
return null;
}
return shopStageInfoMapper.getShopIdListByStageStatus(shopSubStageStatus);
return shopStageInfoMapper.getShopIdListByStageStatus(shopSubStageStatus);
}
public List<ScheduleDTO> getScheduleList(List<Long> shopIdList){
if (CollectionUtils.isEmpty(shopIdList)){
return Collections.emptyList();
public List<ScheduleDTO> getScheduleList(List<Long> shopIdList) {
if (CollectionUtils.isEmpty(shopIdList)) {
return new ArrayList<>();
}
return shopStageInfoMapper.getScheduleList(shopIdList);
}
public List<ScheduleDTO> getPlatformBuildList(List<Long> shopIdList){
if (CollectionUtils.isEmpty(shopIdList)){
public ScheduleDTO getScheduleAll(Long shopId) {
if (Objects.isNull(shopId)) {
return null;
}
return shopStageInfoMapper.getScheduleAll(shopId);
}
public List<ScheduleDTO> getPlatformBuildList(List<Long> shopIdList) {
if (CollectionUtils.isEmpty(shopIdList)) {
return Collections.emptyList();
}
return shopStageInfoMapper.getPlatformBuildList(shopIdList);
}
public List<ShopStageInfoDO> getShopContractActualCompletionTime(List<Long> shopIdList){
if (CollectionUtils.isEmpty(shopIdList)){
public List<ShopStageInfoDO> getShopContractActualCompletionTime(List<Long> shopIdList) {
if (CollectionUtils.isEmpty(shopIdList)) {
return Collections.emptyList();
}
return shopStageInfoMapper.getShopContractActualCompletionTime(shopIdList);
}
public List<ShopStageInfoDO> getOpenActivityActualCompletionTime(List<Long> shopIdList){
if (CollectionUtils.isEmpty(shopIdList)){
return Collections.emptyList();
public List<ShopStageInfoDO> getOpenActivityActualCompletionTime(List<Long> shopIdList) {
if (CollectionUtils.isEmpty(shopIdList)) {
return new ArrayList<>();
}
return shopStageInfoMapper.getOpenActivityActualCompletionTime(shopIdList);
}
@@ -256,53 +292,57 @@ public class ShopStageInfoDAO {
* @return
*/
public List<Long> getCanSubmitRentContractShopIds(List<Long> shopIds) {
if(CollectionUtils.isEmpty(shopIds)){
if (CollectionUtils.isEmpty(shopIds)) {
return Lists.newArrayList();
}
return shopStageInfoMapper.getCanSubmitRentContractShopIds(shopIds);
}
/**
* @Auther: wangshuo
* @Date: 2024/5/5
* @description:获取施工阶段未完成的店铺
*/
public List<Long> getShopContractIncompletion(){
public List<Long> getShopContractIncompletion() {
return shopStageInfoMapper.getShopContractIncompletion();
}
/**
* @Auther: wangshuo
* @Date: 2024/5/13
* @description:批量更新店铺某一阶段的状态
*/
public Integer batchUpdateShopStageStatus(List<Long> shopIdList,Integer shopSubStageEnum, Integer shopSubStageStatusEnum) {
if (CollectionUtils.isEmpty(shopIdList)){
public Integer batchUpdateShopStageStatus(List<Long> shopIdList, Integer shopSubStageEnum, Integer shopSubStageStatusEnum) {
if (CollectionUtils.isEmpty(shopIdList)) {
return CommonConstants.ZERO;
}
return shopStageInfoMapper.batchUpdateStatus(shopIdList,shopSubStageEnum,shopSubStageStatusEnum);
return shopStageInfoMapper.batchUpdateStatus(shopIdList, shopSubStageEnum, shopSubStageStatusEnum);
}
public List<ShopStageInfoDO> getSpecialShopStageInfo(List<Long> shopIds, Integer shopSubStage,
List<Integer> shopSubStageStatusList,
String investmentUserId,
List<String> authRegionIds){
return shopStageInfoMapper.getSpecialShopStageInfo( shopIds, shopSubStage, shopSubStageStatusList,investmentUserId,authRegionIds);
List<String> authRegionIds) {
return shopStageInfoMapper.getSpecialShopStageInfo(shopIds, shopSubStage, shopSubStageStatusList, investmentUserId, authRegionIds);
}
/**
* @Auther: wangshuo
* @Date: 2024/5/9
* @description:获取处于XXXX阶段的列表
*/
public List<ShopStageInfoDO> getSubStageList(List<Long> shopIds, Integer shopSubStage){
if(CollectionUtils.isEmpty(shopIds) || shopSubStage == null){
public List<ShopStageInfoDO> getSubStageList(List<Long> shopIds, Integer shopSubStage) {
if (CollectionUtils.isEmpty(shopIds) || shopSubStage == null) {
return Collections.emptyList();
}
return shopStageInfoMapper.getSubStageList(shopIds,shopSubStage);
return shopStageInfoMapper.getSubStageList(shopIds, shopSubStage);
}
public List<ShopStageInfoDO> getSubStages(List<Long> shopIds, Integer shopSubStage){
if(CollectionUtils.isEmpty(shopIds) ){
public List<ShopStageInfoDO> getSubStages(List<Long> shopIds, Integer shopSubStage) {
if (CollectionUtils.isEmpty(shopIds)) {
return Collections.emptyList();
}
return shopStageInfoMapper.getSubStages(shopIds,shopSubStage);
return shopStageInfoMapper.getSubStages(shopIds, shopSubStage);
}
/**
@@ -310,28 +350,30 @@ public class ShopStageInfoDAO {
* @param lineId
* @return
*/
public Integer getNotOpenShopCountByLineId(Long lineId){
if(Objects.isNull(lineId)){
public Integer getNotOpenShopCountByLineId(Long lineId) {
if (Objects.isNull(lineId)) {
return CommonConstants.ZERO;
}
ShopSubStageEnum shopSubStageEnum = ShopSubStageEnum.SHOP_STAGE_16;
return shopStageInfoMapper.getShopCountByLineIdAndStageStatus(lineId, shopSubStageEnum.getShopStageEnum().getShopStage(), shopSubStageEnum.getShopSubStage(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatus());
}
/**
* @Auther: wangshuo
* @Date: 2024/5/11
* @description:获取处于a阶段或b阶段和c阶段的
*/
public List<ShopStageInfoDO> getSubStageListBySubStageStatus(ShopSubStageStatusEnum a,ShopSubStageStatusEnum b, ShopSubStageStatusEnum c){
public List<ShopStageInfoDO> getSubStageListBySubStageStatus(ShopSubStageStatusEnum a, ShopSubStageStatusEnum b, ShopSubStageStatusEnum c) {
return shopStageInfoMapper.getSubStageListBySubStageStatus(a.getShopSubStageStatus(),b.getShopSubStageStatus(),c.getShopSubStageStatus());
return shopStageInfoMapper.getSubStageListBySubStageStatus(a.getShopSubStageStatus(), b.getShopSubStageStatus(), c.getShopSubStageStatus());
}
public ShopStageInfoDO getByShopIdAndSubStage(Long shopId, Integer shopSubStage) {
return shopStageInfoMapper.getByShopIdAndSubStage(shopId,shopSubStage);
return shopStageInfoMapper.getByShopIdAndSubStage(shopId, shopSubStage);
}
public List<PlatformBuildStageDTO> getPlatformBuildStage(List<Long> shopIds) {
if (CollectionUtils.isEmpty(shopIds)){
if (CollectionUtils.isEmpty(shopIds)) {
return new ArrayList<>();
}
return shopStageInfoMapper.getPlatformBuildStage(shopIds);
@@ -342,8 +384,32 @@ public class ShopStageInfoDAO {
* @param shopSubStage
* @return
*/
public List<ShopStageInfoDO> getSubStages(Integer shopSubStage){
return shopStageInfoMapper.getSubStageList(null,shopSubStage);
public List<ShopStageInfoDO> getSubStages(Integer shopSubStage) {
return shopStageInfoMapper.getSubStageList(null, shopSubStage);
}
//获取新店筹备总阶段总数排除发票回传,flag=0查询全部 =1 查询已完成
public Integer allNumber(Long shopId, Integer flag) {
return shopStageInfoMapper.getAllNumber(shopId, flag);
}
/**
* @Auther: wangshuo
* @Date: 2025/1/15
* @description:批量获取线索下门店的选址未开始的数据
*/
public List<ShopStageInfoDO> getByLineIdAndSubStage(Long lineId) {
if (lineId == null) {
return new ArrayList<>();
}
Example example = new Example(ShopStageInfoDO.class);
example.createCriteria().andEqualTo("lineId", lineId).andEqualTo("shopSubStage", ShopSubStageEnum.SHOP_STAGE_1.getShopSubStage())
.andEqualTo("shopSubStageStatus", ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_00.getShopSubStageStatus());
List<ShopStageInfoDO> shopStageInfos = shopStageInfoMapper.selectByExample(example);
if (CollectionUtils.isEmpty(shopStageInfos)){
return new ArrayList<>();
}
return shopStageInfos;
}
}

View File

@@ -24,11 +24,11 @@ public class TransferLogDAO {
}
public List<TransferLogDTO> getTransferLogList(Long lindId){
public List<TransferLogDTO> getTransferLogList(Long lindId,Integer lineShopType){
if (lindId == null){
return null;
}
return transferLogMapper.getTransferLogList(lindId);
return transferLogMapper.getTransferLogList(lindId,lineShopType);
}

View File

@@ -1,10 +1,17 @@
package com.cool.store.mapper;
import com.cool.store.dto.FranchiseFeeDTO;
import com.cool.store.entity.FranchiseFeeDO;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.Date;
import java.util.List;
import java.util.Map;
public interface FranchiseFeeMapper extends Mapper<FranchiseFeeDO> {
FranchiseFeeDO selectByShopId(@Param("shopId") Long shopId);
List<FranchiseFeeDTO> getPayTimeByShopIds(@Param("shopIds") List<Long> shopIds);
}

View File

@@ -61,6 +61,8 @@ public interface HyOpenAreaInfoMapper {
*/
List<HyOpenAreaInfoDO> getChildrenList(@Param("parentId") Long parentId);
List<Long> getChildrenListByParentIds(@Param("parentIds") List<Long> parentIds);
Integer getChildrenCount(@Param("type") String type ,
@Param("parentId") Long parentId);

View File

@@ -12,5 +12,5 @@ public interface LineFollowLogMapper extends Mapper<LineFollowLogDO> {
* @param lineId
* @return
*/
Page<LineFollowLogDO> getFollowLogPage(@Param("lineId")Long lineId);
Page<LineFollowLogDO> getFollowLogPage(@Param("lineId")Long lineId,@Param("type")Integer type);
}

View File

@@ -4,10 +4,12 @@ import com.cool.store.dto.InvestmentCountDTO;
import com.cool.store.dto.PendingCountDTO;
import com.cool.store.dto.openPreparation.PlanLineDTO;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.entity.ShopInfoDO;
import com.cool.store.request.LineListRequest;
import com.cool.store.request.PartnerRequest;
import com.cool.store.request.PointLinePageRequest;
import com.cool.store.request.PublicLineListRequest;
import com.cool.store.vo.LineVO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
@@ -125,4 +127,7 @@ public interface LineInfoMapper extends Mapper<LineInfoDO> {
Integer batchUpdateInvestmentManager(@Param("lineIds") List<Long> lineIds,
@Param("status") Integer status,
@Param("investmentManager") String investmentManager, @Param("regionId") Long regionId);
List<LineVO> getLinesByKeyword(@Param("keyword") String keyword);
}

View File

@@ -53,11 +53,11 @@ public interface PointInfoMapper extends Mapper<PointInfoDO> {
/**
* 更新铺位的拓展经理
* @param lineId
* @param shopId
* @param developmentManager
* @return
*/
Integer updateSelectedDevelopmentManager(@Param("lineId") Long lineId, @Param("developmentManager")String developmentManager);
Integer updateSelectedDevelopmentManager(@Param("shopId") Long shopId, @Param("developmentManager")String developmentManager);
/**
* 获取团队铺位

View File

@@ -2,6 +2,7 @@ package com.cool.store.mapper;
import com.cool.store.dto.point.LineCountDTO;
import com.cool.store.dto.point.MiniPointPageDTO;
import com.cool.store.dto.point.ShopCountDTO;
import com.cool.store.entity.PointRecommendDO;
import com.cool.store.request.MiniPointPageRequest;
import com.github.pagehelper.Page;
@@ -36,6 +37,13 @@ public interface PointRecommendMapper extends Mapper<PointRecommendDO> {
*/
List<LineCountDTO> getPushShopNumMap(@Param("lineIds") List<Long> lineIds);
/**
* 查询门店推送的铺位数量
* @param shopIds
* @return
*/
List<ShopCountDTO> getShopPushPointNumMap(@Param("shopIds") List<Long> shopIds);
/**
* 获取推荐列表
* @param lineId
@@ -43,6 +51,13 @@ public interface PointRecommendMapper extends Mapper<PointRecommendDO> {
*/
List<PointRecommendDO> getRecommendPointList(@Param("lineId") Long lineId);
/**
* 获取门店推荐列表
* @param shopId
* @return
*/
List<PointRecommendDO> getShopRecommendPointList(@Param("shopId") Long shopId);
/**
* 批量新增
* @param recommendList
@@ -55,7 +70,7 @@ public interface PointRecommendMapper extends Mapper<PointRecommendDO> {
* @param lineId
* @return
*/
Integer turnLineUpdateRecommendStatus(@Param("lineId") Long lineId, @Param("developmentManager")String developmentManager);
Integer turnLineUpdateRecommendStatus(@Param("shopId") Long shopId, @Param("developmentManager")String developmentManager);
/**
* 线索获取推荐铺位列表
@@ -70,7 +85,7 @@ public interface PointRecommendMapper extends Mapper<PointRecommendDO> {
* @param lineId
* @return
*/
Integer updateStatusByPointIdAndLineId(@Param("pointId") Long pointId, @Param("lineId") Long lineId);
Integer updateStatusByPointIdAndLineId(@Param("pointId") Long pointId, @Param("shopId") Long shopId);
/**
* 铺位拒绝
@@ -79,7 +94,7 @@ public interface PointRecommendMapper extends Mapper<PointRecommendDO> {
* @param reason
* @return
*/
Integer rejectPoint(@Param("lineId") Long lineId, @Param("pointId") Long pointId, @Param("reason") String reason);
Integer rejectPoint(@Param("shopId") Long shopId, @Param("pointId") Long pointId, @Param("reason") String reason);
/**
* 获取铺位推送过哪些线索
@@ -87,4 +102,14 @@ public interface PointRecommendMapper extends Mapper<PointRecommendDO> {
* @return
*/
List<PointRecommendDO> getRecommendPointListByPointId(@Param("pointId") Long pointId);
/**
* 数据处理
* @param lineId
* @return
*/
List<PointRecommendDO> getAllRecommendPointList(@Param("lineId") Long lineId);
Boolean batchUpdateShopId(@Param("recommendList") List<PointRecommendDO> recommendList);
}

View File

@@ -4,9 +4,12 @@ import com.cool.store.dto.LicenseSyncDTO;
import com.cool.store.dto.Preparation.PreparationDTO;
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
import com.cool.store.dto.point.LineCountDTO;
import com.cool.store.dto.point.ShopPointDTO;
import com.cool.store.entity.PointInfoDO;
import com.cool.store.entity.ShopInfoDO;
import com.cool.store.request.BranchShopRequest;
import com.cool.store.request.PlanListRequest;
import com.cool.store.request.PointLinePageRequest;
import com.cool.store.request.PreparationRequest;
import com.cool.store.request.platformBuildListRequest;
import com.cool.store.response.PlatformBuildListResponse;
@@ -36,6 +39,8 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
*/
List<ShopInfoDO> getShopList(@Param("lineId") Long lineId);
List<ShopInfoDO> getShopListByRegion(@Param("lineId") Long lineId,@Param("list") List<Long> regions,@Param("userId") String userId);
/**
* 店铺信息
*
@@ -81,6 +86,8 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
List<PreparationDTO> ListByCondition(@Param("request") PreparationRequest request);
List<PreparationDTO> ListByBranchShopRequest(@Param("request") BranchShopRequest request,@Param("userId") String userId);
Long getRegionIdByid(@Param("shopId") Long shopId);
ShopInfoDO selectByStoreNum(@Param("storeNum") String storeNum);
@@ -98,4 +105,18 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
List<LicenseSyncDTO> getShopAndStoreList(@Param("enterpriseId") String eid , @Param("shopIds") List<Long> shopIds);
List<ShopPointDTO> getShopPointListByDevelopmentManager(@Param("request") PointLinePageRequest request);
/**
* selectAllDataOrByShopId
* @param shopId
* @return
*/
List<ShopInfoDO> selectAllDataOrByLineId(@Param("lineId") Long lineId);
Boolean batchUpdate(List<ShopInfoDO> list);
List<ShopInfoDO> selectInvestmentByList (@Param("list") List<Long> list);
}

View File

@@ -65,6 +65,7 @@ public interface ShopStageInfoMapper extends Mapper<ShopStageInfoDO> {
* @return
*/
Integer batchUpdateShopStageStatus(@Param("shopId") Long shopId, @Param("updateList") List<ShopStageInfoDO> updateList);
Integer batchUpdateByShopIdsAndSubStageStatus(@Param("shopIds") List<Long> shopIds, @Param("updateList") List<ShopStageInfoDO> updateList);
/**
* 更新阶段及审核信息
@@ -110,6 +111,9 @@ public interface ShopStageInfoMapper extends Mapper<ShopStageInfoDO> {
List<ShopStageInfoDO> getShopIdListByStageStatus(@Param("shopSubStageStatus") Integer shopSubStageStatus);
List<ScheduleDTO> getScheduleList(@Param("shopIds") List<Long> shopIds);
ScheduleDTO getScheduleAll(@Param("shopId") Long shopId);
List<ScheduleDTO> getPlatformBuildList(@Param("shopIds") List<Long> shopIds);
List<ShopStageInfoDO> getShopContractActualCompletionTime(@Param("shopIds") List<Long> shopIds);
@@ -160,4 +164,6 @@ public interface ShopStageInfoMapper extends Mapper<ShopStageInfoDO> {
@Param("shopSubStage") Integer shopSubStage);
List<PlatformBuildStageDTO> getPlatformBuildStage( @Param("shopIds") List<Long> shopIds);
Integer getAllNumber(@Param("shopId") Long shopId,@Param("flag")Integer flag);
}

View File

@@ -4,10 +4,14 @@ import com.cool.store.entity.SignFranchiseDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
public interface SignFranchiseMapper extends Mapper<SignFranchiseDO> {
SignFranchiseDO selectByShopId(@Param("shopId") Long shopId);
void updateAuditByShopId(@Param("auditId") Long auditId,
@Param("shopId") Long shopId);
List<SignFranchiseDO> selectByShopIds( @Param("list")List<Long> shopIds);
}

View File

@@ -14,7 +14,7 @@ public interface TransferLogMapper extends Mapper<TransferLogDO> {
* @param lindId
* @return
*/
List<TransferLogDTO> getTransferLogList(@Param("lindId") Long lindId);
List<TransferLogDTO> getTransferLogList(@Param("lindId") Long lindId,@Param("lineShopType")Integer lineShopType);
}

View File

@@ -9,4 +9,21 @@
order by create_time desc
limit 1
</select>
<select id="getPayTimeByShopIds" resultType="com.cool.store.dto.FranchiseFeeDTO">
select a.shop_id AS shopId ,
b.pay_time as payTime,
a.year_franchise_fee as yearFranchiseFee,
a.loan_margin as loanMargin,
a.first_year_start_time as firstYearStartTime,
a.first_year_end_time as firstYearEndTime,
a.first_year_fee as firstYearFee,
a.performance_bond as performanceBond
from xfsg_franchise_fee a
LEFT JOIN xfsg_line_pay b ON b.id = a.pay_id
where a.shop_id in
<foreach collection="shopIds" item="shopId" open="(" separator="," close=")">
#{shopId}
</foreach>
</select>
</mapper>

View File

@@ -2,28 +2,29 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.HyOpenAreaInfoMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.HyOpenAreaInfoDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="parent_id" jdbcType="BIGINT" property="parentId" />
<result column="area_name" jdbcType="VARCHAR" property="areaName" />
<result column="area_path" jdbcType="VARCHAR" property="areaPath" />
<result column="background_banner" jdbcType="VARCHAR" property="backgroundBanner" />
<result column="detail_banner" jdbcType="VARCHAR" property="detailBanner" />
<result column="area_status" jdbcType="VARCHAR" property="areaStatus" />
<result column="deleted" jdbcType="TINYINT" property="deleted" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="parent_id" jdbcType="BIGINT" property="parentId"/>
<result column="area_name" jdbcType="VARCHAR" property="areaName"/>
<result column="area_path" jdbcType="VARCHAR" property="areaPath"/>
<result column="background_banner" jdbcType="VARCHAR" property="backgroundBanner"/>
<result column="detail_banner" jdbcType="VARCHAR" property="detailBanner"/>
<result column="area_status" jdbcType="VARCHAR" property="areaStatus"/>
<result column="deleted" jdbcType="TINYINT" property="deleted"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId"/>
</resultMap>
<sql id="Base_Column_List">
id, parent_id, area_name, area_path, background_banner, detail_banner, area_status,
deleted, create_time, update_time, update_user_id
</sql>
<select id="selectById" resultMap="BaseResultMap">
<select id="selectById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"></include>
from xfsg_open_area_info where id = #{id}
</select>
<insert id="insertSelective" parameterType="com.cool.store.entity.HyOpenAreaInfoDO" keyProperty="record.id" useGeneratedKeys="true">
<insert id="insertSelective" parameterType="com.cool.store.entity.HyOpenAreaInfoDO" keyProperty="record.id"
useGeneratedKeys="true">
insert into xfsg_open_area_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.id != null">
@@ -137,7 +138,6 @@
</update>
<update id="batchUpdateById">
update xfsg_open_area_info
<set>
@@ -164,7 +164,6 @@
</update>
<update id="batchUpdateByParentId">
update xfsg_open_area_info
<set>
@@ -207,7 +206,7 @@
xfsg_open_area_info
<where>
<if test="keyword!=null and keyword!=''">
and area_path like concat('%',#{keyword},'%')
and area_path like concat('%',#{keyword},'%')
</if>
<if test="applyFlag!=null and applyFlag==true">
and (area_status = 'open' or area_status = 'keyOpen')
@@ -239,7 +238,6 @@
</select>
<select id="getChildrenList" resultMap="BaseResultMap">
select * from
xfsg_open_area_info
@@ -280,7 +278,9 @@
</select>
<select id="getAllOpenArea" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/> from xfsg_open_area_info
select
<include refid="Base_Column_List"/>
from xfsg_open_area_info
</select>
<select id="filterLeafNode" resultType="long">
@@ -289,7 +289,8 @@
from
xfsg_open_area_info
where
deleted = '0' and province_city_flag = '0' and id in <foreach collection="openAreaIds" item="openAreaId" separator="," open="(" close=")">#{openAreaId}</foreach>
deleted = '0' and province_city_flag = '0' and id in
<foreach collection="openAreaIds" item="openAreaId" separator="," open="(" close=")">#{openAreaId}</foreach>
</select>
<select id="getSonArea" resultType="com.cool.store.entity.HyOpenAreaInfoDO">
SELECT
@@ -297,15 +298,15 @@
FROM xfsg_open_area_info
WHERE parent_id = #{id}
</select>
<select id="getProvinceAllCode" resultMap="BaseResultMap">
SELECT b.* FROM `xfsg_open_area_info` a inner join xfsg_open_area_info b on a.`id`=b.`parent_id`
WHERE a.parent_id=#{id} ORDER BY b.id desc
<select id="getProvinceAllCode" resultMap="BaseResultMap">
SELECT b.* FROM `xfsg_open_area_info` a inner join xfsg_open_area_info b on a.`id`=b.`parent_id`
WHERE a.parent_id=#{id} ORDER BY b.id desc
</select>
<select id="selectByAreaPath" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"></include>
FROM `xfsg_open_area_info`
WHERE area_path= concat('/',#{areaPath},'/') and deleted=0 and province_city_flag=0
WHERE area_path= concat('/',#{areaPath},'/') and deleted=0 and province_city_flag=0
</select>
<select id="selectAllCity" resultMap="BaseResultMap">
@@ -314,7 +315,15 @@
FROM `xfsg_open_area_info`
WHERE deleted=0 and province_city_flag = 1 and parent_id is not null
</select>
<select id="getChildrenListByParentIds" resultType="java.lang.Long">
select id from xfsg_open_area_info where 1=1
<if test="parentIds!=null and parentIds.size>0">
and parent_id in
<foreach collection="parentIds" item="parentId" separator="," open="(" close=")">
#{parentId}
</foreach>
</if>
</select>
</mapper>

View File

@@ -14,14 +14,15 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="deleted" jdbcType="BIT" property="deleted" />
<result column="type" jdbcType="TINYINT" property="type"/>
</resultMap>
<select id="getFollowLogPage" resultMap="BaseResultMap">
select
id, partner_id, line_id, operate_user_id, operate_username, workflow_stage, workflow_sub_stage, workflow_sub_stage_status, message, create_time
id, partner_id, line_id, operate_user_id, operate_username, workflow_stage, workflow_sub_stage, workflow_sub_stage_status, message, create_time,type
from
xfsg_line_follow_log
where
line_id = #{lineId} and deleted = '0' order by create_time desc
line_id = #{lineId} and deleted = '0' and type = #{type} order by create_time desc
</select>
</mapper>

View File

@@ -588,6 +588,19 @@
#{lineId}
</foreach>
</select>
<select id="getLinesByKeyword" resultType="com.cool.store.vo.LineVO">
select
id as lineId,
username,
mobile
from xfsg_line_info
where workflow_sub_stage > 1
<if test="keyword !=null and keyword != ''">
and (mobile like CONCAT('%', #{keyword} ,'%')
or username like CONCAT('%', #{keyword} ,'%'))
</if>
order by id desc
</select>
<update id="batchUpdateInvestmentManager">

View File

@@ -139,7 +139,7 @@
set
development_manager = #{developmentManager}
where
line_id = #{lineId} and select_status = '1' and deleted = 0
shop_id = #{shopId} and select_status = '1' and deleted = 0
</update>
<select id="getTeamPointPage" resultMap="BaseResultMap">

View File

@@ -4,6 +4,7 @@
<resultMap id="BaseResultMap" type="com.cool.store.entity.PointRecommendDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="line_id" jdbcType="BIGINT" property="lineId" />
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
<result column="point_id" jdbcType="BIGINT" property="pointId" />
<result column="development_manager" jdbcType="VARCHAR" property="developmentManager" />
<result column="status" jdbcType="TINYINT" property="status" />
@@ -14,7 +15,7 @@
</resultMap>
<sql id="allColumn">
id, line_id, point_id, development_manager, status, reason, deleted, create_time, update_time
id, line_id,shop_id, point_id, development_manager, status, reason, deleted, create_time, update_time
</sql>
<update id="updateShopPointRecommendStatus">
@@ -48,6 +49,20 @@
group by line_id
</select>
<select id="getShopPushPointNumMap" resultType="com.cool.store.dto.point.ShopCountDTO">
select
shop_id as shopId,
count(1) as recommendShopNum
from
xfsg_point_recommend
where
deleted = 0 and shop_id in
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
#{shopId}
</foreach>
group by shop_id
</select>
<select id="getRecommendPointList" resultMap="BaseResultMap">
select
id,
@@ -62,10 +77,25 @@
line_id = #{lineId} and deleted = 0
</select>
<select id="getShopRecommendPointList" resultMap="BaseResultMap">
select
id,
point_id,
line_id,
development_manager,
status,
reason
from
xfsg_point_recommend
where
shop_id = #{shopId} and deleted = 0
</select>
<insert id="batchInsert">
<foreach collection="recommendList" item="item" index="index" separator=";">
insert into xfsg_point_recommend (line_id, point_id, development_manager, status)
values (#{item.lineId}, #{item.pointId}, #{item.developmentManager}, #{item.status})
insert into xfsg_point_recommend (shop_id, point_id, development_manager, status)
values (#{item.shopId}, #{item.pointId}, #{item.developmentManager}, #{item.status})
</foreach>
</insert>
@@ -76,7 +106,7 @@
deleted = if(status = 1, 1, deleted),
development_manager = if(status in (2,4), #{developmentManager}, development_manager)
where
line_id = #{lineId}
shop_id = #{shopId}
</update>
<select id="getLineRecommendPointPage" resultType="com.cool.store.dto.point.MiniPointPageDTO">
@@ -96,12 +126,12 @@
xfsg_point_recommend pr
inner join xfsg_point_info p on p.id = pr.point_id
where
p.deleted = 0 and pr.line_id = #{request.lineId} and pr.deleted = 0
p.deleted = 0 and pr.shop_id = #{request.shopId} and pr.deleted = 0
<if test="request.status != null and request.status == 1">
and pr.status = 1 and p.select_status = 0
</if>
<if test="request.status != null and request.status == 2">
and pr.status = 2 and p.select_status = 1 and p.line_id = #{request.lineId}
and pr.status = 2 and p.select_status = 1 and p.shop_id = #{request.shopId}
</if>
<if test="request.status != null and request.status == 3">
and pr.status in (5, 6)
@@ -112,7 +142,7 @@
update
xfsg_point_recommend
set
status = if(line_id = #{lineId}, 2, 3)
status = if(shop_id = #{shopId}, 2, 3)
where point_id = #{pointId} and deleted = 0 and status = 1
</update>
@@ -122,7 +152,7 @@
set
status = 5,
reason = #{reason}
where point_id = #{pointId} and line_id = #{lineId} and deleted = 0 and status = 1
where point_id = #{pointId} and shop_id = #{shopId} and deleted = 0 and status = 1
</update>
<select id="getRecommendPointListByPointId" resultMap="BaseResultMap">
@@ -133,4 +163,34 @@
where
point_id = #{pointId} and deleted = 0
</select>
<select id="getAllRecommendPointList" resultMap="BaseResultMap">
select
<include refid="allColumn"/>
from
xfsg_point_recommend
<where>
and (shop_id = 0 or shop_id is null)
<if test="lineId!=null">
and line_id = #{lineId}
</if>
</where>
</select>
<update id="batchUpdateShopId">
update xfsg_point_recommend
set
shop_id = case id
<foreach collection="recommendList" item="item" index="index" >
when #{item.id} then #{item.shopId}
</foreach>
end
where
id in
<foreach collection="recommendList" item="entity" open="(" separator="," close=")">
#{entity.id}
</foreach>
</update>
</mapper>

View File

@@ -1,183 +1,206 @@
<?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.ShopInfoMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.ShopInfoDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="region_id" jdbcType="BIGINT" property="regionId" />
<result column="line_id" jdbcType="BIGINT" property="lineId" />
<result column="partner_id" jdbcType="VARCHAR" property="partnerId" />
<result column="point_id" jdbcType="BIGINT" property="pointId" />
<result column="shop_name" jdbcType="VARCHAR" property="shopName" />
<result column="shop_code" jdbcType="VARCHAR" property="shopCode" />
<result column="store_num" jdbcType="VARCHAR" property="storeNum" />
<result column="shop_manager_user_id" jdbcType="VARCHAR" property="shopManagerUserId" />
<result column="supervisor_user_id" jdbcType="VARCHAR" property="supervisorUserId" />
<result column="plan_open_time" jdbcType="TIMESTAMP" property="planOpenTime" />
<result column="cur_progress" jdbcType="DECIMAL" property="curProgress" />
<result column="shop_type" jdbcType="TINYINT" property="shopType" />
<result column="shop_stage" jdbcType="TINYINT" property="shopStage" />
<result column="deleted" jdbcType="BIT" property="deleted" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<resultMap id="BaseResultMap" type="com.cool.store.entity.ShopInfoDO">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="region_id" jdbcType="BIGINT" property="regionId"/>
<result column="line_id" jdbcType="BIGINT" property="lineId"/>
<result column="partner_id" jdbcType="VARCHAR" property="partnerId"/>
<result column="point_id" jdbcType="BIGINT" property="pointId"/>
<result column="shop_name" jdbcType="VARCHAR" property="shopName"/>
<result column="shop_code" jdbcType="VARCHAR" property="shopCode"/>
<result column="store_num" jdbcType="VARCHAR" property="storeNum"/>
<result column="shop_manager_user_id" jdbcType="VARCHAR" property="shopManagerUserId"/>
<result column="supervisor_user_id" jdbcType="VARCHAR" property="supervisorUserId"/>
<result column="plan_open_time" jdbcType="TIMESTAMP" property="planOpenTime"/>
<result column="cur_progress" jdbcType="DECIMAL" property="curProgress"/>
<result column="shop_type" jdbcType="TINYINT" property="shopType"/>
<result column="shop_stage" jdbcType="TINYINT" property="shopStage"/>
<result column="deleted" jdbcType="BIT" property="deleted"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="join_mode" jdbcType="TINYINT" property="joinMode"/>
<result column="detail_address" jdbcType="VARCHAR" property="detailAddress"/>
<result column="franchise_brand" jdbcType="VARCHAR" property="franchiseBrand"/>
<result column="development_manager" jdbcType="VARCHAR" property="developmentManager"/>
<result column="want_shop_area_id" jdbcType="BIGINT" property="wantShopAreaId"/>
<result column="investment_manager" jdbcType="VARCHAR" property="investmentManager"/>
<result column="shop_status" jdbcType="TINYINT" property="shopStatus"/>
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId"/>
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId"/>
</resultMap>
<sql id="allColumn">
id, region_id, line_id, partner_id, point_id, shop_name, shop_code, store_num, shop_manager_user_id, supervisor_user_id, plan_open_time, cur_progress, shop_type, shop_stage, deleted, create_time, update_time
</sql>
<sql id="allColumn">
id
, region_id, line_id, partner_id, point_id, shop_name,
shop_code, store_num, shop_manager_user_id, supervisor_user_id,
plan_open_time, cur_progress, shop_type, shop_stage, deleted, create_time, update_time,
join_mode,detail_address,franchise_brand,development_manager,want_shop_area_id,investment_manager,shop_status,create_user_id,update_user_id
</sql>
<insert id="batchAddShop" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
insert into xfsg_shop_info(region_id, line_id, partner_id, shop_name, store_num,supervisor_user_id) values
<foreach collection="shopInfoList" item="shop" separator=",">
(#{shop.regionId}, #{shop.lineId}, #{shop.partnerId}, #{shop.shopName}, #{shop.storeNum},#{shop.supervisorUserId})
</foreach>
</insert>
<insert id="batchAddShop" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
insert into xfsg_shop_info(region_id, line_id, partner_id, shop_name, store_num,supervisor_user_id,create_time,join_mode,franchise_brand,
development_manager,want_shop_area_id,investment_manager) values
<foreach collection="shopInfoList" item="shop" separator=",">
(#{shop.regionId}, #{shop.lineId}, #{shop.partnerId}, #{shop.shopName},
#{shop.storeNum},#{shop.supervisorUserId},#{shop.createTime},#{shop.joinMode},#{shop.franchiseBrand},#{shop.developmentManager},
#{shop.wantShopAreaId},#{shop.investmentManager})
</foreach>
</insert>
<select id="getShopList" resultMap="BaseResultMap">
select <include refid="allColumn"/> from xfsg_shop_info where line_id = #{lineId} and deleted= '0'
</select>
<select id="getShopList" resultMap="BaseResultMap">
select
<include refid="allColumn"/>
from xfsg_shop_info where line_id = #{lineId} and deleted= '0'
</select>
<select id="getShopInfoByPointId" resultMap="BaseResultMap">
select <include refid="allColumn"/> from xfsg_shop_info where point_id = #{pointId} and deleted= '0'
</select>
<select id="getShopInfoByPointId" resultMap="BaseResultMap">
select
<include refid="allColumn"/>
from xfsg_shop_info where point_id = #{pointId} and deleted= '0'
</select>
<select id="getStageShopCount" resultType="com.cool.store.vo.shop.StageShopCountVO">
select
sum(if(shop_stage = 1, 1, 0)) as selectPointCount,
sum(if(shop_stage = 2, 1, 0)) as buildShopCount,
sum(if(shop_stage = 3, 1, 0)) as openShopCount
from
xfsg_shop_info
where
deleted = '0' and line_id = #{lineId}
</select>
<select id="getStageShopCount" resultType="com.cool.store.vo.shop.StageShopCountVO">
select sum(if(shop_stage = 1, 1, 0)) as selectPointCount,
sum(if(shop_stage = 2, 1, 0)) as buildShopCount,
sum(if(shop_stage = 3, 1, 0)) as openShopCount
from xfsg_shop_info
where deleted = '0'
and line_id = #{lineId}
</select>
<update id="unbindPoint">
update xfsg_shop_info set point_id = null where id = #{shopId}
</update>
<update id="unbindPoint">
update xfsg_shop_info
set point_id = null
where id = #{shopId}
</update>
<select id="getShopListByIds" resultMap="BaseResultMap">
select
<include refid="allColumn"/>
from
xfsg_shop_info where id in
<foreach collection="shopIds" item="shopId" separator="," open="(" close=")">
#{shopId}
</foreach>
</select>
<select id="queryStoreNumeListByid" resultType="com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO">
select id as shopId,store_num as storeNum
from xfsg_shop_info
where 1=1
<if test="shopIdList != null and shopIdList.size >0">
and id in
<foreach collection="shopIdList" separator="," open="(" close=")" item="shopId">
<select id="getShopListByIds" resultMap="BaseResultMap">
select
<include refid="allColumn"/>
from
xfsg_shop_info where id in
<foreach collection="shopIds" item="shopId" separator="," open="(" close=")">
#{shopId}
</foreach>
</if>
</select>
</select>
<select id="getSelectedShopNum" resultType="com.cool.store.dto.point.LineCountDTO">
select
line_id as lineId,
count(1) as selectedShopNum
from xfsg_shop_info
where deleted = 0 and point_id > 0 and line_id in
<foreach collection="lineIds" item="lineId" index="index" open="(" separator="," close=")">
#{lineId}
</foreach>
group by line_id
</select>
<select id="ListByCondition" resultType="com.cool.store.dto.Preparation.PreparationDTO">
select
a.id as id,
a.line_id as lineId,
a.shop_name as shopName,
a.shop_code as shopCode,
a.store_num as storeNum,
a.shop_manager_user_id as shopManagerUserId,
a.supervisor_user_id as supervisorUserId,
a.region_id as regionId,
b.username as username,
b.mobile as mobile,
b.investment_manager as investmentManager,
DATE_ADD(b.create_time, INTERVAL 50 DAY) as planOpenTime,
a.create_time as createTime
from xfsg_shop_info a left join xfsg_line_info b on a.line_id = b.id
where a.deleted = 0
<if test="request.keyword != null and request.keyword != ''">
and (b.username like concat('%', #{request.keyword}, '%') or b.mobile like concat('%', #{request.keyword}, '%'))
</if>
<if test="request.shopName!=null and request.shopName!=''">
and a.shop_name like concat('%', #{request.shopName}, '%')
</if>
<if test="request.investmentUserId != null and request.investmentUserId != ''">
and b.investment_manager = #{request.investmentUserId}
</if>
<if test="request.supervisorUserId != null and request.supervisorUserId != ''">
and a.supervisor_user_id = #{request.supervisorUserId}
</if>
<if test="request.planOpenStartTime != null and request.planOpenStartTime != ''">
and DATE_ADD(b.create_time, INTERVAL 50 DAY) >= #{request.planOpenStartTime}
</if>
<if test="request.planOpenEndTime != null and request.planOpenEndTime != ''">
<![CDATA[and DATE_ADD(b.create_time, INTERVAL 50 DAY) <= #{request.planOpenEndTime}]]>
</if>
<if test="request.regionIds != null and request.regionIds.size() > 0">
and a.region_id in
<foreach collection="request.regionIds" item="regionId" index="index" open="(" separator="," close=")">
#{regionId}
</foreach>
</if>
<if test="request.authRegionIds != null and request.authRegionIds.size() > 0">
and a.region_id in
<foreach collection="request.authRegionIds" item="regionId" index="index" open="(" separator="," close=")">
#{regionId}
</foreach>
</if>
order by a.update_time desc
</select>
<select id="getRegionIdByid" resultType="java.lang.Long">
select r.parent_id
from xfsg_shop_info xsi
join region_${enterpriseId} r on r.id = xsi.region_id
where xsi.id = #{shopId}
</select>
<select id="queryStoreNumeListByid" resultType="com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO">
select id as shopId,store_num as storeNum
from xfsg_shop_info
where 1=1
<if test="shopIdList != null and shopIdList.size >0">
and id in
<foreach collection="shopIdList" separator="," open="(" close=")" item="shopId">
#{shopId}
</foreach>
</if>
</select>
<select id="getSelectedShopNum" resultType="com.cool.store.dto.point.LineCountDTO">
select
line_id as lineId,
count(1) as selectedShopNum
from xfsg_shop_info
where deleted = 0 and point_id > 0 and line_id in
<foreach collection="lineIds" item="lineId" index="index" open="(" separator="," close=")">
#{lineId}
</foreach>
group by line_id
</select>
<select id="ListByCondition" resultType="com.cool.store.dto.Preparation.PreparationDTO">
select
a.id as id,
a.line_id as lineId,
a.shop_name as shopName,
a.shop_code as shopCode,
a.store_num as storeNum,
a.shop_manager_user_id as shopManagerUserId,
a.supervisor_user_id as supervisorUserId,
a.region_id as regionId,
b.username as username,
b.mobile as mobile,
b.investment_manager as investmentManager,
DATE_ADD(b.create_time, INTERVAL 50 DAY) as planOpenTime,
a.create_time as createTime
from xfsg_shop_info a left join xfsg_line_info b on a.line_id = b.id
where a.deleted = 0
<if test="request.keyword != null and request.keyword != ''">
and (b.username like concat('%', #{request.keyword}, '%') or b.mobile like concat('%', #{request.keyword},
'%'))
</if>
<if test="request.shopName!=null and request.shopName!=''">
and a.shop_name like concat('%', #{request.shopName}, '%')
</if>
<if test="request.investmentUserId != null and request.investmentUserId != ''">
and b.investment_manager = #{request.investmentUserId}
</if>
<if test="request.supervisorUserId != null and request.supervisorUserId != ''">
and a.supervisor_user_id = #{request.supervisorUserId}
</if>
<if test="request.planOpenStartTime != null and request.planOpenStartTime != ''">
and DATE_ADD(b.create_time, INTERVAL 50 DAY) >= #{request.planOpenStartTime}
</if>
<if test="request.planOpenEndTime != null and request.planOpenEndTime != ''">
<![CDATA[and DATE_ADD(b.create_time, INTERVAL 50 DAY) <= #{request.planOpenEndTime}]]>
</if>
<if test="request.regionIds != null and request.regionIds.size() > 0">
and a.region_id in
<foreach collection="request.regionIds" item="regionId" index="index" open="(" separator="," close=")">
#{regionId}
</foreach>
</if>
<if test="request.authRegionIds != null and request.authRegionIds.size() > 0">
and a.region_id in
<foreach collection="request.authRegionIds" item="regionId" index="index" open="(" separator="," close=")">
#{regionId}
</foreach>
</if>
order by a.update_time desc
</select>
<select id="getRegionIdByid" resultType="java.lang.Long">
select r.parent_id
from xfsg_shop_info xsi
join region_${enterpriseId} r on r.id = xsi.region_id
where xsi.id = #{shopId}
</select>
<select id="selectByStoreNum" resultType="com.cool.store.entity.ShopInfoDO">
select <include refid="allColumn"/>
from xfsg_shop_info
where store_num = #{storeNum}
select
<include refid="allColumn"/>
from xfsg_shop_info
where store_num = #{storeNum}
</select>
<select id="selectShopListByRegionId" resultType="com.cool.store.entity.ShopInfoDO">
select
xsi.id,xsi.line_id as lineId,xsi.region_id as regionId,xsi.shop_name as shopName,xsi.store_num as storeNum,xsi.shop_code as shopCode
from xfsg_shop_info xsi
left join xfsg_shop_stage_info xssi on xssi.shop_id = xsi.id
where
xsi.deleted = 0
<if test="regionIds != null and regionIds.size() > 0">
and xsi.region_id in
<foreach collection="regionIds" item="regionId" index="index" open="(" separator="," close=")">
#{regionId}
</foreach>
</if>
AND xssi.shop_sub_stage_status != -100
and xssi.shop_sub_stage = #{shopSubStage}
<if test="subStageStatus != null and subStageStatus.size()>0">
and xssi.shop_sub_stage_status in
<foreach collection="subStageStatus" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="keyWord != null and keyWord != '' ">
and xsi.shop_name Like concat("%",#{keyWord},"%") or xsi.store_num Like concat("%",#{keyWord},"%")
</if>
select
xsi.id,xsi.line_id as lineId,xsi.region_id as regionId,xsi.shop_name as shopName,xsi.store_num as
storeNum,xsi.shop_code as shopCode
from xfsg_shop_info xsi
left join xfsg_shop_stage_info xssi on xssi.shop_id = xsi.id
where
xsi.deleted = 0
<if test="regionIds != null and regionIds.size() > 0">
and xsi.region_id in
<foreach collection="regionIds" item="regionId" index="index" open="(" separator="," close=")">
#{regionId}
</foreach>
</if>
AND xssi.shop_sub_stage_status != -100
and xssi.shop_sub_stage = #{shopSubStage}
<if test="subStageStatus != null and subStageStatus.size()>0">
and xssi.shop_sub_stage_status in
<foreach collection="subStageStatus" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="keyWord != null and keyWord != '' ">
and xsi.shop_name Like concat("%",#{keyWord},"%") or xsi.store_num Like concat("%",#{keyWord},"%")
</if>
</select>
<select id="platformBuildList" resultType="com.cool.store.response.PlatformBuildListResponse">
select
DISTINCT
DISTINCT
xsi.id as shopId,
xsi.shop_name as shopName,
xsi.shop_code as shopCode,
@@ -213,31 +236,172 @@
order by xsi.create_time desc
</select>
<select id="selectByIdOrSelectAll" resultMap="BaseResultMap">
select
<include refid="allColumn"/>
from
xfsg_shop_info
<where>
<if test="shopId!=null">
and id = #{shopId}
</if>
</where>
</select>
<select id="selectByIdOrSelectAll" resultMap="BaseResultMap">
select
<include refid="allColumn"/>
from
xfsg_shop_info
<where>
<if test="shopId!=null">
and id = #{shopId}
</if>
</where>
</select>
<select id="getShopAndStoreList" resultType="com.cool.store.dto.LicenseSyncDTO">
<select id="getShopAndStoreList" resultType="com.cool.store.dto.LicenseSyncDTO">
select
a.id as shopId,
a.shop_code as shopCode,
b.store_id as storeId
from
xfsg_shop_info a
left join store_${enterpriseId} b on a.shop_code = b.store_num
where b.store_id is not null and a.id in
<foreach collection="shopIds" item="shopId" separator="," open="(" close=")">
#{shopId}
</foreach>
</select>
<select id="ListByBranchShopRequest" resultType="com.cool.store.dto.Preparation.PreparationDTO">
select
a.id as id,
a.line_id as lineId,
a.shop_name as shopName,
a.want_shop_area_id as wantShopAreaId,
a.shop_code as shopCode,
a.store_num as storeNum,
a.shop_manager_user_id as shopManagerUserId,
a.supervisor_user_id as supervisorUserId,
a.region_id as regionId,
b.username as username,
b.mobile as mobile,
a.investment_manager as investmentManager,
DATE_ADD(a.create_time, INTERVAL 50 DAY) as planOpenTime,
a.create_time as createTime,
a.join_mode as joinMode,
a.franchise_brand as franchiseBrand,
a.shop_status as shopStatus
from xfsg_shop_info a left join xfsg_line_info b on a.line_id = b.id
where a.deleted = 0
<if test="request.partnerKeyword != null and request.partnerKeyword != ''">
and (b.username like concat('%', #{request.partnerKeyword}, '%') or b.mobile like concat('%',
#{request.partnerKeyword}, '%'))
</if>
<if test="request.shopKeyword!=null and request.shopKeyword!=''">
and (a.shop_name like concat('%',#{request.shopKeyword}, '%') or a.shop_code like concat('%',
#{request.shopKeyword}, '%') )
</if>
<if test="request.regionIds != null and request.regionIds.size() > 0">
and a.region_id in
<foreach collection="request.regionIds" item="regionId" index="index" open="(" separator="," close=")">
#{regionId}
</foreach>
</if>
<if test="request.investmentManagerUserId != null and request.investmentManagerUserId != ''">
and a.investment_manager = #{request.investmentManagerUserId}
</if>
<if test="request.openTimeStart != null ">
and DATE_ADD(a.create_time, INTERVAL 50 DAY) >= #{request.openTimeStart}
</if>
<if test="request.openTimeEnd != null ">
<![CDATA[and DATE_ADD(a.create_time, INTERVAL 50 DAY) <= #{request.openTimeEnd}]]>
</if>
<if test="request.joinMode!=null and request.joinMode.size >0">
and a.join_mode in
<foreach collection="request.joinMode" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="request.franchiseBrand!=null and request.franchiseBrand.size>0">
and
<foreach collection="request.franchiseBrand" item="item" index="index" open="(" separator="or" close=")">
FIND_IN_SET(#{item}, a.franchise_brand)>0
</foreach>
</if>
<if test="request.shopStatus!=null and request.shopStatus.size>0">
and a.shop_status in
<foreach collection="request.shopStatus" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="request.wantShopAreaAllIds != null and request.wantShopAreaAllIds.size() > 0">
and a.want_shop_area_id in
<foreach collection="request.wantShopAreaAllIds" item="wantShopAreaId" index="index" open="(" separator=","
close=")">
#{wantShopAreaId}
</foreach>
</if>
<if test="request.flag == 1">
and a.investment_manager = #{userId}
</if>
<if test="request.authRegionIds != null and request.authRegionIds.size() > 0">
and a.region_id in
<foreach collection="request.authRegionIds" item="regionId" index="index" open="(" separator="," close=")">
#{regionId}
</foreach>
</if>
order by a.update_time desc
</select>
<select id="getShopListByRegion" resultType="com.cool.store.entity.ShopInfoDO">
select
<include refid="allColumn"/>
from xfsg_shop_info where line_id = #{lineId} and deleted= '0'
<if test="list!=null and list.size>0">
and region_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<select id="getShopPointListByDevelopmentManager" resultType="com.cool.store.dto.point.ShopPointDTO">
select
a.id as shopId,
a.shop_code as shopCode,
b.store_id as storeId
from
xfsg_shop_info a
left join store_${enterpriseId} b on a.shop_code = b.store_num
where b.store_id is not null and a.id in
<foreach collection="shopIds" item="shopId" separator="," open="(" close=")">
#{shopId}
</foreach>
a.id as shopId,
a.point_id as pointId,
a.shop_name as shopName,
a.want_shop_area_id as wantShopAreaId,
b.user_portrait as userPortrait,
b.id as lineId,
b.username as userName,
b.mobile as mobile,
b.investment_manager as investmentManager
from xfsg_shop_info a left join xfsg_line_info b on a.line_id = b.id
where a.deleted = 0 and a.development_manager = #{request.developmentManager} and shop_status in (0, 1) and point_id is null
<if test="request.keyword != null and request.keyword!=''">
and (b.username like concat('%', #{request.keyword}, '%') or b.mobile like concat('%', #{request.keyword}, '%'))
</if>
</select>
<select id="selectAllDataOrByLineId" resultMap="BaseResultMap">
select * from xfsg_shop_info
<where>
<if test="lineId!=null">
and line_id = #{lineId}
</if>
</where>
</select>
<select id="selectInvestmentByList" resultType="com.cool.store.entity.ShopInfoDO">
select line_id as LineId,
investment_manager as InvestmentManager
from xfsg_shop_info
where line_id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<update id="batchUpdate" parameterType="list">
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
UPDATE xfsg_shop_info
SET
development_manager = #{item.developmentManager},
join_mode = #{item.joinMode},
shop_status = #{item.shopStatus},
franchise_brand = #{item.franchiseBrand},
investment_manager = #{item.investmentManager},
want_shop_area_id = #{item.wantShopAreaId}
WHERE id = #{item.id}
</foreach>
</update>
</mapper>

View File

@@ -1,368 +1,412 @@
<?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.ShopStageInfoMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.ShopStageInfoDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="line_id" jdbcType="BIGINT" property="lineId" />
<result column="shop_id" jdbcType="BIGINT" property="shopId" />
<result column="shop_stage" jdbcType="TINYINT" property="shopStage" />
<result column="shop_sub_stage" jdbcType="TINYINT" property="shopSubStage" />
<result column="shop_sub_stage_status" jdbcType="TINYINT" property="shopSubStageStatus" />
<result column="is_terminated" jdbcType="BIT" property="isTerminated" />
<result column="plan_complete_time" jdbcType="VARCHAR" property="planCompleteTime" />
<result column="actual_complete_time" jdbcType="VARCHAR" property="actualCompleteTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="audit_id" jdbcType="BIGINT" property="auditId" />
<result column="deleted" jdbcType="BIT" property="deleted" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<resultMap id="BaseResultMap" type="com.cool.store.entity.ShopStageInfoDO">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="line_id" jdbcType="BIGINT" property="lineId"/>
<result column="shop_id" jdbcType="BIGINT" property="shopId"/>
<result column="shop_stage" jdbcType="TINYINT" property="shopStage"/>
<result column="shop_sub_stage" jdbcType="TINYINT" property="shopSubStage"/>
<result column="shop_sub_stage_status" jdbcType="TINYINT" property="shopSubStageStatus"/>
<result column="is_terminated" jdbcType="BIT" property="isTerminated"/>
<result column="plan_complete_time" jdbcType="VARCHAR" property="planCompleteTime"/>
<result column="actual_complete_time" jdbcType="VARCHAR" property="actualCompleteTime"/>
<result column="remark" jdbcType="VARCHAR" property="remark"/>
<result column="audit_id" jdbcType="BIGINT" property="auditId"/>
<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="allColumn">
id, line_id, shop_id, shop_stage, shop_sub_stage, shop_sub_stage_status, is_terminated, plan_complete_time, actual_complete_time, remark, audit_id, deleted, create_time, update_time
</sql>
<sql id="allColumn">
id, line_id, shop_id, shop_stage, shop_sub_stage, shop_sub_stage_status, is_terminated, plan_complete_time,
actual_complete_time, remark, audit_id, deleted, create_time, update_time
</sql>
<insert id="batchInsert">
<foreach collection="addShopStageList" separator=";" item="shop">
INSERT INTO xfsg_shop_stage_info(line_id, shop_id, shop_stage, shop_sub_stage, shop_sub_stage_status, is_terminated, plan_complete_time, remark)
VALUES(#{shop.lineId}, #{shop.shopId}, #{shop.shopStage}, #{shop.shopSubStage}, #{shop.shopSubStageStatus}, #{shop.isTerminated}, #{shop.planCompleteTime}, #{shop.remark})
</foreach>
</insert>
<insert id="batchInsert">
<foreach collection="addShopStageList" separator=";" item="shop">
INSERT INTO xfsg_shop_stage_info(line_id, shop_id, shop_stage, shop_sub_stage, shop_sub_stage_status,
is_terminated, plan_complete_time, remark)
VALUES(#{shop.lineId}, #{shop.shopId}, #{shop.shopStage}, #{shop.shopSubStage}, #{shop.shopSubStageStatus},
#{shop.isTerminated}, #{shop.planCompleteTime}, #{shop.remark})
</foreach>
</insert>
<update id="batchUpdate">
update xfsg_shop_stage_info
<set>
shop_sub_stage_status = CASE id
<foreach collection="addShopStageList" separator=" " item="item">
WHEN #{item.id} THEN IFNULL(#{item.shopSubStageStatus},shop_sub_stage_status)
</foreach>
END
</set>
where id in (
<foreach collection="addShopStageList" item="item" separator=",">
#{item.id}
</foreach>
)
</update>
<update id="batchUpdate">
update xfsg_shop_stage_info
<set>
shop_sub_stage_status = CASE id
<foreach collection="addShopStageList" separator=" " item="item">
WHEN #{item.id} THEN IFNULL(#{item.shopSubStageStatus},shop_sub_stage_status)
</foreach>
END
</set>
where id in (
<foreach collection="addShopStageList" item="item" separator=",">
#{item.id}
</foreach>
)
</update>
<select id="getShopStageInfo" resultMap="BaseResultMap">
select
<include refid="allColumn"/>
from
xfsg_shop_stage_info
where
shop_id = #{shopId} and deleted = 0
<if test="shopStage != null">
and shop_stage = #{shopStage}
</if>
</select>
<select id="getPreparationProcess" resultType="com.cool.store.vo.Preparation.PreparationProcessVO">
select
max(plan_complete_time) as planStartTime,
sum(if(is_terminated = 1, 1, 0)) as finishCount
from xfsg_shop_stage_info where shop_id = #{shopId}
</select>
<select id="getAllCompletionCount" resultType="java.lang.Integer">
select
count(1)
from
xfsg_shop_stage_info
where
shop_id = #{shopId} and deleted = 0 and is_terminated = 1
and shop_sub_stage in (60,40,120,140,150)
</select>
<update id="updateShopStageInfo">
update
xfsg_shop_stage_info
set
shop_sub_stage_status = #{shopSubStageStatus},
is_terminated = #{isTerminated},
remark = #{remark},
actual_complete_time = if(is_terminated, now(), null)
where
shop_id = #{shopId} and shop_sub_stage = #{shopSubStage}
</update>
<update id="batchUpdateShopStageStatus">
<foreach collection="updateList" separator=";" item="update">
update
<select id="getShopStageInfo" resultMap="BaseResultMap">
select
<include refid="allColumn"/>
from
xfsg_shop_stage_info
set
shop_sub_stage_status = #{update.shopSubStageStatus},
is_terminated = #{update.isTerminated},
remark = #{update.remark},
where
shop_id = #{shopId} and deleted = 0
<if test="shopStage != null">
and shop_stage = #{shopStage}
</if>
</select>
<select id="getPreparationProcess" resultType="com.cool.store.vo.Preparation.PreparationProcessVO">
select
max(plan_complete_time) as planStartTime,
sum(if(is_terminated = 1, 1, 0)) as finishCount
from xfsg_shop_stage_info where shop_id = #{shopId}
</select>
<select id="getAllCompletionCount" resultType="java.lang.Integer">
select
count(1)
from
xfsg_shop_stage_info
where
shop_id = #{shopId} and deleted = 0 and is_terminated = 1
and shop_sub_stage in (60,40,120,140,150)
</select>
<update id="updateShopStageInfo">
update
xfsg_shop_stage_info
set
shop_sub_stage_status = #{shopSubStageStatus},
is_terminated = #{isTerminated},
remark = #{remark},
actual_complete_time = if(is_terminated, now(), null)
where
shop_id = #{shopId} and shop_sub_stage = #{update.shopSubStage}
</foreach>
</update>
<select id="getShopSubStageInfo" resultMap="BaseResultMap">
select
<include refid="allColumn"/>
from
xfsg_shop_stage_info
where
shop_id = #{shopId} and shop_sub_stage = #{shopSubStage} and deleted = 0
</select>
<update id="updateShopStageAndAuditInfo">
update
xfsg_shop_stage_info
set
shop_sub_stage_status = #{shopSubStageStatus},
is_terminated = #{isTerminated},
remark = #{remark},
actual_complete_time = if(is_terminated, now(), null),
audit_id = #{auditId}
where
shop_id = #{shopId} and shop_sub_stage = #{shopSubStage}
</update>
<update id="updateShopStageToNotStarted">
update
xfsg_shop_stage_info
set
shop_sub_stage_status = -100,
is_terminated = 0,
remark = '未开始',
actual_complete_time = null,
audit_id = null
where
shop_id = #{shopId} and shop_sub_stage = #{shopSubStage}
</update>
<update id="updateByShopId">
update xfsg_shop_stage_info
<set>
<if test="shopStageInfoDO.planCompleteTime">
plan_complete_time = #{shopStageInfoDO.planCompleteTime},
</if>
<if test="shopStageInfoDO.actualCompleteTime">
actual_complete_time = #{shopStageInfoDO.actualCompleteTime},
</if>
</set>
where shop_id = #{shopStageInfoDO.shopId} AND shop_sub_stage = #{shopStageInfoDO.shopSubStage}
</update>
<update id="batchUpdateStatus">
update xfsg_shop_stage_info
<set>
<if test="shopSubStageStatusEnum !=null">
shop_sub_stage_status = #{shopSubStageStatusEnum}
</if>
</set>
where shop_id in
<foreach collection="shopIdList" item="shopId" open="(" separator="," close=")">
#{shopId}
</foreach>
<if test="shopSubStageEnum != null">
and shop_sub_stage = #{shopSubStageEnum}
</if>
</update>
<select id="getRentContractToDoPage" resultType="com.cool.store.vo.shop.RentInfoToDoVO">
select
b.id as lineId,
b.username as lineUsername,
b.mobile as lineMobile,
a.shop_id as shopId,
a.shop_sub_stage_status as shopSubStageStatus
from
xfsg_shop_stage_info a
inner join xfsg_line_info b on a.line_id = b.id
where
a.shop_sub_stage = #{shopSubStage} and a.shop_sub_stage_status = #{shopSubStageStatus} and a.deleted = 0 and b.deleted = 0 and b.development_manager = #{userId}
</select>
where
shop_id = #{shopId} and shop_sub_stage = #{shopSubStage}
</update>
<select id="getScheduleList" resultType="com.cool.store.dto.Preparation.ScheduleDTO">
select
shop_id as shopId,
max(plan_complete_time) as planCompleteTime,
count(1)-1 as totalColumn,
sum(if(is_terminated = 1 and shop_sub_stage!=85, 1, 0)) as completionColumn
from xfsg_shop_stage_info where shop_stage = 2
<if test="shopIds != null and shopIds.size() > 0">
and shop_id in
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
#{shopId}
</foreach>
</if>
group by shop_id
</select>
<update id="batchUpdateShopStageStatus">
<foreach collection="updateList" separator=";" item="update">
update
xfsg_shop_stage_info
set
shop_sub_stage_status = #{update.shopSubStageStatus},
is_terminated = #{update.isTerminated},
remark = #{update.remark},
actual_complete_time = if(is_terminated, now(), null)
where
shop_id = #{shopId} and shop_sub_stage = #{update.shopSubStage}
</foreach>
</update>
<select id="getShopSubStageInfo" resultMap="BaseResultMap">
select
<include refid="allColumn"/>
from
xfsg_shop_stage_info
where
shop_id = #{shopId} and shop_sub_stage = #{shopSubStage} and deleted = 0
</select>
<update id="updateShopStageAndAuditInfo">
update
xfsg_shop_stage_info
set
shop_sub_stage_status = #{shopSubStageStatus},
is_terminated = #{isTerminated},
remark = #{remark},
actual_complete_time = if(is_terminated, now(), null),
audit_id = #{auditId}
where
shop_id = #{shopId} and shop_sub_stage = #{shopSubStage}
</update>
<update id="updateShopStageToNotStarted">
update
xfsg_shop_stage_info
set
shop_sub_stage_status = -100,
is_terminated = 0,
remark = '未开始',
actual_complete_time = null,
audit_id = null
where
shop_id = #{shopId} and shop_sub_stage = #{shopSubStage}
</update>
<update id="updateByShopId">
update xfsg_shop_stage_info
<set>
<if test="shopStageInfoDO.planCompleteTime">
plan_complete_time = #{shopStageInfoDO.planCompleteTime},
</if>
<if test="shopStageInfoDO.actualCompleteTime">
actual_complete_time = #{shopStageInfoDO.actualCompleteTime},
</if>
</set>
where shop_id = #{shopStageInfoDO.shopId} AND shop_sub_stage = #{shopStageInfoDO.shopSubStage}
</update>
<update id="batchUpdateStatus">
update xfsg_shop_stage_info
<set>
<if test="shopSubStageStatusEnum !=null">
shop_sub_stage_status = #{shopSubStageStatusEnum}
</if>
</set>
where shop_id in
<foreach collection="shopIdList" item="shopId" open="(" separator="," close=")">
#{shopId}
</foreach>
<if test="shopSubStageEnum != null">
and shop_sub_stage = #{shopSubStageEnum}
</if>
</update>
<update id="batchUpdateByShopIdsAndSubStageStatus">
<foreach collection="updateList" separator=";" item="update">
update
xfsg_shop_stage_info
set
shop_sub_stage_status = #{update.shopSubStageStatus},
is_terminated = #{update.isTerminated},
remark = #{update.remark},
actual_complete_time = if(is_terminated, now(), null)
where
shop_id in
<foreach collection="shopIds" item="shopId" open="(" separator="," close=")">
#{shopId}
</foreach>
and shop_sub_stage = #{update.shopSubStage}
</foreach>
</update>
<select id="getRentContractToDoPage" resultType="com.cool.store.vo.shop.RentInfoToDoVO">
select
b.id as lineId,
b.username as lineUsername,
b.mobile as lineMobile,
a.shop_id as shopId,
a.shop_sub_stage_status as shopSubStageStatus
from
xfsg_shop_stage_info a
inner join xfsg_line_info b on a.line_id = b.id
where
a.shop_sub_stage = #{shopSubStage} and a.shop_sub_stage_status = #{shopSubStageStatus} and a.deleted = 0 and
b.deleted = 0 and b.development_manager = #{userId}
</select>
<select id="getShopContractActualCompletionTime" resultMap="BaseResultMap">
select
*
from xfsg_shop_stage_info where shop_stage = 1 and shop_sub_stage = 20 and actual_complete_time is not null
<if test="shopIds != null and shopIds.size() > 0">
and shop_id in
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
#{shopId}
</foreach>
</if>
</select>
<select id="getCanSubmitRentContractShopIds" resultType="long">
select
shop_id
from
xfsg_shop_stage_info
where shop_sub_stage_status in(200, 220) and shop_id in
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
#{shopId}
</foreach>
</select>
<select id="getShopContractIncompletion" resultType="java.lang.Long">
SELECT
shop_id
FROM
xfsg_shop_stage_info
WHERE
shop_sub_stage = 110
AND (shop_sub_stage_status = 1100 OR shop_sub_stage_status = 1110)
</select>
<select id="getScheduleList" resultType="com.cool.store.dto.Preparation.ScheduleDTO">
select
shop_id as shopId,
max(plan_complete_time) as planCompleteTime,
count(1)-1 as totalColumn,
sum(if(is_terminated = 1 and shop_sub_stage!=85, 1, 0)) as completionColumn
from xfsg_shop_stage_info where shop_stage = 2
<if test="shopIds != null and shopIds.size() > 0">
and shop_id in
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
#{shopId}
</foreach>
</if>
group by shop_id
</select>
<select id="getSpecialShopStageInfo" resultMap="BaseResultMap">
select
*
from xfsg_shop_stage_info a
<if test="investmentUserId!=null and investmentUserId!=''">
left join xfsg_line_info b on a.line_id = b.id
</if>
<if test="authRegionIds != null and authRegionIds.size() > 0">
left join xfsg_shop_info si on a.shop_id = si.id
</if>
<where>
<if test="shopIds != null and shopIds.size() > 0">
and a.shop_id in
<select id="getShopContractActualCompletionTime" resultMap="BaseResultMap">
select
*
from xfsg_shop_stage_info where shop_stage = 1 and shop_sub_stage = 20 and actual_complete_time is not null
<if test="shopIds != null and shopIds.size() > 0">
and shop_id in
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
#{shopId}
</foreach>
</if>
</select>
<select id="getCanSubmitRentContractShopIds" resultType="long">
select
shop_id
from
xfsg_shop_stage_info
where shop_sub_stage_status in(200, 220) and shop_id in
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
#{shopId}
#{shopId}
</foreach>
</if>
<if test="shopSubStage!=null">
and a.shop_sub_stage = #{shopSubStage}
</if>
<if test="shopSubStageStatusList != null and shopSubStageStatusList.size() > 0">
and a.shop_sub_stage_status in
<foreach collection="shopSubStageStatusList" item="stageStatus" index="index" open="(" separator="," close=")">
#{stageStatus}
</select>
<select id="getShopContractIncompletion" resultType="java.lang.Long">
SELECT
shop_id
FROM
xfsg_shop_stage_info
WHERE
shop_sub_stage = 110
AND (shop_sub_stage_status = 1100 OR shop_sub_stage_status = 1110)
</select>
<select id="getSpecialShopStageInfo" resultMap="BaseResultMap">
select
*
from xfsg_shop_stage_info a
<if test="(authRegionIds != null and authRegionIds.size() > 0) or (investmentUserId != null and investmentUserId != '')">
left join xfsg_shop_info si on a.shop_id = si.id
</if>
<where>
<if test="shopIds != null and shopIds.size() > 0">
and a.shop_id in
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
#{shopId}
</foreach>
</if>
<if test="shopSubStage!=null">
and a.shop_sub_stage = #{shopSubStage}
</if>
<if test="shopSubStageStatusList != null and shopSubStageStatusList.size() > 0">
and a.shop_sub_stage_status in
<foreach collection="shopSubStageStatusList" item="stageStatus" index="index" open="(" separator=","
close=")">
#{stageStatus}
</foreach>
</if>
<if test="investmentUserId!=null and investmentUserId!='' and authRegionIds.size()==0">
and si.investment_manager = #{investmentUserId}
</if>
<if test="authRegionIds != null and authRegionIds.size() > 0">
and si.region_id in
<foreach collection="authRegionIds" item="regionId" index="index" open="(" separator="," close=")">
#{regionId}
</foreach>
</if>
</where>
</select>
<select id="getSubStageList" resultType="com.cool.store.entity.ShopStageInfoDO">
select *
from xfsg_shop_stage_info
where 1=1
<if test="shopIds !=null and shopIds.size()>0">
and shop_id in
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
#{shopId}
</foreach>
</if>
<if test="shopSubStage !=null">
and shop_sub_stage =#{shopSubStage}
</if>
</select>
<select id="getShopIdListByStageStatus" resultType="com.cool.store.entity.ShopStageInfoDO">
select *
from xfsg_shop_stage_info
where shop_sub_stage_status = #{shopSubStageStatus}
</select>
<select id="getShopCountByLineIdAndStageStatus" resultType="integer">
select count(1) from xfsg_shop_stage_info where shop_stage = #{shopStage} and shop_sub_stage = #{shopSubStage}
and shop_sub_stage_status = #{shopSubStageStatus} and line_id = #{lineId}
</select>
<select id="getSubStageListBySubStageStatus" resultType="com.cool.store.entity.ShopStageInfoDO">
select *
from xfsg_shop_stage_info
where 1=1
<if test="subStageStatusA !=null">
or shop_sub_stage_status = #{subStageStatusA}
</if>
<if test="subStageStatusB !=null">
or shop_sub_stage_status = #{subStageStatusB}
</if>
<if test="subStageStatusC !=null">
and shop_sub_stage_status = #{subStageStatusC}
</if>
</select>
<select id="getByShopIdAndSubStage" resultType="com.cool.store.entity.ShopStageInfoDO">
SELECT
<include refid="allColumn"/>
FROM xfsg_shop_stage_info
WHERE shop_id = #{shopId}
AND shop_sub_stage = #{shopSubStage}
</select>
<select id="getPlatformBuildList" resultType="com.cool.store.dto.Preparation.ScheduleDTO">
select
shop_id as shopId,
count(1) as totalColumn,
sum(if(is_terminated = 1, 1, 0)) as completionColumn
from xfsg_shop_stage_info where shop_stage = 3
<if test="shopIds != null and shopIds.size() > 0">
and shop_id in
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
#{shopId}
</foreach>
</if>
group by shop_id
</select>
<select id="getPlatformBuildStage" resultType="com.cool.store.dto.PlatformBuildStageDTO">
select shop_id as shopId,
shop_sub_stage as shopSubStage,
shop_sub_stage_status as shopSubStageStatus
from xfsg_shop_stage_info
where shop_stage = 3
and shop_sub_stage_status != -100
and shop_id in
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
#{shopId}
</foreach>
</if>
<if test="investmentUserId!=null and investmentUserId!='' and authRegionIds.size()==0">
and b.investment_manager = #{investmentUserId}
</if>
<if test="authRegionIds != null and authRegionIds.size() > 0">
and si.region_id in
<foreach collection="authRegionIds" item="regionId" index="index" open="(" separator="," close=")">
#{regionId}
</foreach>
</if>
</where>
</select>
<select id="getSubStageList" resultType="com.cool.store.entity.ShopStageInfoDO">
select *
from xfsg_shop_stage_info
where 1=1
<if test="shopIds !=null and shopIds.size()>0">
and shop_id in
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
#{shopId}
</foreach>
</if>
<if test="shopSubStage !=null">
and shop_sub_stage =#{shopSubStage}
</if>
</select>
<select id="getShopIdListByStageStatus" resultType="com.cool.store.entity.ShopStageInfoDO">
select *
from xfsg_shop_stage_info
where shop_sub_stage_status = #{shopSubStageStatus}
</select>
<select id="getShopCountByLineIdAndStageStatus" resultType="integer">
select count(1) from xfsg_shop_stage_info where shop_stage = #{shopStage} and shop_sub_stage = #{shopSubStage} and shop_sub_stage_status = #{shopSubStageStatus} and line_id = #{lineId}
</select>
<select id="getSubStageListBySubStageStatus" resultType="com.cool.store.entity.ShopStageInfoDO">
select *
from xfsg_shop_stage_info
where 1=1
<if test="subStageStatusA !=null">
or shop_sub_stage_status = #{subStageStatusA}
</if>
<if test="subStageStatusB !=null">
or shop_sub_stage_status = #{subStageStatusB}
</if>
<if test="subStageStatusC !=null">
and shop_sub_stage_status = #{subStageStatusC}
</if>
</select>
</select>
<select id="getSubStages" resultType="com.cool.store.entity.ShopStageInfoDO">
select *
from xfsg_shop_stage_info
where is_terminated = 1
<if test="shopIds !=null and shopIds.size()>0">
and shop_id in
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
#{shopId}
</foreach>
</if>
<if test="shopSubStage !=null">
and shop_sub_stage =#{shopSubStage}
</if>
</select>
<select id="getOpenActivityActualCompletionTime" resultType="com.cool.store.entity.ShopStageInfoDO">
select
*
from xfsg_shop_stage_info where shop_stage = 2 and shop_sub_stage = 140 and actual_complete_time is not null
<if test="shopIds != null and shopIds.size() > 0">
and shop_id in
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
#{shopId}
</foreach>
</if>
</select>
<select id="getAllNumber" resultType="java.lang.Integer">
select count(*)
from xfsg_shop_stage_info
where shop_stage = 2
<if test="flag !=null and flag = 1">
and is_terminated =1
</if>
and shop_sub_stage != 85
<if test="shopId !=null">
and shop_id = #{shopId}
</if>
</select>
<select id="getScheduleAll" resultType="com.cool.store.dto.Preparation.ScheduleDTO">
select
shop_id as shopId,
max(plan_complete_time) as planCompleteTime,
count(1)-1 as totalColumn,
sum(if(is_terminated = 1 and shop_sub_stage!=85, 1, 0)) as completionColumn
from xfsg_shop_stage_info where shop_stage = 2 and
shop_id = #{shopId}
<select id="getByShopIdAndSubStage" resultType="com.cool.store.entity.ShopStageInfoDO">
SELECT <include refid="allColumn"/>
FROM xfsg_shop_stage_info
WHERE shop_id = #{shopId}
AND shop_sub_stage = #{shopSubStage}
</select>
<select id="getPlatformBuildList" resultType="com.cool.store.dto.Preparation.ScheduleDTO">
select
shop_id as shopId,
count(1) as totalColumn,
sum(if(is_terminated = 1, 1, 0)) as completionColumn
from xfsg_shop_stage_info where shop_stage = 3
<if test="shopIds != null and shopIds.size() > 0">
and shop_id in
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
#{shopId}
</foreach>
</if>
group by shop_id
</select>
<select id="getPlatformBuildStage" resultType="com.cool.store.dto.PlatformBuildStageDTO">
select shop_id as shopId,
shop_sub_stage as shopSubStage,
shop_sub_stage_status as shopSubStageStatus
from xfsg_shop_stage_info
where shop_stage = 3
and shop_sub_stage_status != -100
and shop_id in
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
#{shopId}
</foreach>
</select>
<select id="getSubStages" resultType="com.cool.store.entity.ShopStageInfoDO">
select *
from xfsg_shop_stage_info
where is_terminated = 1
<if test="shopIds !=null and shopIds.size()>0">
and shop_id in
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
#{shopId}
</foreach>
</if>
<if test="shopSubStage !=null">
and shop_sub_stage =#{shopSubStage}
</if>
</select>
<select id="getOpenActivityActualCompletionTime" resultType="com.cool.store.entity.ShopStageInfoDO">
select
*
from xfsg_shop_stage_info where shop_stage = 2 and shop_sub_stage = 140 and actual_complete_time is not null
<if test="shopIds != null and shopIds.size() > 0">
and shop_id in
<foreach collection="shopIds" item="shopId" index="index" open="(" separator="," close=")">
#{shopId}
</foreach>
</if>
</select>
</select>
</mapper>

View File

@@ -13,4 +13,15 @@
order by create_time desc
limit 1
</select>
<select id="selectByShopIds" resultType="com.cool.store.entity.SignFranchiseDO">
select contract_code,shop_id,contract_start_time,contract_end_time
from xfsg_sign_franchise
where 1=1
<if test="list !=null and list.size >0">
and shop_id in
<foreach collection="list" open="(" separator="," close=")" item="item" index="index">
#{item}
</foreach>
</if>
</select>
</mapper>

View File

@@ -1,36 +1,37 @@
<?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.TransferLogMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.TransferLogDO">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="line_id" jdbcType="BIGINT" property="lineId" />
<result column="partner_id" jdbcType="BIGINT" property="partnerId" />
<result column="from_user_id" jdbcType="VARCHAR" property="fromUserId" />
<result column="to_user_id" jdbcType="VARCHAR" property="toUserId" />
<result column="type" jdbcType="TINYINT" property="type" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId" />
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId" />
</resultMap>
<resultMap id="BaseResultMap" type="com.cool.store.entity.TransferLogDO">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="line_id" jdbcType="BIGINT" property="lineId"/>
<result column="partner_id" jdbcType="BIGINT" property="partnerId"/>
<result column="from_user_id" jdbcType="VARCHAR" property="fromUserId"/>
<result column="to_user_id" jdbcType="VARCHAR" property="toUserId"/>
<result column="type" jdbcType="TINYINT" property="type"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId"/>
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId"/>
<result column="line_shop_type" jdbcType="TINYINT" property="lineShopType"/>
</resultMap>
<select id="getTransferLogList" resultType="com.cool.store.dto.TransferLogDTO">
select
b.user_id as fromUserId ,
b.name as fromUserName ,
b.mobile as fromUserMobile ,
c.user_id as toUserId ,
c.name as toUserName ,
c.mobile as toUserMobile ,
a.type as type
from
xfsg_transfer_log a
left join enterprise_user_${enterpriseId} b on b.user_id = a.from_user_id
left join enterprise_user_${enterpriseId} c on c.user_id = a.to_user_id where a.line_id = #{lindId}
</select>
<select id="getTransferLogList" resultType="com.cool.store.dto.TransferLogDTO">
select b.user_id as fromUserId,
b.name as fromUserName,
b.mobile as fromUserMobile,
c.user_id as toUserId,
c.name as toUserName,
c.mobile as toUserMobile,
a.type as type,
a.line_shop_type as lineShopType
from xfsg_transfer_log a
left join enterprise_user_${enterpriseId} b on b.user_id = a.from_user_id
left join enterprise_user_${enterpriseId} c on c.user_id = a.to_user_id
where a.line_id = #{lindId} and a.line_shop_type = #{lineShopType}
</select>
</mapper>