This commit is contained in:
zhangchenbiao
2023-05-31 15:36:45 +08:00
parent 39cef07e6a
commit b00a91d060
12 changed files with 1424 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
package com.cool.store.mapper;
import com.cool.store.entity.EnterpriseUserGroupDO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author zhangchenbiao
* @date 2023-05-31 02:43
*/
public interface EnterpriseUserGroupMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-31 02:43
*/
int insertSelective(@Param("record") EnterpriseUserGroupDO record, @Param("enterpriseId") String enterpriseId);
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-31 02:43
*/
int updateByPrimaryKeySelective(@Param("record") EnterpriseUserGroupDO record, @Param("enterpriseId") String enterpriseId);
int countByGroupName(@Param("enterpriseId") String enterpriseId, @Param("groupName") String groupName, @Param("groupId") String groupId);
void deleteByGroupIdList(@Param("enterpriseId") String enterpriseId, @Param("groupIdList") List<String> groupIdList);
List<EnterpriseUserGroupDO> listUserGroup(@Param("enterpriseId")String enterpriseId, @Param("groupName")String groupName);
EnterpriseUserGroupDO getByGroupId(@Param("enterpriseId")String enterpriseId, @Param("groupId")String groupId);
List<EnterpriseUserGroupDO> listByGroupIdList(@Param("enterpriseId") String enterpriseId, @Param("groupIdList") List<String> groupIdList);
int updateByGroupId(@Param("record")EnterpriseUserGroupDO record, @Param("enterpriseId") String enterpriseId);
}

View File

@@ -0,0 +1,41 @@
package com.cool.store.mapper;
import com.cool.store.entity.EnterpriseUserGroupMappingDO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author zhangchenbiao
* @date 2023-05-31 02:43
*/
public interface EnterpriseUserGroupMappingMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-31 02:43
*/
int insertSelective(@Param("record") EnterpriseUserGroupMappingDO record, @Param("enterpriseId") String enterpriseId);
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-31 02:43
*/
int updateByPrimaryKeySelective(@Param("record") EnterpriseUserGroupMappingDO record, @Param("enterpriseId") String enterpriseId);
void deleteUserGroupMappingByGroupId(@Param("enterpriseId")String enterpriseId, @Param("groupId") String groupId);
Integer batchInsertMapping(@Param("enterpriseId") String enterpriseId, @Param("userIdList") List<String> userIdList, @Param("groupId") String groupId);
Integer deleteMappingByGroupIdList(@Param("enterpriseId") String enterpriseId, @Param("groupId") String groupId, @Param("userIdList") List<String> userIdList);
Integer deleteMappingByUserIdList(@Param("enterpriseId") String enterpriseId, @Param("userIdList") List<String> userIdList);
List<EnterpriseUserGroupMappingDO> listByGroupIdList(@Param("enterpriseId") String enterpriseId, @Param("groupIdList") List<String> groupIdList);
List<EnterpriseUserGroupMappingDO> listByUserIdList(@Param("enterpriseId") String enterpriseId, @Param("userIdList") List<String> userIdList);
void batchInsertOrUpdateUserGroupMapping(@Param("enterpriseId") String enterpriseId,@Param("userGroupMappingList") List<EnterpriseUserGroupMappingDO> userGroupMappingList);
}

View File

@@ -0,0 +1,38 @@
package com.cool.store.mapper;
import com.cool.store.dto.store.StoreAreaDTO;
import com.cool.store.entity.StoreDO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author zhangchenbiao
* @date 2023-05-31 11:51
*/
public interface StoreMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-31 11:51
*/
int insertSelective(@Param("record") StoreDO record, @Param("enterpriseId") String enterpriseId);
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-31 11:51
*/
int updateByPrimaryKeySelective(@Param("record") StoreDO record, @Param("enterpriseId") String enterpriseId);
List<StoreAreaDTO> listStoreByRegionIdList(@Param("eid") String eid, @Param("regionIdList") List<String> regionIdList);
List<StoreDO> getStoreListByStoreIds(@Param("enterpriseId") String enterpriseId, @Param("storeIdList") List<String> storeIdList);
List<StoreAreaDTO> listStoreByRegionIdListNotChild(@Param("eid") String eid, @Param("regionIdList") List<String> regionIdList);
Integer countStore(@Param("eid") String eid);
List<String> listStoreIdList(@Param("eid") String eid);
}

View File

@@ -0,0 +1,43 @@
package com.cool.store.mapper;
import com.cool.store.entity.SubordinateMappingDO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author zhangchenbiao
* @date 2023-05-31 02:27
*/
public interface SubordinateMappingMapper {
/**
*
* 默认插入方法,只会给有值的字段赋值
* 会对传进来的字段做判空处理如果字段为空则使用数据库默认字段或者null
* dateTime:2023-05-31 02:27
*/
int insertSelective(@Param("record") SubordinateMappingDO record, @Param("enterpriseId") String enterpriseId);
/**
*
* 默认更新方法根据主键更新不会把null值更新到数据库避免覆盖之前有值的
* dateTime:2023-05-31 02:27
*/
int updateByPrimaryKeySelective(@Param("record") SubordinateMappingDO record, @Param("enterpriseId") String enterpriseId);
/**
* 根据用户ids查询直属上级列表
* @param enterpriseId
* @param userIds
* @return
*/
List<SubordinateMappingDO> selectByUserIds(@Param("enterpriseId") String enterpriseId, @Param("userIds") List<String> userIds);
/**
* 批量新增用户的下属部门
* @param enterpriseId
* @param subordinateMappingDOS
*/
void batchInsertSubordinateMapping(@Param("enterpriseId") String enterpriseId,@Param("subordinateMappingDOS") List<SubordinateMappingDO> subordinateMappingDOS);
}

View File

@@ -0,0 +1,184 @@
<?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.EnterpriseUserGroupMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.EnterpriseUserGroupDO">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="group_id" jdbcType="VARCHAR" property="groupId"/>
<result column="group_name" jdbcType="VARCHAR" property="groupName"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId"/>
<result column="deleted" jdbcType="BIT" property="deleted"/>
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.entity.EnterpriseUserGroupDO">
<result column="common_edit_userids" jdbcType="LONGVARCHAR" property="commonEditUserids"/>
</resultMap>
<sql id="Base_Column_List">
id, group_id, group_name, create_time, create_user_id, update_time, update_user_id,
deleted
</sql>
<sql id="Blob_Column_List">
common_edit_userids
</sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into enterprise_user_group_${enterpriseId}
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.groupId != null">
group_id,
</if>
<if test="record.groupName != null">
group_name,
</if>
<if test="record.createTime != null">
create_time,
</if>
<if test="record.createUserId != null">
create_user_id,
</if>
<if test="record.updateTime != null">
update_time,
</if>
<if test="record.updateUserId != null">
update_user_id,
</if>
<if test="record.deleted != null">
deleted,
</if>
<if test="record.commonEditUserids != null">
common_edit_userids,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.groupId != null">
#{record.groupId},
</if>
<if test="record.groupName != null">
#{record.groupName},
</if>
<if test="record.createTime != null">
#{record.createTime},
</if>
<if test="record.createUserId != null">
#{record.createUserId},
</if>
<if test="record.updateTime != null">
#{record.updateTime},
</if>
<if test="record.updateUserId != null">
#{record.updateUserId},
</if>
<if test="record.deleted != null">
#{record.deleted},
</if>
<if test="record.commonEditUserids != null">
#{record.commonEditUserids},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update enterprise_user_group_${enterpriseId}
<set>
<if test="record.groupId != null">
group_id = #{record.groupId},
</if>
<if test="record.groupName != null">
group_name = #{record.groupName},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.createUserId != null">
create_user_id = #{record.createUserId},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
<if test="record.updateUserId != null">
update_user_id = #{record.updateUserId},
</if>
<if test="record.deleted != null">
deleted = #{record.deleted},
</if>
<if test="record.commonEditUserids != null">
common_edit_userids = #{record.commonEditUserids},
</if>
</set>
where id = #{record.id}
</update>
<select id="countByGroupName" resultType="int">
select count(1)
from enterprise_user_group_${enterpriseId}
where group_name = #{groupName}
<if test="groupId != null">
and group_id != #{groupId}
</if>
and deleted = 0
</select>
<delete id="deleteByGroupIdList">
delete from enterprise_user_group_${enterpriseId}
where group_id in
<foreach collection="groupIdList" item="groupId" open="(" separator="," close=")">
#{groupId}
</foreach>
</delete>
<select id="listUserGroup" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from enterprise_user_group_${enterpriseId}
<if test="groupName != null and groupName !=''">
where group_name like concat('%',#{groupName},'%')
</if>
</select>
<select id="getByGroupId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from enterprise_user_group_${enterpriseId}
where group_id = #{groupId}
</select>
<select id="listByGroupIdList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from enterprise_user_group_${enterpriseId}
where group_id in
<foreach collection="groupIdList" item="groupId" open="(" separator="," close=")">
#{groupId}
</foreach>
</select>
<update id="updateByGroupId">
update enterprise_user_group_${enterpriseId}
<set>
<if test="record.groupId != null">
group_id = #{record.groupId},
</if>
<if test="record.groupName != null">
group_name = #{record.groupName},
</if>
<if test="record.commonEditUserids != null">
common_edit_userids = #{record.commonEditUserids},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.createUserId != null">
create_user_id = #{record.createUserId},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
<if test="record.updateUserId != null">
update_user_id = #{record.updateUserId},
</if>
<if test="record.deleted != null">
deleted = #{record.deleted},
</if>
</set>
where group_id = #{record.groupId}
</update>
</mapper>

View File

@@ -0,0 +1,181 @@
<?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.EnterpriseUserGroupMappingMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.EnterpriseUserGroupMappingDO">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
<result column="group_id" jdbcType="VARCHAR" property="groupId"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="create_user_id" jdbcType="VARCHAR" property="createUserId"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="update_user_id" jdbcType="VARCHAR" property="updateUserId"/>
<result column="deleted" jdbcType="BIT" property="deleted"/>
</resultMap>
<sql id="Base_Column_List">
id, user_id, group_id, create_time, create_user_id, update_time, update_user_id,
deleted
</sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into enterprise_user_group_mapping_${enterpriseId}
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.userId != null">
user_id,
</if>
<if test="record.groupId != null">
group_id,
</if>
<if test="record.createTime != null">
create_time,
</if>
<if test="record.createUserId != null">
create_user_id,
</if>
<if test="record.updateTime != null">
update_time,
</if>
<if test="record.updateUserId != null">
update_user_id,
</if>
<if test="record.deleted != null">
deleted,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.userId != null">
#{record.userId},
</if>
<if test="record.groupId != null">
#{record.groupId},
</if>
<if test="record.createTime != null">
#{record.createTime},
</if>
<if test="record.createUserId != null">
#{record.createUserId},
</if>
<if test="record.updateTime != null">
#{record.updateTime},
</if>
<if test="record.updateUserId != null">
#{record.updateUserId},
</if>
<if test="record.deleted != null">
#{record.deleted},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update enterprise_user_group_mapping_${enterpriseId}
<set>
<if test="record.userId != null">
user_id = #{record.userId},
</if>
<if test="record.groupId != null">
group_id = #{record.groupId},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.createUserId != null">
create_user_id = #{record.createUserId},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
<if test="record.updateUserId != null">
update_user_id = #{record.updateUserId},
</if>
<if test="record.deleted != null">
deleted = #{record.deleted},
</if>
</set>
where id = #{record.id}
</update>
<delete id="deleteUserGroupMappingByGroupId">
delete from enterprise_user_group_mapping_${enterpriseId}
where group_id in (#{groupId})
</delete>
<insert id="batchInsertMapping">
insert into enterprise_user_group_mapping_${enterpriseId}
(
group_id,
user_id
)
values
<foreach collection="userIdList" separator="," item="userId">
(
#{groupId},
#{userId}
)
</foreach>
</insert>
<delete id="deleteMappingByGroupIdList">
delete from enterprise_user_group_mapping_${enterpriseId}
where group_id = #{groupId}
<if test="userIdList != null and userIdList.size > 0">
<foreach collection="userIdList" open="and user_id in (" close=")" separator="," item="userId">
#{userId}
</foreach>
</if>
</delete>
<delete id="deleteMappingByUserIdList">
delete from enterprise_user_group_mapping_${enterpriseId}
where user_id in
<if test="userIdList != null and userIdList.size > 0">
<foreach collection="userIdList" open="(" close=")" separator="," item="userId">
#{userId}
</foreach>
</if>
</delete>
<select id="listByGroupIdList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from enterprise_user_group_mapping_${enterpriseId}
where group_id in (
<foreach collection="groupIdList" item="groupId" separator=",">
#{groupId}
</foreach>
)
</select>
<select id="listByUserIdList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from enterprise_user_group_mapping_${enterpriseId}
where user_id in (
<foreach collection="userIdList" item="userId" separator=",">
#{userId}
</foreach>
)
</select>
<insert id="batchInsertOrUpdateUserGroupMapping">
insert into enterprise_user_group_mapping_${enterpriseId}
(
user_id,
group_id,
create_time,
create_user_id,
update_time,
update_user_id
)
values
<foreach collection="userGroupMappingList" item="entity" separator=",">
(
#{entity.userId},
#{entity.groupId},
now(),
#{entity.createUserId},
now(),
#{entity.updateUserId}
)
</foreach>
ON DUPLICATE KEY UPDATE
update_time = now()
</insert>
</mapper>

View File

@@ -0,0 +1,454 @@
<?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.StoreMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.StoreDO">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="store_id" jdbcType="VARCHAR" property="storeId"/>
<result column="store_name" jdbcType="VARCHAR" property="storeName"/>
<result column="store_num" jdbcType="VARCHAR" property="storeNum"/>
<result column="avatar" jdbcType="VARCHAR" property="avatar"/>
<result column="ding_id" jdbcType="VARCHAR" property="dingId"/>
<result column="region_id" jdbcType="BIGINT" property="regionId"/>
<result column="province" jdbcType="VARCHAR" property="province"/>
<result column="city" jdbcType="VARCHAR" property="city"/>
<result column="county" jdbcType="VARCHAR" property="county"/>
<result column="store_address" jdbcType="VARCHAR" property="storeAddress"/>
<result column="location_address" jdbcType="VARCHAR" property="locationAddress"/>
<result column="is_lock" jdbcType="CHAR" property="isLock"/>
<result column="longitude_latitude" jdbcType="VARCHAR" property="longitudeLatitude"/>
<result column="longitude" jdbcType="VARCHAR" property="longitude"/>
<result column="latitude" jdbcType="VARCHAR" property="latitude"/>
<result column="is_delete" jdbcType="CHAR" property="isDelete"/>
<result column="telephone" jdbcType="VARCHAR" property="telephone"/>
<result column="business_hours" jdbcType="VARCHAR" property="businessHours"/>
<result column="store_acreage" jdbcType="VARCHAR" property="storeAcreage"/>
<result column="store_bandwidth" jdbcType="VARCHAR" property="storeBandwidth"/>
<result column="create_time" jdbcType="BIGINT" property="createTime"/>
<result column="create_name" jdbcType="VARCHAR" property="createName"/>
<result column="create_user" jdbcType="VARCHAR" property="createUser"/>
<result column="update_time" jdbcType="BIGINT" property="updateTime"/>
<result column="update_name" jdbcType="VARCHAR" property="updateName"/>
<result column="update_user" jdbcType="VARCHAR" property="updateUser"/>
<result column="aliyun_corp_id" jdbcType="VARCHAR" property="aliyunCorpId"/>
<result column="source" jdbcType="VARCHAR" property="source"/>
<result column="vds_corp_id" jdbcType="VARCHAR" property="vdsCorpId"/>
<result column="syn_ding_dept_id" jdbcType="VARCHAR" property="synDingDeptId"/>
<result column="region_path" jdbcType="VARCHAR" property="regionPath"/>
<result column="has_camera" jdbcType="BIT" property="hasCamera"/>
<result column="store_status" jdbcType="CHAR" property="storeStatus"/>
<result column="third_dept_id" jdbcType="VARCHAR" property="thirdDeptId"/>
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.cool.store.entity.StoreDO">
<result column="remark" jdbcType="LONGVARCHAR" property="remark"/>
<result column="extend_field" jdbcType="LONGVARCHAR" property="extendField"/>
<result column="address_point" jdbcType="BINARY" property="addressPoint"/>
</resultMap>
<sql id="Base_Column_List">
id, store_id, store_name, store_num, avatar, ding_id, region_id, province, city,
county, store_address, location_address, is_lock, longitude_latitude, longitude,
latitude, is_delete, telephone, business_hours, store_acreage, store_bandwidth, create_time,
create_name, create_user, update_time, update_name, update_user, aliyun_corp_id,
source, vds_corp_id, syn_ding_dept_id, region_path, has_camera, store_status, third_dept_id
</sql>
<sql id="Blob_Column_List">
remark, extend_field, address_point
</sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into store_${enterpriseId}
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.storeId != null">
store_id,
</if>
<if test="record.storeName != null">
store_name,
</if>
<if test="record.storeNum != null">
store_num,
</if>
<if test="record.avatar != null">
avatar,
</if>
<if test="record.dingId != null">
ding_id,
</if>
<if test="record.regionId != null">
region_id,
</if>
<if test="record.province != null">
province,
</if>
<if test="record.city != null">
city,
</if>
<if test="record.county != null">
county,
</if>
<if test="record.storeAddress != null">
store_address,
</if>
<if test="record.locationAddress != null">
location_address,
</if>
<if test="record.isLock != null">
is_lock,
</if>
<if test="record.longitudeLatitude != null">
longitude_latitude,
</if>
<if test="record.longitude != null">
longitude,
</if>
<if test="record.latitude != null">
latitude,
</if>
<if test="record.isDelete != null">
is_delete,
</if>
<if test="record.telephone != null">
telephone,
</if>
<if test="record.businessHours != null">
business_hours,
</if>
<if test="record.storeAcreage != null">
store_acreage,
</if>
<if test="record.storeBandwidth != null">
store_bandwidth,
</if>
<if test="record.createTime != null">
create_time,
</if>
<if test="record.createName != null">
create_name,
</if>
<if test="record.createUser != null">
create_user,
</if>
<if test="record.updateTime != null">
update_time,
</if>
<if test="record.updateName != null">
update_name,
</if>
<if test="record.updateUser != null">
update_user,
</if>
<if test="record.aliyunCorpId != null">
aliyun_corp_id,
</if>
<if test="record.source != null">
source,
</if>
<if test="record.vdsCorpId != null">
vds_corp_id,
</if>
<if test="record.synDingDeptId != null">
syn_ding_dept_id,
</if>
<if test="record.regionPath != null">
region_path,
</if>
<if test="record.hasCamera != null">
has_camera,
</if>
<if test="record.storeStatus != null">
store_status,
</if>
<if test="record.thirdDeptId != null">
third_dept_id,
</if>
<if test="record.remark != null">
remark,
</if>
<if test="record.extendField != null">
extend_field,
</if>
<if test="record.addressPoint != null">
address_point,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.storeId != null">
#{record.storeId},
</if>
<if test="record.storeName != null">
#{record.storeName},
</if>
<if test="record.storeNum != null">
#{record.storeNum},
</if>
<if test="record.avatar != null">
#{record.avatar},
</if>
<if test="record.dingId != null">
#{record.dingId},
</if>
<if test="record.regionId != null">
#{record.regionId},
</if>
<if test="record.province != null">
#{record.province},
</if>
<if test="record.city != null">
#{record.city},
</if>
<if test="record.county != null">
#{record.county},
</if>
<if test="record.storeAddress != null">
#{record.storeAddress},
</if>
<if test="record.locationAddress != null">
#{record.locationAddress},
</if>
<if test="record.isLock != null">
#{record.isLock},
</if>
<if test="record.longitudeLatitude != null">
#{record.longitudeLatitude},
</if>
<if test="record.longitude != null">
#{record.longitude},
</if>
<if test="record.latitude != null">
#{record.latitude},
</if>
<if test="record.isDelete != null">
#{record.isDelete},
</if>
<if test="record.telephone != null">
#{record.telephone},
</if>
<if test="record.businessHours != null">
#{record.businessHours},
</if>
<if test="record.storeAcreage != null">
#{record.storeAcreage},
</if>
<if test="record.storeBandwidth != null">
#{record.storeBandwidth},
</if>
<if test="record.createTime != null">
#{record.createTime},
</if>
<if test="record.createName != null">
#{record.createName},
</if>
<if test="record.createUser != null">
#{record.createUser},
</if>
<if test="record.updateTime != null">
#{record.updateTime},
</if>
<if test="record.updateName != null">
#{record.updateName},
</if>
<if test="record.updateUser != null">
#{record.updateUser},
</if>
<if test="record.aliyunCorpId != null">
#{record.aliyunCorpId},
</if>
<if test="record.source != null">
#{record.source},
</if>
<if test="record.vdsCorpId != null">
#{record.vdsCorpId},
</if>
<if test="record.synDingDeptId != null">
#{record.synDingDeptId},
</if>
<if test="record.regionPath != null">
#{record.regionPath},
</if>
<if test="record.hasCamera != null">
#{record.hasCamera},
</if>
<if test="record.storeStatus != null">
#{record.storeStatus},
</if>
<if test="record.thirdDeptId != null">
#{record.thirdDeptId},
</if>
<if test="record.remark != null">
#{record.remark},
</if>
<if test="record.extendField != null">
#{record.extendField},
</if>
<if test="record.addressPoint != null">
#{record.addressPoint},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update store_${enterpriseId}
<set>
<if test="record.storeId != null">
store_id = #{record.storeId},
</if>
<if test="record.storeName != null">
store_name = #{record.storeName},
</if>
<if test="record.storeNum != null">
store_num = #{record.storeNum},
</if>
<if test="record.avatar != null">
avatar = #{record.avatar},
</if>
<if test="record.dingId != null">
ding_id = #{record.dingId},
</if>
<if test="record.regionId != null">
region_id = #{record.regionId},
</if>
<if test="record.province != null">
province = #{record.province},
</if>
<if test="record.city != null">
city = #{record.city},
</if>
<if test="record.county != null">
county = #{record.county},
</if>
<if test="record.storeAddress != null">
store_address = #{record.storeAddress},
</if>
<if test="record.locationAddress != null">
location_address = #{record.locationAddress},
</if>
<if test="record.isLock != null">
is_lock = #{record.isLock},
</if>
<if test="record.longitudeLatitude != null">
longitude_latitude = #{record.longitudeLatitude},
</if>
<if test="record.longitude != null">
longitude = #{record.longitude},
</if>
<if test="record.latitude != null">
latitude = #{record.latitude},
</if>
<if test="record.isDelete != null">
is_delete = #{record.isDelete},
</if>
<if test="record.telephone != null">
telephone = #{record.telephone},
</if>
<if test="record.businessHours != null">
business_hours = #{record.businessHours},
</if>
<if test="record.storeAcreage != null">
store_acreage = #{record.storeAcreage},
</if>
<if test="record.storeBandwidth != null">
store_bandwidth = #{record.storeBandwidth},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.createName != null">
create_name = #{record.createName},
</if>
<if test="record.createUser != null">
create_user = #{record.createUser},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
<if test="record.updateName != null">
update_name = #{record.updateName},
</if>
<if test="record.updateUser != null">
update_user = #{record.updateUser},
</if>
<if test="record.aliyunCorpId != null">
aliyun_corp_id = #{record.aliyunCorpId},
</if>
<if test="record.source != null">
source = #{record.source},
</if>
<if test="record.vdsCorpId != null">
vds_corp_id = #{record.vdsCorpId},
</if>
<if test="record.synDingDeptId != null">
syn_ding_dept_id = #{record.synDingDeptId},
</if>
<if test="record.regionPath != null">
region_path = #{record.regionPath},
</if>
<if test="record.hasCamera != null">
has_camera = #{record.hasCamera},
</if>
<if test="record.storeStatus != null">
store_status = #{record.storeStatus},
</if>
<if test="record.thirdDeptId != null">
third_dept_id = #{record.thirdDeptId},
</if>
<if test="record.remark != null">
remark = #{record.remark},
</if>
<if test="record.extendField != null">
extend_field = #{record.extendField},
</if>
<if test="record.addressPoint != null">
address_point = #{record.addressPoint},
</if>
</set>
where id = #{record.id}
</update>
<select id="listStoreByRegionIdList" resultType="com.cool.store.dto.store.StoreAreaDTO">
select
store_name as storeName,
store_id as storeId,
region_path as regionPath,
region_id as areaId,
region_id as regionId
from store_${eid}
where is_delete = 'effective'
<foreach collection="regionIdList" item="regionId" separator=" or " open="and (" close=" )">
region_path like concat('%/', #{regionId}, '/%')
</foreach>
</select>
<select id="getStoreListByStoreIds" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from store_${enterpriseId}
where is_delete = 'effective'
and store_id in (
<foreach collection="storeIdList" separator="," item="item">
#{item}
</foreach>
)
</select>
<select id="listStoreByRegionIdListNotChild" resultType="com.cool.store.dto.store.StoreAreaDTO">
select
store_name as storeName,
store_id as storeId,
region_path as regionPath,
region_id as regionId,
region_id as areaId
from store_${eid}
where is_delete = 'effective'
<if test="regionIdList != null and regionIdList.size >0 ">
and region_id in
<foreach collection="regionIdList" item="regionId" separator="," open="(" close=" )">
#{regionId,jdbcType=BIGINT}
</foreach>
</if>
</select>
<select id="countStore" resultType="java.lang.Integer">
select count(store_id) from store_${eid}
where is_delete ='effective'
</select>
<select id="listStoreIdList" resultType="java.lang.String">
select store_id from store_${eid}
where is_delete ='effective'
</select>
</mapper>

View File

@@ -0,0 +1,167 @@
<?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.SubordinateMappingMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.SubordinateMappingDO">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
<result column="region_id" jdbcType="VARCHAR" property="regionId"/>
<result column="personal_id" jdbcType="VARCHAR" property="personalId"/>
<result column="type" jdbcType="TINYINT" property="type"/>
<result column="create_id" jdbcType="VARCHAR" property="createId"/>
<result column="create_time" jdbcType="BIGINT" property="createTime"/>
<result column="update_id" jdbcType="VARCHAR" property="updateId"/>
<result column="update_time" jdbcType="BIGINT" property="updateTime"/>
<result column="user_range" jdbcType="VARCHAR" property="userRange"/>
<result column="source" jdbcType="VARCHAR" property="source"/>
</resultMap>
<sql id="Base_Column_List">
id, user_id, region_id, personal_id, type, create_id, create_time, update_id, update_time,
user_range, source
</sql>
<insert id="insertSelective" keyColumn="id" keyProperty="record.id" useGeneratedKeys="true">
insert into subordinate_mapping_${enterpriseId}
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="record.userId != null">
user_id,
</if>
<if test="record.regionId != null">
region_id,
</if>
<if test="record.personalId != null">
personal_id,
</if>
<if test="record.type != null">
type,
</if>
<if test="record.createId != null">
create_id,
</if>
<if test="record.createTime != null">
create_time,
</if>
<if test="record.updateId != null">
update_id,
</if>
<if test="record.updateTime != null">
update_time,
</if>
<if test="record.userRange != null">
user_range,
</if>
<if test="record.source != null">
source,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="record.userId != null">
#{record.userId},
</if>
<if test="record.regionId != null">
#{record.regionId},
</if>
<if test="record.personalId != null">
#{record.personalId},
</if>
<if test="record.type != null">
#{record.type},
</if>
<if test="record.createId != null">
#{record.createId},
</if>
<if test="record.createTime != null">
#{record.createTime},
</if>
<if test="record.updateId != null">
#{record.updateId},
</if>
<if test="record.updateTime != null">
#{record.updateTime},
</if>
<if test="record.userRange != null">
#{record.userRange},
</if>
<if test="record.source != null">
#{record.source},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective">
update subordinate_mapping_${enterpriseId}
<set>
<if test="record.userId != null">
user_id = #{record.userId},
</if>
<if test="record.regionId != null">
region_id = #{record.regionId},
</if>
<if test="record.personalId != null">
personal_id = #{record.personalId},
</if>
<if test="record.type != null">
type = #{record.type},
</if>
<if test="record.createId != null">
create_id = #{record.createId},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime},
</if>
<if test="record.updateId != null">
update_id = #{record.updateId},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime},
</if>
<if test="record.userRange != null">
user_range = #{record.userRange},
</if>
<if test="record.source != null">
source = #{record.source},
</if>
</set>
where id = #{record.id}
</update>
<select id="selectByUserIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from subordinate_mapping_${enterpriseId}
where user_id in
<foreach collection="userIds" open="(" close=")" separator="," item="userId">
#{userId}
</foreach>
and type = 0
</select>
<insert id="batchInsertSubordinateMapping">
insert into subordinate_mapping_${enterpriseId}
(
user_id,
region_id,
personal_id,
`type`,
create_id,
create_time,
update_id,
update_time,
user_range,
source
)
values
<foreach collection="subordinateMappingDOS" item="entity" separator=",">
(
#{entity.userId},
#{entity.regionId},
#{entity.personalId},
#{entity.type},
#{entity.createId},
now(),
#{entity.updateId},
now(),
#{entity.userRange},
#{entity.source}
)
</foreach>
</insert>
</mapper>

View File

@@ -0,0 +1,47 @@
package com.cool.store.entity;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
* @author zhangchenbiao
* @date 2023-05-31 02:43
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class EnterpriseUserGroupDO implements Serializable {
@ApiModelProperty("主键")
private Long id;
@ApiModelProperty("组别id")
private String groupId;
@ApiModelProperty("组别名称")
private String groupName;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("创建人id")
private String createUserId;
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("更新人")
private String updateUserId;
@ApiModelProperty("删除标识")
private Boolean deleted;
@ApiModelProperty("共同编辑人userId集合前后逗号分隔")
private String commonEditUserids;
}

View File

@@ -0,0 +1,44 @@
package com.cool.store.entity;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
* @author zhangchenbiao
* @date 2023-05-31 02:43
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class EnterpriseUserGroupMappingDO implements Serializable {
@ApiModelProperty("主键")
private Long id;
@ApiModelProperty("用户id")
private String userId;
@ApiModelProperty("组别id")
private String groupId;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("创建人id")
private String createUserId;
@ApiModelProperty("更新时间")
private Date updateTime;
@ApiModelProperty("更新人")
private String updateUserId;
@ApiModelProperty("删除标识")
private Boolean deleted;
}

View File

@@ -0,0 +1,133 @@
package com.cool.store.entity;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
* @author zhangchenbiao
* @date 2023-05-31 11:51
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class StoreDO implements Serializable {
@ApiModelProperty("自增ID")
private Long id;
@ApiModelProperty("门店ID")
private String storeId;
@ApiModelProperty("门店名称")
private String storeName;
@ApiModelProperty("门店编号")
private String storeNum;
@ApiModelProperty("门头照")
private String avatar;
@ApiModelProperty("钉钉id")
private String dingId;
@ApiModelProperty("所属区域id")
private Long regionId;
@ApiModelProperty("")
private String province;
@ApiModelProperty("")
private String city;
@ApiModelProperty("")
private String county;
@ApiModelProperty("门店地址")
private String storeAddress;
@ApiModelProperty("定位地址")
private String locationAddress;
@ApiModelProperty("锁定定位:locked/锁定,not_locked/未锁定")
private String isLock;
@ApiModelProperty("经纬度")
private String longitudeLatitude;
@ApiModelProperty("经度")
private String longitude;
@ApiModelProperty("纬度")
private String latitude;
@ApiModelProperty("状态:effective/有效,invalid/失效,ignored/不可用, unSync/未同步")
private String isDelete;
@ApiModelProperty("电话号码")
private String telephone;
@ApiModelProperty("营业时间")
private String businessHours;
@ApiModelProperty("门店面积")
private String storeAcreage;
@ApiModelProperty("门店带宽")
private String storeBandwidth;
@ApiModelProperty("创建时间")
private Long createTime;
@ApiModelProperty("创建人")
private String createName;
@ApiModelProperty("创建人id")
private String createUser;
@ApiModelProperty("更新时间")
private Long updateTime;
@ApiModelProperty("更新人")
private String updateName;
@ApiModelProperty("修改人id")
private String updateUser;
@ApiModelProperty("阿里云corpId")
private String aliyunCorpId;
@ApiModelProperty("门店来源")
private String source;
@ApiModelProperty("vds的corpId")
private String vdsCorpId;
@ApiModelProperty("dinging部门id")
private String synDingDeptId;
@ApiModelProperty("区域路径")
private String regionPath;
@ApiModelProperty("是否绑定绑定摄像头0:未绑定;1:已绑定")
private Boolean hasCamera;
@ApiModelProperty("门店状态open营业closed闭店not_open未开业")
private String storeStatus;
@ApiModelProperty("第三方唯一id")
private String thirdDeptId;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("动态扩展字段")
private String extendField;
@ApiModelProperty("地址经纬度point")
private byte[] addressPoint;
}

View File

@@ -0,0 +1,52 @@
package com.cool.store.entity;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
* @author zhangchenbiao
* @date 2023-05-31 02:27
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SubordinateMappingDO implements Serializable {
@ApiModelProperty("主键")
private Integer id;
@ApiModelProperty("用户ID")
private String userId;
@ApiModelProperty("部门ID")
private String regionId;
@ApiModelProperty("人员ID")
private String personalId;
@ApiModelProperty("0 下属 1 直属上级")
private Integer type;
@ApiModelProperty("创建人")
private String createId;
@ApiModelProperty("创建时间")
private Long createTime;
@ApiModelProperty("更新人")
private String updateId;
@ApiModelProperty("更新时间")
private Long updateTime;
@ApiModelProperty("管辖用户范围self-仅自己all-全部人员define-自定义")
private String userRange;
@ApiModelProperty("auto自动关联 select手动选择")
private String source;
}