diff --git a/coolstore-partner-dao/src/main/java/com/cool/store/dao/StoreDao.java b/coolstore-partner-dao/src/main/java/com/cool/store/dao/StoreDao.java new file mode 100644 index 000000000..587f431d7 --- /dev/null +++ b/coolstore-partner-dao/src/main/java/com/cool/store/dao/StoreDao.java @@ -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 getEffectiveStoreByStoreIds(List storeIdList) { + if(CollectionUtils.isEmpty(storeIdList)) { + return Lists.newArrayList(); + } + return storeMapper.getEffectiveStoreByStoreIds(storeIdList); + } + + public List listStoreByRegionId(String regionId) { + if(StringUtils.isBlank(regionId)) { + return Lists.newArrayList(); + } + return storeMapper.listStoreByRegionId(regionId); + } + +} diff --git a/coolstore-partner-dao/src/main/java/com/cool/store/mapper/StoreMapper.java b/coolstore-partner-dao/src/main/java/com/cool/store/mapper/StoreMapper.java new file mode 100644 index 000000000..19107a698 --- /dev/null +++ b/coolstore-partner-dao/src/main/java/com/cool/store/mapper/StoreMapper.java @@ -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 getEffectiveStoreByStoreIds(@Param("storeIds") List storeIds); + /** + * 根据区域Id查询所有门店(包含所有区域子节点) + * @param regionId + * @return + */ + List listStoreByRegionId(@Param("regionId") String regionId); + +} diff --git a/coolstore-partner-dao/src/main/resources/mapper/StoreMapper.xml b/coolstore-partner-dao/src/main/resources/mapper/StoreMapper.xml new file mode 100644 index 000000000..751da7a06 --- /dev/null +++ b/coolstore-partner-dao/src/main/resources/mapper/StoreMapper.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/coolstore-partner-model/src/main/java/com/cool/store/entity/StoreDO.java b/coolstore-partner-model/src/main/java/com/cool/store/entity/StoreDO.java new file mode 100644 index 000000000..684c09871 --- /dev/null +++ b/coolstore-partner-model/src/main/java/com/cool/store/entity/StoreDO.java @@ -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; +}