Merge remote-tracking branch 'origin/master' into cc_20250903_big_screen
# Conflicts: # coolstore-partner-web/src/main/java/com/cool/store/config/SignValidateFilter.java
This commit is contained in:
@@ -72,8 +72,8 @@ public class StoreDao {
|
||||
}
|
||||
|
||||
|
||||
public List<StoreDO> list() {
|
||||
return storeMapper.list();
|
||||
public List<StoreDO> list(Integer isIot) {
|
||||
return storeMapper.list(isIot);
|
||||
}
|
||||
|
||||
public List<StoreDO> getStoreNumByStoreCodes(List<String> storeCodeIds) {
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.cool.store.dao.store;
|
||||
|
||||
import cn.hutool.core.collection.CollStreamUtil;
|
||||
import com.cool.store.entity.store.StoreMasterSignerInfoDO;
|
||||
import com.cool.store.mapper.store.StoreMasterSignerInfoMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 门店签约信息DAO
|
||||
* </p>
|
||||
*
|
||||
* @author wangff
|
||||
* @since 2025/9/23
|
||||
*/
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class StoreMasterSignerInfoDAO {
|
||||
private final StoreMasterSignerInfoMapper storeMasterSignerInfoMapper;
|
||||
|
||||
/**
|
||||
* 获取门店签约信息Map
|
||||
*/
|
||||
public Map<String, StoreMasterSignerInfoDO> getSignerMapByStoreIds(List<String> storeIds) {
|
||||
if (CollectionUtils.isEmpty(storeIds)) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
List<StoreMasterSignerInfoDO> list = storeMasterSignerInfoMapper.selectByStoreIds(storeIds);
|
||||
return CollStreamUtil.toMap(list, StoreMasterSignerInfoDO::getStoreId, v -> v);
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ public interface StoreMapper {
|
||||
* 分页查询门店数据
|
||||
* @return
|
||||
*/
|
||||
List<StoreDO> list();
|
||||
List<StoreDO> list(@Param("isIot") Integer isIot);
|
||||
|
||||
List<StoreAreaDTO> getStoreAreaList( @Param("storeIds") List<String> storeIds);
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.cool.store.mapper.store;
|
||||
|
||||
|
||||
import com.cool.store.entity.store.StoreMasterSignerInfoDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2025-09-23 11:32
|
||||
*/
|
||||
public interface StoreMasterSignerInfoMapper {
|
||||
|
||||
/**
|
||||
* 根据门店id查询签约信息
|
||||
*/
|
||||
List<StoreMasterSignerInfoDO> selectByStoreIds(@Param("storeIds") List<String> storeIds);
|
||||
}
|
||||
@@ -44,6 +44,12 @@
|
||||
<result column="join_brand" property="joinBrand" jdbcType="TINYINT"/>
|
||||
<result column="store_type" property="storeType" jdbcType="TINYINT"/>
|
||||
<result column="mini_program_order_store_name" property="miniProgramOrderStoreName"/>
|
||||
<result column="is_iot" property="isIot" jdbcType="TINYINT"/>
|
||||
<result column="addressee_name" property="addresseeName" jdbcType="VARCHAR"/>
|
||||
<result column="addressee_mobile" property="addresseeMobile" jdbcType="VARCHAR"/>
|
||||
<result column="addressee_area" property="addresseeArea" jdbcType="VARCHAR"/>
|
||||
<result column="addressee_address" property="addresseeAddress" jdbcType="VARCHAR"/>
|
||||
<result column="branch" property="branch" jdbcType="TINYINT"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getByStoreId" resultMap="BaseResultMap">
|
||||
@@ -88,6 +94,15 @@
|
||||
</select>
|
||||
|
||||
<select id="listByMobile" resultMap="BaseResultMap">
|
||||
select a.*
|
||||
from store_${enterpriseId} a left join store_master_signer_info_${enterpriseId} b on a.store_id = b.store_id
|
||||
<where>
|
||||
and a.is_delete = 'effective'
|
||||
<if test="mobile!=null and mobile !=''">
|
||||
and ( b.signer1_mobile = #{mobile} or b.signer2_mobile = #{mobile})
|
||||
</if>
|
||||
</where>
|
||||
union
|
||||
select *
|
||||
from store_${enterpriseId}
|
||||
<where>
|
||||
@@ -99,37 +114,65 @@
|
||||
</select>
|
||||
|
||||
<select id="getSubStoreByRegionIdsAndMobile" resultType="com.cool.store.response.MiniShopsResponse">
|
||||
select store_id as storeId, store_name as shopName, store_num as shopCode, store_address as detailAddress
|
||||
from store_${enterpriseId}
|
||||
where is_delete = 'effective'
|
||||
<if test="storeName!=null and storeName!=''">
|
||||
and store_name like concat('%', #{storeName}, '%')
|
||||
</if>
|
||||
<if test="storeNum!=null and storeNum!=''">
|
||||
and store_num = #{storeNum}
|
||||
</if>
|
||||
and (
|
||||
<if test="regionIdList != null and regionIdList.size >0 ">
|
||||
<foreach collection="regionIdList" item="regionId" separator=" or " open=" (" close=" )">
|
||||
region_path like concat('%/', #{regionId}, '/%')
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="mobile!=null and mobile !=''">
|
||||
<choose>
|
||||
<when test="regionIdList != null and regionIdList.size >0 ">
|
||||
or `extend_field` like concat('%', #{mobile}, '%')
|
||||
</when>
|
||||
<otherwise>
|
||||
`extend_field` like concat('%', #{mobile}, '%')
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
)
|
||||
<choose>
|
||||
<!-- 情况1:regionIdList不为空,使用UNION优化 -->
|
||||
<when test="regionIdList != null and regionIdList.size > 0">
|
||||
SELECT store_id as storeId, store_name as shopName, store_num as shopCode, store_address as detailAddress
|
||||
FROM store_${enterpriseId} a
|
||||
WHERE a.is_delete = 'effective' and a.store_status != 'closed'
|
||||
<if test="storeName!=null and storeName!=''">
|
||||
AND a.store_name LIKE CONCAT('%', #{storeName}, '%')
|
||||
</if>
|
||||
<if test="storeNum!=null and storeNum!=''">
|
||||
AND a.store_num = #{storeNum}
|
||||
</if>
|
||||
AND (
|
||||
<foreach collection="regionIdList" item="regionId" separator=" OR ">
|
||||
a.region_path LIKE CONCAT('%/', #{regionId}, '/%')
|
||||
</foreach>
|
||||
)
|
||||
|
||||
UNION
|
||||
|
||||
SELECT a.store_id as storeId, a.store_name as shopName, a.store_num as shopCode, a.store_address as detailAddress
|
||||
FROM store_${enterpriseId} a
|
||||
INNER JOIN store_master_signer_info_${enterpriseId} b ON a.store_id = b.store_id
|
||||
WHERE a.is_delete = 'effective' and a.store_status != 'closed'
|
||||
<if test="storeName!=null and storeName!=''">
|
||||
AND a.store_name LIKE CONCAT('%', #{storeName}, '%')
|
||||
</if>
|
||||
<if test="storeNum!=null and storeNum!=''">
|
||||
AND a.store_num = #{storeNum}
|
||||
</if>
|
||||
AND (b.signer1_mobile = #{mobile} OR b.signer2_mobile = #{mobile})
|
||||
</when>
|
||||
|
||||
<!-- 情况2:regionIdList为空,直接查询关联表 -->
|
||||
<otherwise>
|
||||
SELECT a.store_id as storeId, a.store_name as shopName, a.store_num as shopCode, a.store_address as detailAddress
|
||||
FROM store_${enterpriseId} a
|
||||
INNER JOIN store_master_signer_info_${enterpriseId} b ON a.store_id = b.store_id
|
||||
WHERE a.is_delete = 'effective' and a.store_status != 'closed'
|
||||
<if test="storeName!=null and storeName!=''">
|
||||
AND a.store_name LIKE CONCAT('%', #{storeName}, '%')
|
||||
</if>
|
||||
<if test="storeNum!=null and storeNum!=''">
|
||||
AND a.store_num = #{storeNum}
|
||||
</if>
|
||||
AND (b.signer1_mobile = #{mobile} OR b.signer2_mobile = #{mobile})
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="list" resultMap="BaseResultMap">
|
||||
select *
|
||||
from store_${enterpriseId} where is_delete = 'effective' order by id asc
|
||||
from store_${enterpriseId}
|
||||
where is_delete = 'effective'
|
||||
<if test="isIot != null">
|
||||
AND is_iot = #{isIot}
|
||||
</if>
|
||||
order by id asc
|
||||
</select>
|
||||
|
||||
<select id="getStoreAreaList" resultType="com.cool.store.dto.store.StoreAreaDTO">
|
||||
|
||||
@@ -208,7 +208,8 @@
|
||||
b.deadline as deadline,
|
||||
b.publisher_user_id as publishUserId,
|
||||
b.message_content as messageContent,
|
||||
b.process_type as processType
|
||||
b.process_type as processType,
|
||||
b.handle_keyword as handleKeyword
|
||||
from
|
||||
zxjp_store_message a
|
||||
left join zxjp_message_template b on a.message_template_id = b.id
|
||||
|
||||
@@ -397,7 +397,7 @@
|
||||
and eu.active = true
|
||||
-- and sr.source = 'create'
|
||||
<if test="positionType != null and positionType != '' ">
|
||||
and sr.position_type = #{positionType}
|
||||
and (sr.position_type = #{positionType} or sr.id in (180000000,120000000,40000000))
|
||||
</if>
|
||||
and eu.user_status = '1'
|
||||
</select>
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="positionType!=null and positionType!=''">
|
||||
and b.position_type =#{positionType}
|
||||
and (b.position_type =#{positionType} or b.id in (180000000,120000000,40000000) )
|
||||
</if>
|
||||
<if test="notRoleAuth!=null and notRoleAuth!=''">
|
||||
and b.role_auth !=#{notRoleAuth}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?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.store.StoreMasterSignerInfoMapper">
|
||||
<resultMap id="BaseResultMap" type="com.cool.store.entity.store.StoreMasterSignerInfoDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="store_id" jdbcType="VARCHAR" property="storeId" />
|
||||
<result column="signer1_name" jdbcType="VARCHAR" property="signer1Name" />
|
||||
<result column="signer1_mobile" jdbcType="VARCHAR" property="signer1Mobile" />
|
||||
<result column="signer1_id_card_no" jdbcType="VARCHAR" property="signer1IdCardNo" />
|
||||
<result column="signer1_id_card_front" jdbcType="VARCHAR" property="signer1IdCardFront" />
|
||||
<result column="signer1_id_card_back" jdbcType="VARCHAR" property="signer1IdCardBack" />
|
||||
<result column="signer2_name" jdbcType="VARCHAR" property="signer2Name" />
|
||||
<result column="signer2_mobile" jdbcType="VARCHAR" property="signer2Mobile" />
|
||||
<result column="signer2_id_card_no" jdbcType="VARCHAR" property="signer2IdCardNo" />
|
||||
<result column="signer2_id_card_front" jdbcType="VARCHAR" property="signer2IdCardFront" />
|
||||
<result column="signer2_id_card_back" jdbcType="VARCHAR" property="signer2IdCardBack" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, store_id, signer1_name, signer1_mobile, signer1_id_card_no, signer1_id_card_front,
|
||||
signer1_id_card_back, signer2_name, signer2_mobile, signer2_id_card_no, signer2_id_card_front,
|
||||
signer2_id_card_back, create_time, update_time
|
||||
</sql>
|
||||
|
||||
<select id="selectByStoreIds" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from store_master_signer_info_${enterpriseId}
|
||||
where store_id in
|
||||
<foreach item="storeId" collection="storeIds" open="(" separator="," close=")">
|
||||
#{storeId}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user