This commit is contained in:
shuo.wang
2025-03-01 17:16:53 +08:00
parent 3124174b5f
commit ef12033705
9 changed files with 44 additions and 33 deletions

View File

@@ -23,12 +23,10 @@ import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.annotations.Param;
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;
@@ -221,5 +219,4 @@ public class LineInfoDAO {
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

@@ -213,10 +213,10 @@ public class ShopInfoDAO {
return shopInfoMapper.batchUpdate(list);
}
public List<ShopInfoDO> selectInvestmentByLines(List<Long> lineIds) {
public List<ShopInfoDO> selectByLines(List<Long> lineIds,List<Long> regionIds) {
if (CollectionUtils.isEmpty(lineIds)) {
return new ArrayList<>();
}
return shopInfoMapper.selectInvestmentByList(lineIds);
return shopInfoMapper.selectByLines(lineIds,regionIds);
}
}

View File

@@ -118,5 +118,5 @@ public interface ShopInfoMapper extends Mapper<ShopInfoDO> {
Boolean batchUpdate(List<ShopInfoDO> list);
List<ShopInfoDO> selectInvestmentByList (@Param("list") List<Long> list);
List<ShopInfoDO> selectByLines (@Param("list") List<Long> list,@Param("regionIds") List<Long> regionIds);
}

View File

@@ -462,13 +462,14 @@
<select id="partnerList" resultMap="BaseResultMap">
select * from xfsg_line_info a
select distinct a.id from xfsg_line_info a
join xfsg_shop_info c on a.id = c.line_id
<if test="wantShopAreaName != null">
left join xfsg_open_area_info b on a.want_shop_area_id = b.id
</if>
where a.deleted = 0 and a.line_status = 1 and a.join_status in (1,2)
<if test="userId != null and userId != ''">
and a.investment_manager = #{userId}
and (a.investment_manager = #{userId} or c.investment_manager = #{userId} )
</if>
<if test="request.joinStatus != null">
and a.join_status = #{request.joinStatus}
@@ -481,21 +482,33 @@
</if>
<if test="request.queryUserId!=null and request.queryUserId!=''">
<if test="request.queryType != null and request.queryType == 1 ">
and a.investment_manager = #{request.queryUserId}
and( a.investment_manager = #{request.queryUserId} or c.investment_manager = #{request.queryUserId})
</if>
<if test="request.queryType != null and request.queryType == 2 ">
and a.development_manager = #{request.queryUserId}
and( a.development_manager = #{request.queryUserId} or c.development_manager = #{request.queryUserId})
</if>
</if>
<if test="request.regionIds !=null and request.regionIds.size>0">
<foreach collection="request.regionIds" item="regionId" open="and a.region_id in (" close=")" separator=",">
and (
<foreach collection="request.regionIds" item="regionId" open=" a.region_id in (" close=")" separator=",">
#{regionId}
</foreach>
or
<foreach collection="request.regionIds" item="regionId" open=" c.region_id in (" close=")" separator=",">
#{regionId}
</foreach>
)
</if>
<if test="regionIds !=null and regionIds.size>0">
<foreach collection="regionIds" item="regionId" open="and a.region_id in (" close=")" separator=",">
and (
<foreach collection="regionIds" item="regionId" open=" a.region_id in (" close=")" separator=",">
#{regionId}
</foreach>
or
<foreach collection="regionIds" item="regionId" open=" c.region_id in (" close=")" separator=",">
#{regionId}
</foreach>
)
</if>
order by a.id desc
</select>

View File

@@ -346,17 +346,13 @@
select
<include refid="allColumn"/>
from xfsg_shop_info where line_id = #{lineId} and deleted= '0'
and ( 1=1
<if test="userId!=null and userId!=''">
or investment_manager = #{userId}
</if>
<if test="list!=null and list.size>0">
or region_id in
and region_id in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
)
</select>
@@ -389,15 +385,16 @@
</if>
</where>
</select>
<select id="selectInvestmentByList" resultType="com.cool.store.entity.ShopInfoDO">
select line_id as LineId,
investment_manager as investmentManager,
development_manager as developmentManager
<select id="selectByLines" resultType="com.cool.store.entity.ShopInfoDO">
select *
from xfsg_shop_info
where line_id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
<foreach collection="regionIds" item="item" index="index" open="and region_id in (" separator="," close=")">
#{item}
</foreach>
</select>
<update id="batchUpdate" parameterType="list">