Merge branch 'cc_20250710_userRegion' into 'master'
Cc 20250710 user region See merge request hangzhou/java/custom_zxjp!131
This commit is contained in:
@@ -65,4 +65,14 @@ public class BigRegionDAO {
|
||||
return bigRegionMapper.queryBigRegion(queryBigRegionRequest);
|
||||
}
|
||||
|
||||
public BigRegionDO getByRegionId(Long regionId){
|
||||
if (regionId==null){
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
}
|
||||
Example example = new Example(BigRegionDO.class);
|
||||
example.createCriteria().andEqualTo("regionId", regionId);
|
||||
example.setOrderByClause("id ASC limit 1");
|
||||
return bigRegionMapper.selectOneByExample(example);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.aliyun.openservices.shade.org.apache.commons.lang3.StringUtils;
|
||||
import com.cool.store.dto.RegionNode;
|
||||
import com.cool.store.entity.RegionDO;
|
||||
import com.cool.store.mapper.RegionMapper;
|
||||
import com.cool.store.response.RegionResponse;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import tk.mybatis.mapper.entity.Example;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
@@ -29,6 +32,9 @@ public class RegionDao {
|
||||
|
||||
|
||||
public RegionNode getRegionByRegionId( String regionId) {
|
||||
if (StringUtils.isBlank(regionId)) {
|
||||
return null;
|
||||
}
|
||||
return regionMapper.getRegionByRegionId( regionId);
|
||||
}
|
||||
|
||||
@@ -187,4 +193,24 @@ public class RegionDao {
|
||||
}
|
||||
return regionMapper.getRegionByStoreId(storeId);
|
||||
}
|
||||
public List<RegionResponse> getSubRegionByParentIdAndRegionType (Long regionId, String regionType){
|
||||
if (Objects.isNull(regionId)|| StringUtils.isBlank(regionType)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return regionMapper.getSubRegionByParentIdAndRegionType(regionId, regionType);
|
||||
}
|
||||
public List<RegionDO> getRegionByNameListAndIsPath (List<String> name){
|
||||
if (CollectionUtils.isEmpty(name)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return regionMapper.getRegionByNameListAndIsPath(name);
|
||||
}
|
||||
|
||||
|
||||
public List<RegionDO> getSubRegionByParentIdsAndRegionType (List<Long> parentIdList, String regionType){
|
||||
if (CollectionUtils.isEmpty(parentIdList)|| StringUtils.isBlank(regionType)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return regionMapper.getSubRegionByParentIdsAndRegionType(parentIdList, regionType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.constants.CommonConstants;
|
||||
import com.cool.store.dto.FranchiseReportDTO;
|
||||
import com.cool.store.dto.IsCreateStoreDTO;
|
||||
import com.cool.store.dto.LicenseSyncDTO;
|
||||
import com.cool.store.dto.Preparation.PreparationDTO;
|
||||
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
|
||||
@@ -307,4 +308,30 @@ public class ShopInfoDAO {
|
||||
example.createCriteria().andEqualTo("lineId", lineId).andIn("shopStatus", shopStatus).andEqualTo("deleted", false);
|
||||
return shopInfoMapper.selectByExample(example);
|
||||
}
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2025/7/11
|
||||
* @description:查询建店资料完成并且已经在标品已经建店是门店
|
||||
*/
|
||||
public List<IsCreateStoreDTO> selectIsCreateStore(){
|
||||
return shopInfoMapper.selectIsCreateStore();
|
||||
}
|
||||
/**
|
||||
* @Auther: wangshuo
|
||||
* @Date: 2025/7/11
|
||||
* @description: 查询未建店
|
||||
*/
|
||||
public List<ShopInfoDO> selectByNotCreateStore(List<Long> isCreateShopIds){
|
||||
Example example = new Example(ShopInfoDO.class);
|
||||
example.createCriteria().
|
||||
andNotIn("id", isCreateShopIds).andNotEqualTo("shopStatus", 2).andEqualTo("deleted", false)
|
||||
.andNotEqualTo("regionId",459);
|
||||
return shopInfoMapper.selectByExample(example);
|
||||
}
|
||||
public Integer updateManagerRegionId(List<ShopInfoDO> shopList){
|
||||
if (CollectionUtils.isEmpty(shopList)){
|
||||
return 0;
|
||||
}
|
||||
return shopInfoMapper.updateManagerRegionId(shopList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.RegionNode;
|
||||
import com.cool.store.entity.RegionDO;
|
||||
import com.cool.store.response.RegionResponse;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -110,4 +111,11 @@ public interface RegionMapper {
|
||||
List<RegionDO> getFightRegionByRegionIds(@Param("regionIds") List<String> regionIds);
|
||||
|
||||
RegionDO getRegionInfoBySynDingDeptId(@Param("synDingDeptId") Long synDingDeptId);
|
||||
|
||||
List<RegionResponse> getSubRegionByParentIdAndRegionType( @Param("regionId")Long regionId, @Param("regionType")String regionType);
|
||||
|
||||
List<RegionDO> getRegionByNameListAndIsPath(@Param("regionNameList") List<String> regionNameList);
|
||||
|
||||
|
||||
List<RegionDO> getSubRegionByParentIdsAndRegionType( @Param("parentIds")List<Long> parentIds, @Param("regionType")String regionType);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.FranchiseReportDTO;
|
||||
import com.cool.store.dto.IsCreateStoreDTO;
|
||||
import com.cool.store.dto.LicenseSyncDTO;
|
||||
import com.cool.store.dto.Preparation.PreparationDTO;
|
||||
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
|
||||
@@ -142,4 +143,7 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
|
||||
Integer updateShopCity(@Param("list") List<ShopInfoDO> list);
|
||||
|
||||
List<FranchiseReportDTO> getShopFranchiseReportList(@Param("request") FranchiseReportRequest request);
|
||||
|
||||
List<IsCreateStoreDTO> selectIsCreateStore();
|
||||
Integer updateManagerRegionId(@Param("list") List<ShopInfoDO> shopList);
|
||||
}
|
||||
|
||||
@@ -15,13 +15,16 @@
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="group_name" jdbcType="VARCHAR" property="groupName" />
|
||||
<result column="store_manage_region_id" jdbcType="BIGINT" property="storeManageRegionId" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="queryAllBigRegion" resultType="com.cool.store.dto.region.BigRegionDTO">
|
||||
select DISTINCT
|
||||
region_id as regionId,
|
||||
region_name as regionName
|
||||
region_name as regionName,
|
||||
group_name as groupName,
|
||||
store_manage_region_id as storeManageRegionId
|
||||
FROM `xfsg_big_region`
|
||||
<where>
|
||||
<if test="keyword!=null and keyword !=''">
|
||||
|
||||
@@ -420,6 +420,34 @@
|
||||
</if>
|
||||
|
||||
</select>
|
||||
<select id="getSubRegionByParentIdAndRegionType" resultType="com.cool.store.response.RegionResponse">
|
||||
select
|
||||
<include refid="fields"></include>
|
||||
from region_${enterpriseId}
|
||||
where deleted = 0
|
||||
and parent_id = #{regionId}
|
||||
and region_type = #{regionType}
|
||||
</select>
|
||||
<select id="getRegionByNameListAndIsPath" resultType="com.cool.store.entity.RegionDO">
|
||||
select <include refid="fields"/>
|
||||
from region_${enterpriseId}
|
||||
where deleted = 0
|
||||
<if test="regionNameList != null and regionNameList.size() >0">
|
||||
and name in (
|
||||
<foreach collection="regionNameList" separator="," item="region">#{region}</foreach>
|
||||
)
|
||||
</if>
|
||||
and region_type = 'path'
|
||||
</select>
|
||||
<select id="getSubRegionByParentIdsAndRegionType" resultType="com.cool.store.entity.RegionDO">
|
||||
select
|
||||
<include refid="fields"></include>
|
||||
from region_${enterpriseId}
|
||||
where deleted = 0
|
||||
and parent_id in
|
||||
<foreach collection="parentIds" open="(" close=")" separator="," item="region">#{region}</foreach>
|
||||
and region_type = #{regionType}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -35,6 +35,7 @@
|
||||
<result column="city_code" jdbcType="INTEGER" property="cityCode"/>
|
||||
<result column="district" jdbcType="VARCHAR" property="district"/>
|
||||
<result column="district_code" jdbcType="INTEGER" property="districtCode"/>
|
||||
<result column="manager_region_id" jdbcType="BIGINT" property="managerRegionId"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="allColumn">
|
||||
@@ -43,7 +44,7 @@
|
||||
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,store_type
|
||||
, province,province_code,city,city_code,district,district_code
|
||||
, province,province_code,city,city_code,district,district_code,manager_region_id
|
||||
</sql>
|
||||
|
||||
<insert id="batchAddShop" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
||||
@@ -301,7 +302,8 @@
|
||||
a.join_mode as joinMode,
|
||||
a.franchise_brand as franchiseBrand,
|
||||
a.shop_status as shopStatus,
|
||||
a.detail_address as shopAddress
|
||||
a.detail_address as shopAddress,
|
||||
a.manager_region_id as managerRegionId
|
||||
from xfsg_shop_info a left join xfsg_line_info b on a.line_id = b.id
|
||||
<if test="request.contractStartTime !=null and request.contractEndTime != null">
|
||||
left join xfsg_sign_franchise c on a.id = c.shop_id
|
||||
@@ -541,6 +543,21 @@
|
||||
and xsi.shop_name Like concat("%",#{keyWord},"%") or xsi.store_num Like concat("%",#{keyWord},"%")
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectIsCreateStore" resultType="com.cool.store.dto.IsCreateStoreDTO">
|
||||
|
||||
SELECT a.shop_name as shopName,a.id as shopId, c.id as `pid`,c.name as pidName
|
||||
FROM xfsg_shop_info a
|
||||
LEFT JOIN store_${enterpriseId} b ON a.shop_code = b.store_num
|
||||
LEFT JOIN region_${enterpriseId} c on b.region_id = c.`id`
|
||||
WHERE b.store_num is not null
|
||||
and a.shop_code is not null
|
||||
and a.deleted =0
|
||||
and a.shop_status != 2
|
||||
and a.shop_code != ""
|
||||
and c.deleted = 0
|
||||
and b.is_delete = 'effective'
|
||||
and a.region_id != 459
|
||||
</select>
|
||||
|
||||
<update id="batchUpdate" parameterType="list">
|
||||
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
|
||||
@@ -563,4 +580,9 @@
|
||||
update xfsg_shop_info set shop_name = #{item.shopName}, province =#{item.province}, city = #{item.city}, district=#{item.district}, detail_address = #{item.detailAddress} where id = #{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
<update id="updateManagerRegionId">
|
||||
<foreach collection="list" item="item" separator=";">
|
||||
update xfsg_shop_info set manager_region_id = #{item.managerRegionId} where id = #{item.id}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -76,7 +76,7 @@
|
||||
<select id="getByStoreNum" resultMap="BaseResultMap">
|
||||
select *
|
||||
from store_${enterpriseId}
|
||||
where store_num = #{storeNum}
|
||||
where store_num = #{storeNum} and is_delete = 'effective'
|
||||
</select>
|
||||
|
||||
<select id="listByMobile" resultMap="BaseResultMap">
|
||||
|
||||
Reference in New Issue
Block a user