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,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>