企业同步
This commit is contained in:
@@ -437,7 +437,7 @@
|
||||
<if test="regionIdList != null and regionIdList.size >0 ">
|
||||
and region_id in
|
||||
<foreach collection="regionIdList" item="regionId" separator="," open="(" close=" )">
|
||||
#{regionId,jdbcType=BIGINT}
|
||||
#{regionId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
@@ -451,4 +451,187 @@
|
||||
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>
|
||||
Reference in New Issue
Block a user