Merge remote-tracking branch 'xfsg/cc_partner_init' into cc_partner_init
This commit is contained in:
@@ -0,0 +1,44 @@
|
|||||||
|
package com.cool.store.dao;
|
||||||
|
|
||||||
|
import com.cool.store.entity.StoreDO;
|
||||||
|
import com.cool.store.mapper.StoreMapper;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public class StoreDao {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private StoreMapper storeMapper;
|
||||||
|
/**
|
||||||
|
* 根据门店id查询门店
|
||||||
|
* @param storeId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public StoreDO getByStoreId(String storeId) {
|
||||||
|
if(StringUtils.isBlank(storeId)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return storeMapper.getByStoreId(storeId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<StoreDO> getEffectiveStoreByStoreIds(List<String> storeIdList) {
|
||||||
|
if(CollectionUtils.isEmpty(storeIdList)) {
|
||||||
|
return Lists.newArrayList();
|
||||||
|
}
|
||||||
|
return storeMapper.getEffectiveStoreByStoreIds(storeIdList);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<StoreDO> listStoreByRegionId(String regionId) {
|
||||||
|
if(StringUtils.isBlank(regionId)) {
|
||||||
|
return Lists.newArrayList();
|
||||||
|
}
|
||||||
|
return storeMapper.listStoreByRegionId(regionId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.cool.store.mapper;
|
||||||
|
|
||||||
|
import com.cool.store.entity.StoreDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface StoreMapper {
|
||||||
|
|
||||||
|
StoreDO getByStoreId(@Param("storeId") String storeId);
|
||||||
|
|
||||||
|
List<StoreDO> getEffectiveStoreByStoreIds(@Param("storeIds") List<String> storeIds);
|
||||||
|
/**
|
||||||
|
* 根据区域Id查询所有门店(包含所有区域子节点)
|
||||||
|
* @param regionId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<StoreDO> listStoreByRegionId(@Param("regionId") String regionId);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
<?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">
|
||||||
|
<!--
|
||||||
|
WARNING - @mbggenerated
|
||||||
|
-->
|
||||||
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
||||||
|
<result column="store_id" property="storeId" jdbcType="VARCHAR"/>
|
||||||
|
<result column="store_name" property="storeName" jdbcType="VARCHAR"/>
|
||||||
|
<result column="store_num" property="storeNum" jdbcType="VARCHAR"/>
|
||||||
|
<result column="store_address" property="storeAddress" jdbcType="VARCHAR"/>
|
||||||
|
<result column="location_address" property="locationAddress" jdbcType="VARCHAR"/>
|
||||||
|
<result column="is_lock" property="isLock" jdbcType="CHAR"/>
|
||||||
|
<result column="longitude_latitude" property="longitudeLatitude" jdbcType="VARCHAR"/>
|
||||||
|
<result column="longitude" property="longitude" jdbcType="VARCHAR"/>
|
||||||
|
<result column="latitude" property="latitude" jdbcType="VARCHAR"/>
|
||||||
|
<result column="is_delete" property="isDelete" jdbcType="CHAR"/>
|
||||||
|
<result column="telephone" property="telephone" jdbcType="VARCHAR"/>
|
||||||
|
<result column="business_hours" property="businessHours" jdbcType="VARCHAR"/>
|
||||||
|
<result column="store_acreage" property="storeAcreage" jdbcType="VARCHAR"/>
|
||||||
|
<result column="store_bandwidth" property="storeBandwidth" jdbcType="VARCHAR"/>
|
||||||
|
<result column="create_time" property="createTime" jdbcType="BIGINT"/>
|
||||||
|
<result column="create_name" property="createName" jdbcType="VARCHAR"/>
|
||||||
|
<result column="create_user" property="createUser" jdbcType="VARCHAR"/>
|
||||||
|
<result column="update_time" property="updateTime" jdbcType="BIGINT"/>
|
||||||
|
<result column="update_name" property="updateName" jdbcType="VARCHAR"/>
|
||||||
|
<result column="update_user" property="updateUser" jdbcType="VARCHAR"/>
|
||||||
|
<result column="remark" property="remark" jdbcType="LONGVARCHAR"/>
|
||||||
|
<result column="is_device" property="isDevice" jdbcType="VARCHAR"/>
|
||||||
|
<result column="aliyun_corp_id" property="aliyunCorpId" jdbcType="VARCHAR"/>
|
||||||
|
<result column="vds_corp_id" property="vdsCorpId" jdbcType="VARCHAR"/>
|
||||||
|
<result column="syn_ding_dept_id" property="synDingDeptId" jdbcType="VARCHAR"/>
|
||||||
|
<result column="region_path" property="regionPath" jdbcType="VARCHAR"/>
|
||||||
|
<result column="has_camera" property="hasCamera" jdbcType="TINYINT"/>
|
||||||
|
<result column="region_id" property="regionId" jdbcType="VARCHAR"/>
|
||||||
|
<result column="store_status" property="storeStatus" jdbcType="VARCHAR"/>
|
||||||
|
<result column="open_date" property="openDate" jdbcType="DATE"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="getByStoreId" resultMap="BaseResultMap">
|
||||||
|
select *
|
||||||
|
from store_${enterpriseId}
|
||||||
|
where store_id = #{storeId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getEffectiveStoreByStoreIds" resultMap="BaseResultMap">
|
||||||
|
select *
|
||||||
|
from store_${enterpriseId}
|
||||||
|
where is_delete = 'effective'
|
||||||
|
<if test="storeIds != null">
|
||||||
|
<foreach collection="storeIds" item="item" separator="," open="and store_id in (" close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="listStoreByRegionId" resultMap="BaseResultMap">
|
||||||
|
select *
|
||||||
|
from store_${enterpriseId}
|
||||||
|
where is_delete = 'effective'
|
||||||
|
<if test="regionId != null and regionId!= '' ">
|
||||||
|
and region_path like concat('%/', #{regionId}, '/%')
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,223 @@
|
|||||||
|
package com.cool.store.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName StoreDO
|
||||||
|
* @Description 用一句话描述什么
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class StoreDO {
|
||||||
|
/**
|
||||||
|
* 自增ID
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店ID
|
||||||
|
*/
|
||||||
|
private String storeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店名称
|
||||||
|
*/
|
||||||
|
private String storeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店编号
|
||||||
|
*/
|
||||||
|
private String storeNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门头照
|
||||||
|
*/
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区域id
|
||||||
|
*/
|
||||||
|
private Long regionId;
|
||||||
|
/**
|
||||||
|
* 省
|
||||||
|
*/
|
||||||
|
private String province;
|
||||||
|
/**
|
||||||
|
* 市
|
||||||
|
*/
|
||||||
|
private String city;
|
||||||
|
/**
|
||||||
|
* 区
|
||||||
|
*/
|
||||||
|
private String county;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店地址
|
||||||
|
*/
|
||||||
|
private String storeAddress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定位地址
|
||||||
|
*/
|
||||||
|
private String locationAddress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 锁定定位:locked/锁定,not_ocked/未锁定
|
||||||
|
*/
|
||||||
|
private String isLock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经维度
|
||||||
|
*/
|
||||||
|
private String longitudeLatitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
private String longitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维度
|
||||||
|
*/
|
||||||
|
private String latitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态:effective/有效,invalid/失效
|
||||||
|
*/
|
||||||
|
private String isDelete;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电话号码
|
||||||
|
*/
|
||||||
|
private String telephone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 营业时间
|
||||||
|
*/
|
||||||
|
private String businessHours;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店面积
|
||||||
|
*/
|
||||||
|
private String storeAcreage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店带宽
|
||||||
|
*/
|
||||||
|
private String storeBandwidth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Long createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String createName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人id
|
||||||
|
*/
|
||||||
|
private String createUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private Long updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新人
|
||||||
|
*/
|
||||||
|
private String updateName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新人id
|
||||||
|
*/
|
||||||
|
private String updateUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否设备打卡:device/设备打卡,not_device/非设备打卡
|
||||||
|
*/
|
||||||
|
private String isDevice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 阿里云租户id(视觉)
|
||||||
|
*/
|
||||||
|
private String aliyunCorpId;
|
||||||
|
/**
|
||||||
|
* 门店来源
|
||||||
|
*/
|
||||||
|
private String source;
|
||||||
|
/**
|
||||||
|
* 是否忽略
|
||||||
|
*/
|
||||||
|
private Long isValid;
|
||||||
|
/**
|
||||||
|
* 钉钉Id
|
||||||
|
*/
|
||||||
|
private String dingId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* vdscorpId
|
||||||
|
*/
|
||||||
|
private String vdsCorpId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* dinging部门id
|
||||||
|
*/
|
||||||
|
private String synDingDeptId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区域路径
|
||||||
|
*/
|
||||||
|
private String regionPath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店是否绑定摄像头
|
||||||
|
*/
|
||||||
|
private Boolean hasCamera;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店状态(open:营业、closed:闭店、not_open:未开业)
|
||||||
|
*/
|
||||||
|
private String storeStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动态扩展字段
|
||||||
|
*/
|
||||||
|
private String extendField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地址经纬度 gis保存
|
||||||
|
*/
|
||||||
|
private String addressPoint;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否完善门店信息
|
||||||
|
* */
|
||||||
|
private String isPerfect;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第三方唯一id
|
||||||
|
*/
|
||||||
|
private String thirdDeptId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 门店开店时间
|
||||||
|
*/
|
||||||
|
private Date openDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 距离我的距离
|
||||||
|
*/
|
||||||
|
private String distance;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user