This commit is contained in:
zhangchenbiao
2023-06-06 09:43:31 +08:00
parent 04e7ebea85
commit 7a78f59ad7
108 changed files with 511 additions and 4582 deletions

View File

@@ -1,637 +0,0 @@
<?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}
</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>
<select id="getSpecifiedStoreIdsAndDeptId" resultType="com.cool.store.dto.region.RegionSyncDTO">
select
id,
syn_ding_dept_id as synDingDeptId
from store_${eid}
where 1=1
<if test="isDelete!=null and isDelete!=''">
and (is_delete=#{isDelete} or syn_ding_dept_id is not null)
</if>
<if test="parentId!=null and parentId!=''">
and region_path like concat('%/',#{parentId},'/%')
</if>
</select>
<select id="getStoreBySynId" resultMap="BaseResultMap">
select * from store_${eid} where syn_ding_dept_id = #{synId}
</select>
<insert id="insertStore">
insert into store_${enterpriseId}
(
store_id,
store_name,
store_num,
region_id,
avatar,
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,
remark,
region_path,
extend_field,
syn_ding_dept_id,
source,
store_status,
address_point
)
values
(
#{storeDO.storeId},
#{storeDO.storeName},
#{storeDO.storeNum},
#{storeDO.regionId},
#{storeDO.avatar},
#{storeDO.province},
#{storeDO.city},
#{storeDO.county},
#{storeDO.storeAddress},
#{storeDO.locationAddress},
#{storeDO.isLock,jdbcType=CHAR},
#{storeDO.longitudeLatitude},
#{storeDO.longitude},
#{storeDO.latitude},
#{storeDO.isDelete,jdbcType=CHAR},
#{storeDO.telephone},
#{storeDO.businessHours},
#{storeDO.storeAcreage},
#{storeDO.storeBandwidth},
#{storeDO.createTime},
#{storeDO.createName},
#{storeDO.remark},
#{storeDO.regionPath},
#{storeDO.extendField},
#{storeDO.synDingDeptId},
#{storeDO.source},
#{storeDO.storeStatus},
ST_GeomFromText(#{storeDO.addressPoint})
)
</insert>
<update id="updateStore">
update store_${enterpriseId} set
<trim suffixOverrides=",">
<if test="storeDO.storeName != null ">
store_name = #{storeDO.storeName},
</if>
<if test="storeDO.storeNum != null ">
store_num = #{storeDO.storeNum},
</if>
<if test="storeDO.regionPath!= null ">
region_path = #{storeDO.regionPath},
</if>
<if test="storeDO.regionId!= null and storeDO.regionId != 0 ">
region_id = #{storeDO.regionId},
</if>
<if test="storeDO.avatar!= null ">
avatar = #{storeDO.avatar},
</if>
<if test="storeDO.province!= null ">
province = #{storeDO.province},
</if>
<if test="storeDO.city!= null ">
city = #{storeDO.city},
</if>
<if test="storeDO.county!= null ">
county = #{storeDO.county},
</if>
<if test="storeDO.storeAddress!= null ">
store_address = #{storeDO.storeAddress},
</if>
<if test="storeDO.locationAddress!= null ">
location_address = #{storeDO.locationAddress},
</if>
<if test="storeDO.longitudeLatitude!= null ">
longitude_latitude = #{storeDO.longitudeLatitude},
</if>
<if test="storeDO.longitude!= null ">
longitude = #{storeDO.longitude},
</if>
<if test="storeDO.latitude!= null ">
latitude = #{storeDO.latitude},
</if>
<if test="storeDO.addressPoint!= null ">
address_point = ST_GeomFromText(#{storeDO.addressPoint}),
</if>
<if test="storeDO.telephone!= null ">
telephone = #{storeDO.telephone},
</if>
<if test="storeDO.businessHours!= null ">
business_hours = #{storeDO.businessHours},
</if>
<if test="storeDO.storeAcreage!= null ">
store_acreage = #{storeDO.storeAcreage},
</if>
<if test="storeDO.storeBandwidth!= null ">
store_bandwidth = #{storeDO.storeBandwidth},
</if>
<if test="storeDO.updateTime != null ">
update_time = #{storeDO.updateTime},
</if>
<if test="storeDO.updateName != null ">
update_name = #{storeDO.updateName},
</if>
<if test="storeDO.remark!= null ">
remark = #{storeDO.remark},
</if>
<if test="storeDO.isDelete != null ">
is_delete = #{storeDO.isDelete},
</if>
<if test="storeDO.storeStatus != null ">
store_status = #{storeDO.storeStatus},
</if>
<if test="storeDO.extendField != null ">
extend_field = #{storeDO.extendField}
</if>
</trim>
where store_id=#{storeDO.storeId}
</update>
<select id="getStoreIdByIdList" resultType="java.lang.String">
select store_id from store_${eid}
where id in
<foreach collection="ids" item="id" open="(" close=")" separator=",">
#{id}
</foreach>
</select>
<update id="deleteStoreByStoreIds">
update store_${enterpriseId}
set is_delete='invalid',
update_name=#{userId, jdbcType=VARCHAR},
update_time=#{updateTime, jdbcType=BIGINT}
where store_id in
<foreach collection="storeIds" item="storeId" separator="," open="(" close=")">
#{storeId, jdbcType=VARCHAR}
</foreach>
</update>
</mapper>