feat:门店人员

This commit is contained in:
苏竹红
2025-07-22 15:57:39 +08:00
parent 2530881858
commit 6fad009386
13 changed files with 421 additions and 46 deletions

View File

@@ -1,5 +1,6 @@
package com.cool.store.mapper;
import com.cool.store.dto.store.StoreAreaDTO;
import com.cool.store.entity.StoreDO;
import com.cool.store.response.MiniShopsResponse;
import org.apache.ibatis.annotations.Mapper;
@@ -40,4 +41,6 @@ public interface StoreMapper {
*/
List<StoreDO> list();
List<StoreAreaDTO> getStoreAreaList( @Param("storeIds") List<String> storeIds);
}

View File

@@ -1,6 +1,7 @@
package com.cool.store.mapper;
import com.cool.store.dto.UserRoleDTO;
import com.cool.store.dto.store.StoreUserDTO;
import com.cool.store.entity.EnterpriseUserRole;
import com.cool.store.entity.SysRoleDO;
import com.cool.store.vo.SysRoleVO;
@@ -139,4 +140,8 @@ public interface SysRoleMapper {
List<SysRoleDO> getRolesByNamesAndSource(@Param("roleNames") List<String> roleNames, @Param("source") String source);
List<SysRoleDO> getXFStoreManager(@Param("roleNames") List<String> roleNames);
List<StoreUserDTO> userAndPositionList(@Param("userIdList") List<String> userIdList,
@Param("userName") String userName,
@Param("positionType") String positionType);
}

View File

@@ -124,4 +124,26 @@
from store_${enterpriseId} where is_delete = 'effective' order by id asc
</select>
<select id="getStoreAreaList" resultType="com.cool.store.dto.store.StoreAreaDTO">
select
a.store_name as storeName,
a.store_id as storeId,
a.region_path as regionPath,
a.region_id as regionId,
a.region_id as areaId,
a.store_status as storeStatus
FROM store_${enterpriseId} a
<where>
a.is_delete='effective'
<if test="storeIds!=null and storeIds.size>0">
<foreach collection="storeIds" item="storeId" index="index" separator="," open="and a.store_id in("
close=")">
#{storeId}
</foreach>
</if>
</where>
</select>
</mapper>

View File

@@ -376,4 +376,30 @@
</select>
<select id="userAndPositionList" resultType="com.cool.store.dto.store.StoreUserDTO">
SELECT
eu.user_id userId,
eu.`name` userName,
IFNULL(eu.avatar, eu.face_url) avatar,
eu.mobile,
sr.id positionId,
sr.role_name positionName
from enterprise_user_${enterpriseId} eu
left join enterprise_user_role_${enterpriseId} eur USING(user_id)
left join sys_role_${enterpriseId} sr on eur.role_id = sr.id
where eu.user_id in
<foreach collection="userIdList" item="userId" open="(" separator="," close=")">
#{userId}
</foreach>
<if test="userName != null and userName != '' ">
and eu.name like concat('%', #{userName}, '%')
</if>
and eu.active = true
-- and sr.source = 'create'
<if test="positionType != null and positionType != '' ">
and sr.position_type = #{positionType}
</if>
and eu.user_status = '1'
</select>
</mapper>