bug(办公每月作价):办公作价迁移
This commit is contained in:
@ -0,0 +1,49 @@
|
||||
<?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.ruoyi.project.data.cases.mapper.sync.DownloadOriginalOfficeCaseMapper">
|
||||
<resultMap id="DownloadMapping" type="com.ruoyi.project.data.cases.domain.OriginalOfficeCase">
|
||||
<result property="url" column="url"/>
|
||||
<result property="title" column="title"/>
|
||||
<result property="floorAreaRatio" column="容积率"/>
|
||||
<result property="caseTotalPrice" column="总价售"/>
|
||||
<result property="caseUnitPrice" column="均价售"/>
|
||||
<result property="name" column="楼盘名称"/>
|
||||
<result property="caseFloor" column="楼层"/>
|
||||
<result property="area" column="面积" javaType="java.math.BigDecimal"/>
|
||||
<result property="managementFee" column="物业费"/>
|
||||
<result property="seatCount" column="工位数"/>
|
||||
<result property="address" column="地址"/>
|
||||
<result property="metro" column="地铁"/>
|
||||
<result property="publishDate" column="发布时间" javaType="java.sql.Date"/>
|
||||
<result property="sourceNo" column="房源编号"/>
|
||||
<result property="lng" column="百度lng"/>
|
||||
<result property="lat" column="百度lat"/>
|
||||
<result property="county" column="区域"/>
|
||||
<result property="catalog" column="分类"/>
|
||||
<result property="source" column="来源"/>
|
||||
<result property="level" column="等级"/>
|
||||
<result property="homePageUrl" column="楼盘网址"/>
|
||||
<result property="decoration" column="装修"/>
|
||||
<result property="type" column="类型"/>
|
||||
<result property="block" column="板块"/>
|
||||
<result property="agency" column="挂牌中介"/>
|
||||
<result property="rentOfMonthly" column="月租金租"/>
|
||||
<result property="rentOfStandard" column="标准租金租"/>
|
||||
<result property="score" column="得房率"/>
|
||||
<result property="totalPrice" column="总价"/>
|
||||
<result property="unitPrice" column="单价"/>
|
||||
</resultMap>
|
||||
<select id="download" resultMap="DownloadMapping">
|
||||
select url, title, 容积率, 总价售, 均价售, 楼盘名称, 楼层, 面积, 物业费, 工位数, 地址, 地铁,
|
||||
发布时间,房源编号, 百度lng, 百度lat, 区域, 分类, 来源, 等级, 楼盘网址, 装修,
|
||||
类型, 板块, 挂牌中介, 月租金租, 标准租金租, 更新时间, 得房率,
|
||||
case when 分类 = '售' then 总价售
|
||||
when 分类 = '租' then 月租金租 end as 总价,
|
||||
case when 分类 = '售' then 均价售
|
||||
when 分类 = '租' then 标准租金租 end as 单价
|
||||
from dbo.办公
|
||||
where 更新时间 >= #{startDate} and 更新时间 <![CDATA[ < ]]> #{endDate}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,92 @@
|
||||
<?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.ruoyi.project.data.cases.mapper.OriginalOfficeCaseMapper">
|
||||
<update id="createTable">
|
||||
<bind name="targetTableName" value="'dbo.ODS_OFFICECASELISTED_' + yearMonth + '_RAW'"/>
|
||||
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
||||
drop table ${targetTableName};
|
||||
|
||||
create TABLE ${targetTableName}
|
||||
(
|
||||
ID uniqueidentifier not null primary key,
|
||||
url varchar (1000) NULL,
|
||||
title varchar (1000) NULL,
|
||||
容积率 varchar (1000) NULL,
|
||||
总价售 varchar (1000) NULL,
|
||||
均价售 varchar (1000) NULL,
|
||||
楼盘名称 varchar (1000) NULL,
|
||||
楼盘名称_M nvarchar (512) NULL,
|
||||
楼层 varchar (1000) NULL,
|
||||
面积 varchar (1000) NULL,
|
||||
物业费 varchar (1000) NULL,
|
||||
工位数 varchar (1000) NULL,
|
||||
地址 varchar (1000) NULL,
|
||||
地铁 varchar (1000) NULL,
|
||||
发布时间 date NULL,
|
||||
房源编号 varchar (1000) NULL,
|
||||
百度lng varchar (1000) NULL,
|
||||
百度lat varchar (1000) NULL,
|
||||
区域 varchar (1000) NULL,
|
||||
分类 varchar (1000) NULL,
|
||||
来源 varchar (1000) NULL,
|
||||
等级 varchar (1000) NULL,
|
||||
楼盘网址 varchar (1000) NULL,
|
||||
装修 varchar (1000) NULL,
|
||||
类型 varchar (1000) NULL,
|
||||
板块 varchar (1000) NULL,
|
||||
挂牌中介 varchar (1000) NULL,
|
||||
月租金租 varchar (1000) NULL,
|
||||
标准租金租 varchar (1000) NULL,
|
||||
更新时间 varchar (1000) NULL,
|
||||
得房率 varchar (1000) NULL,
|
||||
总价 decimal (18, 2) NULL,
|
||||
单价 decimal (18, 2) NULL
|
||||
);
|
||||
</update>
|
||||
<!-- 创建人工修正表 -->
|
||||
<update id="createArtificialTable">
|
||||
<bind name="targetTableName" value="'dbo.DWA_PROJECTBASEPRICE_OFFICE_MANU_' + yearMonth"/>
|
||||
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
||||
drop table ${targetTableName};
|
||||
|
||||
CREATE TABLE ${targetTableName}
|
||||
(
|
||||
id uniqueidentifier not null,
|
||||
BuildingID bigint NOT NULL,
|
||||
UnifiedID bigint NULL,
|
||||
ProjectID bigint NOT NULL,
|
||||
BuildingID_P nvarchar (20) NOT NULL,
|
||||
ProjectID_P bigint NULL,
|
||||
MainPrice decimal (38, 6) NULL,
|
||||
MainPriceRent decimal (38, 6) NULL,
|
||||
MainPricePst decimal (38, 6) NULL,
|
||||
MainPriceRentPst decimal (38, 6) NULL,
|
||||
MainPriceType varchar (2) NULL,
|
||||
MainPriceRentType varchar (2) NULL,
|
||||
ModifyDate date NULL,
|
||||
Status nvarchar (30) NULL,
|
||||
BuildingStd tinyint NULL,
|
||||
AdjEvd nvarchar (1000) NULL,
|
||||
MainPrice_1 decimal (38, 6) NULL,
|
||||
MainPriceRent_1 decimal (38, 6) NULL,
|
||||
AreaCoff decimal (7, 4) NULL,
|
||||
YearCoff decimal (7, 4) NULL,
|
||||
BuildingCoff decimal (7, 4) NULL,
|
||||
ProjectName nvarchar (1024) NULL,
|
||||
ProjectAddr nvarchar (1024) NULL,
|
||||
BuildingAddr nvarchar (1024) NULL,
|
||||
County nvarchar (512) NULL,
|
||||
Loop nvarchar (512) NULL,
|
||||
Block nvarchar (512) NULL,
|
||||
Street nvarchar (512) NULL,
|
||||
Year int NULL,
|
||||
AvgArea decimal (18, 2) NULL,
|
||||
TotalFloorSum nvarchar (32) NULL,
|
||||
UpperFloorSum nvarchar (32) NULL,
|
||||
OfficeClass nvarchar (256) NULL,
|
||||
Grade nvarchar (64) NULL
|
||||
);
|
||||
</update>
|
||||
</mapper>
|
@ -0,0 +1,316 @@
|
||||
<?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.ruoyi.project.data.cases.mapper.OriginalResidenceRentOpeningCaseMapper">
|
||||
|
||||
<update id="createTable">
|
||||
<bind name="targetTableName" value="'dbo.original_residence_rent_opening_case_' + yearMonth" />
|
||||
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
||||
drop table ${targetTableName};
|
||||
|
||||
CREATE TABLE ${targetTableName}
|
||||
(
|
||||
case_id varchar (32) NOT NULL,
|
||||
case_no nvarchar (32) NULL,
|
||||
case_lianjia_id nvarchar (50) NOT null primary key,
|
||||
case_lianjia_community_id nvarchar (50) NOT NULL,
|
||||
case_title nvarchar (500) NOT NULL,
|
||||
clean_property_type nvarchar (20) NULL,
|
||||
case_apartment_layout nvarchar (500) NOT NULL,
|
||||
case_house_structure nvarchar (50) NULL,
|
||||
case_area decimal (10, 2) NOT NULL,
|
||||
case_total_area decimal (10, 2) NOT NULL,
|
||||
case_rent_type nvarchar (20) NULL,
|
||||
case_status nvarchar (20) NULL,
|
||||
case_block nvarchar (20) NULL,
|
||||
case_county nvarchar (20) NULL,
|
||||
case_loop nvarchar (20) NULL,
|
||||
case_hall_num int NULL,
|
||||
case_room_num int NULL,
|
||||
case_underground_area decimal (10, 2) NULL,
|
||||
case_toward nvarchar (50) NOT NULL,
|
||||
clean_toward nvarchar (50) NULL,
|
||||
case_storey nvarchar (20) NOT NULL,
|
||||
clean_total_floor int NOT NULL,
|
||||
clean_current_floor_desc nvarchar (20) NULL,
|
||||
case_elevator nvarchar (20) NULL,
|
||||
clean_elevator nvarchar (20) NULL,
|
||||
case_tihu nvarchar (20) NULL,
|
||||
case_decoration nvarchar (20) NULL,
|
||||
clean_decoration nvarchar (50) NULL,
|
||||
case_year int NOT NULL,
|
||||
clean_year int NOT NULL,
|
||||
case_address nvarchar (500) NULL,
|
||||
case_vid nvarchar (500) NULL,
|
||||
case_chan_quan_xing_zhi nvarchar (200) NULL,
|
||||
case_price decimal (18, 2) NOT NULL,
|
||||
clean_unit_price decimal (18, 2) NOT NULL,
|
||||
clean_total_price decimal (18, 2) NOT NULL,
|
||||
case_community_name nvarchar (500) NULL,
|
||||
case_visited_num int NOT NULL,
|
||||
case_visited_num_15 int NOT NULL,
|
||||
case_visited_num_30 int NOT NULL,
|
||||
case_latest_deal_date date NULL,
|
||||
case_latest_visited_date date NULL,
|
||||
case_first_visited_date date NULL,
|
||||
case_url nvarchar (500) NOT NULL,
|
||||
case_community_url nvarchar (500) NOT NULL,
|
||||
case_get_date date NOT NULL,
|
||||
case_provider nvarchar (50) NOT NULL,
|
||||
uv_community_name nvarchar (500) NULL,
|
||||
uv_community_address nvarchar (1024) NULL,
|
||||
uv_community_id nvarchar (20) NULL,
|
||||
uv_building_id nvarchar (20) NULL,
|
||||
uv_county nvarchar (50) NULL,
|
||||
uv_block nvarchar (50) NULL,
|
||||
uv_loop nvarchar (50) NULL,
|
||||
area_coefficient decimal (18, 6) NULL,
|
||||
toward_coefficient decimal (18, 6) NULL,
|
||||
floor_coefficient decimal (18, 6) NULL,
|
||||
decoration_coefficient int NULL,
|
||||
year_coefficient decimal (18, 6) NULL,
|
||||
building_coefficient decimal (18, 6) NULL,
|
||||
adjust_unit_price decimal (18, 2) NULL,
|
||||
clean_project_level nvarchar (50) NULL,
|
||||
create_time datetime NOT NULL
|
||||
);
|
||||
</update>
|
||||
|
||||
<update id="createCleanTable">
|
||||
<bind name="targetTableName" value="'dbo.ODS_HOUSINGCASELISTED_LJ_' + yearMonth" />
|
||||
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
||||
drop table ${targetTableName};
|
||||
|
||||
CREATE TABLE ${targetTableName}
|
||||
(
|
||||
case_id varchar(32) not null,
|
||||
HouseholdsID_LJ bigint not null primary key,
|
||||
ProjectID_LJ bigint null,
|
||||
ProjectID bigint null,
|
||||
Roomtype nvarchar(64) null,
|
||||
Area decimal(18, 2) null,
|
||||
Towards nvarchar(64) null,
|
||||
UpperFloorSum nvarchar(32) null,
|
||||
UpperFloorNum nvarchar(32) null,
|
||||
Elevator tinyint null,
|
||||
Decoration nvarchar(64) null,
|
||||
Year int null,
|
||||
AreaCoff decimal(7, 4) null,
|
||||
TowardsCoff decimal(7, 4) null,
|
||||
FloorCoff decimal(7, 4) null,
|
||||
DecorationRng int null,
|
||||
YearCoff decimal(7, 4) null,
|
||||
BuildingCoff decimal(7, 4) null,
|
||||
PriceTotal decimal(18, 2) null,
|
||||
PriceUnit decimal(18, 2) not null,
|
||||
PriceUnitAdj decimal(18, 2) not null,
|
||||
Visited_Num int null,
|
||||
First_Visit_Time date null,
|
||||
Visited_Num_15 int null,
|
||||
Visited_Num_30 int null,
|
||||
Status tinyint null,
|
||||
AdjustedValue decimal(18, 2) null,
|
||||
AdjustedPst decimal(18, 6) null,
|
||||
AdjustedCumValue decimal(18, 2) null,
|
||||
AdjustedCumPst decimal(18, 6) null,
|
||||
AdjustedCumValueAbs decimal(18, 2) null,
|
||||
AdjustedCumPstAbs decimal(18, 6) null,
|
||||
AdjustedCumNum int null,
|
||||
PriceTotalIn decimal(18, 2) null,
|
||||
PriceTotalOut decimal(18, 2) null,
|
||||
PriceDateIn date null,
|
||||
PriceDateOut date null
|
||||
);
|
||||
</update>
|
||||
<update id="createAssembleTable">
|
||||
<bind name="targetTableName" value="'dbo.DW_HOUSINGCASE_COMM_' + yearMonth" />
|
||||
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
||||
drop table ${targetTableName};
|
||||
|
||||
create table ${targetTableName}
|
||||
(
|
||||
SID int primary key identity
|
||||
, case_id varchar(32) not null
|
||||
, HouseholdsID_LJ bigint
|
||||
, ProjectID_LJ bigint
|
||||
, ProjectID bigint --modified
|
||||
, ProjectName nvarchar(1024)
|
||||
, ProjectAddr nvarchar(1024)
|
||||
, County nvarchar(512)
|
||||
, Block nvarchar(512)
|
||||
, Loop nvarchar(512)
|
||||
, Roomtype nvarchar(64)
|
||||
, Area decimal(18, 2)
|
||||
, Towards nvarchar(64)
|
||||
, UpperFloorSum nvarchar(32)
|
||||
, UpperFloorNum nvarchar(32)
|
||||
, Elevator tinyint
|
||||
, Decoration nvarchar(64)
|
||||
, Year int
|
||||
, AreaCoff decimal(7, 4)
|
||||
, TowardsCoff decimal(7, 4)
|
||||
, FloorCoff decimal(7, 4)
|
||||
, DecorationRng int
|
||||
, YearCoff decimal(7, 4)
|
||||
, BuildingCoff decimal(7, 4)
|
||||
, BasePrice_1 decimal(18, 2)
|
||||
, PriceTotal decimal(18, 2) not null
|
||||
, PriceUnit decimal(18, 2) not null
|
||||
, PriceUnitAdj decimal(18, 2) not null
|
||||
, Visited_Num int
|
||||
, First_Visit_Time date
|
||||
, Visited_Num_15 int
|
||||
, Visited_Num_30 int
|
||||
, Status tinyint
|
||||
, AdjustedValue decimal(18, 2)
|
||||
, AdjustedPst decimal(18, 6)
|
||||
, AdjustedCumValue decimal(18, 2)
|
||||
, AdjustedCumPst decimal(18, 6)
|
||||
, AdjustedCumValueAbs decimal(18, 2)
|
||||
, AdjustedCumPstAbs decimal(18, 6)
|
||||
, AdjustedCumNum int
|
||||
, PriceTotalIn decimal(18, 2)
|
||||
, PriceDateIn date
|
||||
, CaseType int
|
||||
, RangeFlag int
|
||||
);
|
||||
</update>
|
||||
<update id="createComputePriceTable">
|
||||
<bind name="targetTableName" value="'dbo.DWA_PROJECTBASEPRICE_IMDT_' + yearMonth" />
|
||||
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
||||
drop table ${targetTableName};
|
||||
|
||||
create table ${targetTableName}
|
||||
(
|
||||
SID int not null identity(1,1)
|
||||
, ProjectID nvarchar(20) primary key
|
||||
, ProjectName nvarchar(1024)
|
||||
, ProjectAddr nvarchar(1024)
|
||||
, County nvarchar(512)
|
||||
, Block nvarchar(512)
|
||||
, Loop nvarchar(512)
|
||||
, IsIndxGen tinyint
|
||||
, IsPstCalc tinyint
|
||||
, StatusRun tinyint
|
||||
, ProjectSPLabel nvarchar(64)
|
||||
, PropertyType nvarchar(256)
|
||||
, ProjectType nvarchar(256)
|
||||
, ProjectTypeDtl nvarchar(256)
|
||||
, ProjectLevel nvarchar(64)
|
||||
, Year int
|
||||
, MainArea decimal(18, 2)
|
||||
, AreaCoff decimal(7, 4)
|
||||
, YearCoff decimal(7, 4)
|
||||
, PriceNote nvarchar(1024)
|
||||
, BasePriceDft decimal(18, 2)
|
||||
, MainPriceDft decimal(18, 2)
|
||||
, BasePrice_1 decimal(18, 2)
|
||||
, PriceUnitAdj decimal(18, 2)
|
||||
, Visited_Num int
|
||||
, First_Visit_Time date
|
||||
, Visited_Num_15 int
|
||||
, Visited_Num_30 int
|
||||
, PriceDealMean_1 decimal(18, 2)
|
||||
, PriceDealMax_1 decimal(18, 2)
|
||||
, SumDeal_1 int
|
||||
, PriceDealMean decimal(18, 2)
|
||||
, PriceDealMax decimal(18, 2)
|
||||
, SumDeal int
|
||||
, PriceListedMin decimal(18, 2)
|
||||
, PriceCase1_ToAI_Pst decimal(18, 6)
|
||||
, PriceCase2_ToAI_Pst decimal(18, 6)
|
||||
, PriceCase1_ToLst_Pst decimal(18, 6)
|
||||
, PriceCase2_ToLst_Pst decimal(18, 6)
|
||||
, PriceCase1 decimal(18, 2)
|
||||
, PriceCase1AdjPst decimal(18, 6)
|
||||
, SumCase1 int
|
||||
, PriceCase2 decimal(18, 2)
|
||||
, PriceCase2AdjPst decimal(18, 6)
|
||||
, SumCase2 int
|
||||
, VOPPBT varchar(64)
|
||||
, VOPPB decimal(18, 6)
|
||||
, BindProjID int
|
||||
, Bind_Proj_Pst decimal(18, 6)
|
||||
, Bind_Block_Class nvarchar(128)
|
||||
, Bind_Block_Class_Pst decimal(18, 6)
|
||||
, Bind_Block_Plevel nvarchar(128)
|
||||
, Bind_Block_Plevel_Pst decimal(18, 6)
|
||||
, Bind_Block_PType nvarchar(128)
|
||||
, Bind_Block_Ptype_Pst decimal(18, 6)
|
||||
, Bind_County_PType nvarchar(128)
|
||||
, Bind_County_Ptype_Pst decimal(18, 6)
|
||||
, VOPPAT varchar(64)
|
||||
, VOPPA decimal(18, 6)
|
||||
);
|
||||
</update>
|
||||
|
||||
<!-- 人工修正价格表和作价表一摸一样 -->
|
||||
<update id="createArtificialPriceTable">
|
||||
<bind name="targetTableName" value="'dbo.DWA_PROJECTBASEPRICE_MANU_' + yearMonth" />
|
||||
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
||||
drop table ${targetTableName};
|
||||
create table ${targetTableName}
|
||||
(
|
||||
SID int not null identity(1,1)
|
||||
, ProjectID nvarchar(20) primary key
|
||||
, ProjectName nvarchar(1024)
|
||||
, ProjectAddr nvarchar(1024)
|
||||
, County nvarchar(512)
|
||||
, Block nvarchar(512)
|
||||
, Loop nvarchar(512)
|
||||
, IsIndxGen tinyint
|
||||
, IsPstCalc tinyint
|
||||
, StatusRun tinyint
|
||||
, ProjectSPLabel nvarchar(64)
|
||||
, PropertyType nvarchar(256)
|
||||
, ProjectType nvarchar(256)
|
||||
, ProjectTypeDtl nvarchar(256)
|
||||
, ProjectLevel nvarchar(64)
|
||||
, Year int
|
||||
, MainArea decimal(18, 2)
|
||||
, AreaCoff decimal(7, 4)
|
||||
, YearCoff decimal(7, 4)
|
||||
, PriceNote nvarchar(1024)
|
||||
, BasePriceDft decimal(18, 2)
|
||||
, MainPriceDft decimal(18, 2)
|
||||
, BasePrice_1 decimal(18, 2)
|
||||
, PriceUnitAdj decimal(18, 2)
|
||||
, Visited_Num int
|
||||
, First_Visit_Time date
|
||||
, Visited_Num_15 int
|
||||
, Visited_Num_30 int
|
||||
, PriceDealMean_1 decimal(18, 2)
|
||||
, PriceDealMax_1 decimal(18, 2)
|
||||
, SumDeal_1 int
|
||||
, PriceDealMean decimal(18, 2)
|
||||
, PriceDealMax decimal(18, 2)
|
||||
, SumDeal int
|
||||
, PriceListedMin decimal(18, 2)
|
||||
, PriceCase1_ToAI_Pst decimal(18, 6)
|
||||
, PriceCase2_ToAI_Pst decimal(18, 6)
|
||||
, PriceCase1_ToLst_Pst decimal(18, 6)
|
||||
, PriceCase2_ToLst_Pst decimal(18, 6)
|
||||
, PriceCase1 decimal(18, 2)
|
||||
, PriceCase1AdjPst decimal(18, 6)
|
||||
, SumCase1 int
|
||||
, PriceCase2 decimal(18, 2)
|
||||
, PriceCase2AdjPst decimal(18, 6)
|
||||
, SumCase2 int
|
||||
, VOPPBT varchar(64)
|
||||
, VOPPB decimal(18, 6)
|
||||
, BindProjID int
|
||||
, Bind_Proj_Pst decimal(18, 6)
|
||||
, Bind_Block_Class nvarchar(128)
|
||||
, Bind_Block_Class_Pst decimal(18, 6)
|
||||
, Bind_Block_Plevel nvarchar(128)
|
||||
, Bind_Block_Plevel_Pst decimal(18, 6)
|
||||
, Bind_Block_PType nvarchar(128)
|
||||
, Bind_Block_Ptype_Pst decimal(18, 6)
|
||||
, Bind_County_PType nvarchar(128)
|
||||
, Bind_County_Ptype_Pst decimal(18, 6)
|
||||
, VOPPAT varchar(64)
|
||||
, VOPPA decimal(18, 6)
|
||||
);
|
||||
</update>
|
||||
</mapper>
|
@ -122,13 +122,13 @@
|
||||
<update id="updateBasePrice" parameterType="com.ruoyi.project.data.price.domain.OfficeBasePriceModifyModel">
|
||||
update ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} set Status=0 where id=#{id};
|
||||
</update>
|
||||
<insert id="batchInsertArtificialOfficeBase" >
|
||||
<insert id="batchInsertArtificialOfficeBase">
|
||||
insert into
|
||||
dbo.DWA_PROJECTBASEPRICE_OFFICE_MANU_${yearMonth}(ID,BuildingID,ProjectID,County,"Loop",Block,ProjectAddr,ProjectName,Year,AvgArea,TotalFloorSum,UpperFloorSum,OfficeClass,Grade,MainPrice_1,MainPriceRent_1,MainPrice,MainPriceRent,ModifyDate)
|
||||
values
|
||||
<foreach collection="list" item="item" separator="," >
|
||||
(#{item.id},#{item.buildingId},#{item.communityId},#{item.countyName},#{item.loopName},#{item.blockName},#{item.communityAddress},#{item.communityName},#{item.year},#{item.avgArea},#{item.totalFloorSum},#{item.upperFloorSum},#{item.officeClass},#{item.officeLevel},#{item.mainPrice_1},#{item.mainPriceRent_1},#{item.mainPrice},#{item.mainPriceRent},getdate())
|
||||
</foreach>
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.id},#{item.buildingId},#{item.communityId},#{item.countyName},#{item.loopName},#{item.blockName},#{item.communityAddress},#{item.communityName},#{item.year},#{item.avgArea},#{item.totalFloorSum},#{item.upperFloorSum},#{item.officeClass},#{item.officeLevel},#{item.mainPrice_1},#{item.mainPriceRent_1},#{item.mainPrice},#{item.mainPriceRent},getdate())
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 更新基价 -->
|
||||
<insert id="updateBasePriceCopyNew" parameterType="com.ruoyi.project.data.price.domain.OfficeBasePriceModifyModel">
|
||||
@ -214,4 +214,82 @@
|
||||
insert into
|
||||
dbo.DWA_PROJECTBASEPRICE_OFFICE_MANU_${yearMonth}(ID,BuildingID,ProjectID,County,"Loop",Block,ProjectAddr,ProjectName,Year,AvgArea,TotalFloorSum,UpperFloorSum,OfficeClass,Grade,MainPrice_1,MainPriceRent_1,MainPrice,MainPriceRent,ModifyDate) values(#{id},#{buildingId},#{communityId},#{countyName},#{loopName},#{blockName},#{communityAddress},#{communityName},#{year},#{avgArea},#{totalFloorSum},#{upperFloorSum},#{officeClass},#{officeLevel},#{mainPrice_1},#{mainPriceRent_1},#{mainPrice},#{mainPriceRent},getdate())
|
||||
</insert>
|
||||
<!-- 更新状态 -->
|
||||
<update id="updateStatus">
|
||||
update ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} set Status=0 where id=#{id};
|
||||
</update>
|
||||
<!-- 新增记录 -->
|
||||
<update id="insertNewRecord">
|
||||
insert into dbo.ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}
|
||||
(
|
||||
BuildingID
|
||||
, UnifiedID
|
||||
, ProjectID
|
||||
, BuildingID_P
|
||||
, ProjectID_P
|
||||
, MainPrice
|
||||
, MainPriceRent
|
||||
, MainPricePst
|
||||
, MainPriceRentPst
|
||||
, MainPriceType
|
||||
, MainPriceRentType
|
||||
, ModifyDate
|
||||
, Status
|
||||
, BuildingStd
|
||||
, AdjEvd
|
||||
, MainPrice_1
|
||||
, MainPriceRent_1
|
||||
, AreaCoff
|
||||
, YearCoff
|
||||
, BuildingCoff
|
||||
, ProjectName
|
||||
, ProjectAddr
|
||||
, BuildingAddr
|
||||
, County
|
||||
, Loop
|
||||
, Block
|
||||
, Street
|
||||
, Year
|
||||
, AvgArea
|
||||
, TotalFloorSum
|
||||
, UpperFloorSum
|
||||
, OfficeClass
|
||||
, Grade
|
||||
)
|
||||
select BuildingID
|
||||
, UnifiedID
|
||||
, ProjectID
|
||||
, BuildingID_P
|
||||
, ProjectID_P
|
||||
, #{mainPrice}
|
||||
, #{mainPriceRent}
|
||||
, #{mainPricePst}
|
||||
, #{mainPriceRentPst}
|
||||
, #{mainPriceType}
|
||||
, #{mainPriceRentType}
|
||||
, getdate()
|
||||
, 1
|
||||
, BuildingStd
|
||||
, AdjEvd
|
||||
, MainPrice_1
|
||||
, MainPriceRent_1
|
||||
, AreaCoff
|
||||
, YearCoff
|
||||
, BuildingCoff
|
||||
, ProjectName
|
||||
, ProjectAddr
|
||||
, BuildingAddr
|
||||
, County
|
||||
, Loop
|
||||
, Block
|
||||
, Street
|
||||
, Year
|
||||
, AvgArea
|
||||
, TotalFloorSum
|
||||
, UpperFloorSum
|
||||
, OfficeClass
|
||||
, Grade
|
||||
from ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}
|
||||
where id=#{id};
|
||||
</update>
|
||||
</mapper>
|
328
ruoyi/src/main/resources/sql-template/compute_office_price.sql
Normal file
328
ruoyi/src/main/resources/sql-template/compute_office_price.sql
Normal file
@ -0,0 +1,328 @@
|
||||
--区县处理
|
||||
update ODS_OFFICECASELISTED_#yearMonth#_RAW
|
||||
set [区域] = left([区域],2);
|
||||
|
||||
--楼盘名称中括号处理
|
||||
update ODS_OFFICECASELISTED_#yearMonth#_RAW
|
||||
set [楼盘名称_M] = STUFF([楼盘名称], patindex('%(%',[楼盘名称]),patindex('%)%',[楼盘名称])-patindex('%(%',[楼盘名称])+1,'')
|
||||
|
||||
----索引匹配
|
||||
--搜房
|
||||
---(2019.07.09)删除DIM_OFFICE_PROJECTID_SF2AI 中同一BuildingID对应不同UnifiedID的记录
|
||||
select distinct a.SID,
|
||||
case when b.BuildingID_P is not null then b.BuildingID_P
|
||||
when c.BuildingID_P is not null then c.BuildingID_P
|
||||
else d.BuildingID_P end as BuildingID_P,
|
||||
case when b.ProjectID_P is not null then b.ProjectID_P
|
||||
when c.ProjectID_P is not null then c.ProjectID_P
|
||||
else d.ProjectID_P end as ProjectID_P
|
||||
into #AddressMatchSF
|
||||
from ODS_OFFICECASELISTED_#yearMonth#_RAW a
|
||||
left join DIM_OFFICE_PROJECTID_SF2AI_201909 b
|
||||
on a.[来源]='房天下' and (a.[楼盘名称] = b.ProjectName_SF or a.[楼盘名称_M] = b.ProjectName_SF) and (a.[地址] = b.Address_SF or a.[地址] = b.AddressF_SF) and a.[区域] = b.Area_SF
|
||||
left join DIM_OFFICE_PROJECTID_SF2AI_201909 c
|
||||
on a.[来源]='房天下' and 'http:'+a.[楼盘网址] = c.Curl
|
||||
left join DIM_OFFICE_PROJECTID_SF2AI_201909 d
|
||||
on a.[来源]='房天下' and (a.[地址] =d.Address_SF or a.[地址] =d.AddressF_SF) and a.[区域] = d.Area_SF and a.[板块] = d.Block_SF
|
||||
where b.ID_SF is not null or c.ID_SF is not null or d.ID_SF is not null
|
||||
|
||||
--安居客
|
||||
select distinct a.SID, b.BuildingID_P, b.ProjectID_P
|
||||
into #AddressMatchAJK
|
||||
from ODS_OFFICECASELISTED_#yearMonth#_RAW a
|
||||
left join DIM_OFFICE_PROJECTID_AJK2AI_201909 b
|
||||
on a.[来源]='安居客' and (a.[楼盘名称] = b.ProjectName_AJK or a.[楼盘名称_M] = b.ProjectName_AJK or a.[地址] = b.Address_AJK or a.[地址] = b.AddressF_AJK) and (a.[区域] = b.Area_AJK or a.[板块] = b.Block_AJK)
|
||||
where b.ID_AJK is not null;
|
||||
|
||||
----修正系数匹配及修正
|
||||
----价格(主力基价或租金)偏离幅度q:
|
||||
----1)有基价的案例:q=修正后案例单价/上期基价-1;
|
||||
--- 2)无基价的案例:q=修正后案例单价/(AVERAGE(上期修正案例均价,当期修正案例均价))-1
|
||||
--- //////20190620优化:1) 可用案例偏离幅度修改为6%。 2) 剔除不在DIM_OFFICE_PROJECT_BUILDING_201909 中的楼栋
|
||||
--- //////20200325优化:案例整合表中新增没有地址匹配到的案例
|
||||
|
||||
with ListedPriceAvg_1 as(
|
||||
select BuildingID_P, ProjectID_P, avg(ListedPrice) as ListedPrice_1, avg(ListedPriceRent) as ListedPriceRent_1
|
||||
from DW_OFFICECASE_COMM_#lastYearMonth#
|
||||
group by BuildingID_P, ProjectID_P
|
||||
),
|
||||
coff as(
|
||||
select a.*, b.BuildingID_P, b.ProjectID_P, c.TotalFloorSum ,
|
||||
cast(case when a.[楼层]='低区' then 0.96
|
||||
when c.TotalFloorSum>=30 then 1.04
|
||||
else 1 end as DECIMAL(7,4)) as FloorCoff,
|
||||
cast(case when a.[装修]='精装修' then 1.04
|
||||
else 1 end as DECIMAL(7,4)) as DecorationCoff
|
||||
from ODS_OFFICECASELISTED_#yearMonth#_RAW a
|
||||
left join (select * from #AddressMatchSF union select * from #AddressMatchAJK) b
|
||||
on a.SID = b.SID
|
||||
left join DIM_OFFICE_PROJECT_BUILDING_201909 c
|
||||
on b.BuildingID_P = c.BuildingID_P and c.EffDate <= getdate() AND c.ExpirDate > getdate()
|
||||
),
|
||||
ListedPriceAvg as(
|
||||
select BuildingID_P, ProjectID_P,
|
||||
avg(case when [分类]='售' then [单价] end) as ListedPrice,
|
||||
avg(case when [分类]='租' then [单价] end) as ListedPriceRent
|
||||
from coff group by BuildingID_P, ProjectID_P
|
||||
),
|
||||
ListedPriceAvg_0_1 as(
|
||||
select BuildingID_P, ProjectID_P, avg(Price) as ListedPrice_0_1, avg(PriceRent) as ListedPriceRent_0_1
|
||||
from (
|
||||
select BuildingID_P, ProjectID_P, ListedPrice_1 as Price, ListedPriceRent_1 as PriceRent from ListedPriceAvg_1
|
||||
union
|
||||
select BuildingID_P, ProjectID_P, ListedPrice as Price, ListedPriceRent as PriceRent from ListedPriceAvg
|
||||
) a group by BuildingID_P, ProjectID_P
|
||||
)
|
||||
select a.*, isnull(a.[单价],0)*1.0/FloorCoff/DecorationCoff as PriceAmend,
|
||||
b.MainPrice MainPrice_1, b.MainPriceRent MainPriceRent_1,
|
||||
e.ListedPrice_1, e.ListedPriceRent_1, d.ListedPrice, d.ListedPriceRent,
|
||||
case when a.[分类]='售' and isnull(b.MainPrice,0)<>0 then isnull(a.[单价],0)*1.0/FloorCoff/DecorationCoff/b.MainPrice-1
|
||||
when a.[分类]='售' and isnull(b.MainPrice,0)= 0 then isnull(a.[单价],0)*1.0/FloorCoff/DecorationCoff/isnull(c.ListedPrice_0_1, 1)-1
|
||||
when a.[分类]='租' and isnull(b.MainPriceRent,0)<>0 then isnull(a.[单价],0)*1.0/FloorCoff/DecorationCoff/b.MainPriceRent-1
|
||||
when a.[分类]='租' and isnull(b.MainPriceRent,0)= 0 then isnull(a.[单价],0)*1.0/FloorCoff/DecorationCoff/isnull(c.ListedPriceRent_0_1, 1)-1
|
||||
end as VOPP
|
||||
into DW_OFFICECASE_COMM_#yearMonth#
|
||||
from coff a
|
||||
left join (select BuildingID_P, ProjectID_P, MainPrice, MainPriceRent from ODS_OFFICE_BUILDING_PRICE_INFO_#lastYearMonth# where Status = 1 and BuildingStd = 1) b ---BuildingStd=1:取5000左右的活跃的楼栋(标准楼栋); Status=1当前有效
|
||||
on a.BuildingID_P = b.BuildingID_P
|
||||
left join ListedPriceAvg_0_1 c on a.BuildingID_P = c.BuildingID_P
|
||||
left join ListedPriceAvg d on a.BuildingID_P = d.BuildingID_P
|
||||
left join ListedPriceAvg_1 e on a.BuildingID_P = e.BuildingID_P
|
||||
|
||||
alter table DW_OFFICECASE_COMM_#yearMonth# add VOPPT nvarchar(32);
|
||||
|
||||
update DW_OFFICECASE_COMM_#yearMonth#
|
||||
set VOPPT =
|
||||
case when [分类]='售' and abs(VOPP)>0.3 then 's:gt:30%'
|
||||
when [分类]='售' and abs(VOPP)>0.2 then 's:gt:20%'
|
||||
when [分类]='售' and abs(VOPP)>0.1 then 's:gt:10%'
|
||||
when [分类]='售' and abs(VOPP)>0.06 then 's:gt:6%'
|
||||
when [分类]='售' then 's:lte:6%'
|
||||
when [分类]='租' and abs(VOPP)>0.3 then 'r:gt:30%'
|
||||
when [分类]='租' and abs(VOPP)>0.2 then 'r:gt:20%'
|
||||
when [分类]='租' and abs(VOPP)>0.1 then 'r:gt:10%'
|
||||
when [分类]='租' and abs(VOPP)>0.06 then 'r:gt:6%'
|
||||
when [分类]='租' then 'r:lte:6%' end;
|
||||
|
||||
---根据楼栋汇总
|
||||
select BuildingID_P, ProjectID_P,
|
||||
MainPrice_1, --上期基价
|
||||
MainPriceRent_1, --上期租金
|
||||
cast(avg(case when a.VOPPT='s:lte:6%' and a.PriceAmend<>0 then a.PriceAmend end) as decimal(18,2)) as MainPrice, --剔除案例修正价格为0的和空的(avg函数自动剔除空值不参与运算)
|
||||
cast(avg(case when a.VOPPT='r:lte:6%' and a.PriceAmend<>0 then a.PriceAmend end) as decimal(18,2)) as MainPriceRent,
|
||||
cast(avg(case when a.VOPPT='s:lte:6%' then a.VOPP end) as DECIMAL(18,6)) as MainPricePst,
|
||||
cast(avg(case when a.VOPPT='r:lte:6%' then a.VOPP end) as DECIMAL(18,6)) as MainPriceRentPst
|
||||
Into #BuildingPriceWithCase
|
||||
from DW_OFFICECASE_COMM_#yearMonth# a
|
||||
where VOPPT in ('s:lte:6%','r:lte:6%')
|
||||
group by BuildingID_P, ProjectID_P, MainPrice_1, MainPriceRent_1
|
||||
|
||||
---绑定涨跌幅
|
||||
--绑定同一办公项目
|
||||
select a.BuildingID_P, a.ProjectID_P, a.ProjectName, a.ProjectAddr, a.BuildingAddr, a.County, a.Loop, a.Block, a.Street,
|
||||
a.[Year], a.AvgArea, a.TotalFloorSum, a.UpperFloorSum, a.OfficeClass, a.Grade,
|
||||
case when c.MainPricePst is not null then c.MainPricePst
|
||||
when b.MainPricePst is not null then b.MainPricePst end as MainPricePst,
|
||||
case when c.MainPriceRentPst is not null then c.MainPriceRentPst
|
||||
when b.MainPriceRentPst is not null then b.MainPriceRentPst end as MainPriceRentPst,
|
||||
case when c.MainPricePst is not null then 't'
|
||||
when b.MainPricePst is not null then 't0' end as MainPriceType,
|
||||
case when c.MainPriceRentPst is not null then 't'
|
||||
when b.MainPriceRentPst is not null then 't0' end as MainPriceRentType
|
||||
into #TempBindUnifiedID
|
||||
from DIM_OFFICE_PROJECT_BUILDING_201909 a
|
||||
left join (
|
||||
select ProjectID_P, avg(MainPricePst) MainPricePst, avg(MainPriceRentPst) MainPriceRentPst
|
||||
from #BuildingPriceWithCase group by ProjectID_P
|
||||
)b on a.ProjectID_P = b.ProjectID_P
|
||||
left join #BuildingPriceWithCase c
|
||||
on a.BuildingID_P= c.BuildingID_P
|
||||
where (b.ProjectID_P is not null or c.BuildingID_P is not null) and a.EffDate <= getdate() AND a.ExpirDate > getdate()
|
||||
go
|
||||
|
||||
--竣工日期<=5年+同一办公分类+ 同一街道
|
||||
with BindStreet as(
|
||||
select a.*, b.BuildingID_P BuildingID_B, b.ProjectID_P ProjectID_B, b.MainPricePst, b.MainPriceRentPst, b.MainPriceType, b.MainPriceRentType
|
||||
from DIM_OFFICE_PROJECT_BUILDING_201909 a
|
||||
inner join #TempBindUnifiedID b
|
||||
on abs(a.[Year]-b.[Year])<=5 and a.OfficeClass = b.OfficeClass and (a.OfficeClass is not null and a.OfficeClass<>'未确定') and a.Street = b.Street
|
||||
)
|
||||
select a.BuildingID_P, a.ProjectID_P, a.ProjectName, a.ProjectAddr, a.BuildingAddr, a.County, a.Loop, a.Block, a.Street,
|
||||
a.[Year], a.AvgArea, a.TotalFloorSum, a.UpperFloorSum, a.OfficeClass, a.Grade,
|
||||
case when c.MainPricePst is not null then c.MainPricePst
|
||||
when b.MainPricePst is not null then b.MainPricePst end as MainPricePst,
|
||||
case when c.MainPriceRentPst is not null then c.MainPriceRentPst
|
||||
when b.MainPriceRentPst is not null then b.MainPriceRentPst end as MainPriceRentPst,
|
||||
case when c.MainPricePst is not null then c.MainPriceType
|
||||
when b.MainPricePst is not null then 't1' end as MainPriceType,
|
||||
case when c.MainPriceRentPst is not null then c.MainPriceRentType
|
||||
when b.MainPriceRentPst is not null then 't1' end as MainPriceRentType
|
||||
into #TempBindStreet
|
||||
from DIM_OFFICE_PROJECT_BUILDING_201909 a
|
||||
left join (
|
||||
select BuildingID_P, ProjectID_P, avg(MainPricePst) MainPricePst, avg(MainPriceRentPst) MainPriceRentPst
|
||||
from BindStreet group by BuildingID_P, ProjectID_P
|
||||
) b on a.BuildingID_P = b.BuildingID_P
|
||||
left join #TempBindUnifiedID c
|
||||
on a.BuildingID_P= c.BuildingID_P
|
||||
where (b.ProjectID_P is not null or c.BuildingID_P is not null) and a.EffDate <= getdate() AND a.ExpirDate > getdate()
|
||||
go
|
||||
|
||||
--竣工日期<=5年+同一办公分类+ 同一板块
|
||||
with BindBlock as(
|
||||
select a.*, b.BuildingID_P BuildingID_B, b.ProjectID_P ProjectID_B, b.MainPricePst, b.MainPriceRentPst, b.MainPriceType, b.MainPriceRentType
|
||||
from DIM_OFFICE_PROJECT_BUILDING_201909 a
|
||||
inner join #TempBindStreet b
|
||||
on abs(a.[Year]-b.[Year])<=5 and a.OfficeClass = b.OfficeClass and (a.OfficeClass is not null and a.OfficeClass<>'未确定') and a.Block = b.Block
|
||||
)
|
||||
select a.BuildingID_P, a.ProjectID_P, a.ProjectName, a.ProjectAddr, a.BuildingAddr, a.County, a.Loop, a.Block, a.Street,
|
||||
a.[Year], a.AvgArea, a.TotalFloorSum, a.UpperFloorSum, a.OfficeClass, a.Grade,
|
||||
case when c.MainPricePst is not null then c.MainPricePst
|
||||
when b.MainPricePst is not null then b.MainPricePst end as MainPricePst,
|
||||
case when c.MainPriceRentPst is not null then c.MainPriceRentPst
|
||||
when b.MainPriceRentPst is not null then b.MainPriceRentPst end as MainPriceRentPst,
|
||||
case when c.MainPricePst is not null then c.MainPriceType
|
||||
when b.MainPricePst is not null then 't2' end as MainPriceType,
|
||||
case when c.MainPriceRentPst is not null then c.MainPriceRentType
|
||||
when b.MainPriceRentPst is not null then 't2' end as MainPriceRentType
|
||||
into #TempBindBlock
|
||||
from DIM_OFFICE_PROJECT_BUILDING_201909 a
|
||||
left join (
|
||||
select BuildingID_P, ProjectID_P, avg(MainPricePst) MainPricePst, avg(MainPriceRentPst) MainPriceRentPst
|
||||
from BindBlock group by BuildingID_P, ProjectID_P
|
||||
) b on a.BuildingID_P = b.BuildingID_P
|
||||
left join #TempBindStreet c
|
||||
on a.BuildingID_P= c.BuildingID_P
|
||||
where(b.ProjectID_P is not null or c.BuildingID_P is not null) and a.EffDate <= getdate() AND a.ExpirDate > getdate()
|
||||
go
|
||||
|
||||
--竣工日期<=5年+同一办公分类+ 同一区域
|
||||
with BindCounty as(
|
||||
select a.*, b.BuildingID_P BuildingID_B, b.ProjectID_P ProjectID_B, b.MainPricePst, b.MainPriceRentPst, b.MainPriceType, b.MainPriceRentType
|
||||
from DIM_OFFICE_PROJECT_BUILDING_201909 a
|
||||
inner join #TempBindBlock b
|
||||
on abs(a.[Year]-b.[Year])<=5 and a.OfficeClass = b.OfficeClass and (a.OfficeClass is not null and a.OfficeClass<>'未确定') and a.County = b.County
|
||||
)
|
||||
select a.BuildingID_P, a.ProjectID_P, a.ProjectName, a.ProjectAddr, a.BuildingAddr, a.County, a.Loop, a.Block, a.Street,
|
||||
a.[Year], a.AvgArea, a.TotalFloorSum, a.UpperFloorSum, a.OfficeClass, a.Grade,
|
||||
case when c.MainPricePst is not null then c.MainPricePst
|
||||
when b.MainPricePst is not null then b.MainPricePst end as MainPricePst,
|
||||
case when c.MainPriceRentPst is not null then c.MainPriceRentPst
|
||||
when b.MainPriceRentPst is not null then b.MainPriceRentPst end as MainPriceRentPst,
|
||||
case when c.MainPricePst is not null then c.MainPriceType
|
||||
when b.MainPricePst is not null then 't3' end as MainPriceType,
|
||||
case when c.MainPriceRentPst is not null then c.MainPriceRentType
|
||||
when b.MainPriceRentPst is not null then 't3' end as MainPriceRentType
|
||||
into #TempBindCounty
|
||||
from DIM_OFFICE_PROJECT_BUILDING_201909 a
|
||||
left join (
|
||||
select BuildingID_P, ProjectID_P, avg(MainPricePst) MainPricePst, avg(MainPriceRentPst) MainPriceRentPst
|
||||
from BindCounty group by BuildingID_P, ProjectID_P
|
||||
) b on a.BuildingID_P = b.BuildingID_P
|
||||
left join #TempBindBlock c
|
||||
on a.BuildingID_P= c.BuildingID_P
|
||||
where (b.ProjectID_P is not null or c.BuildingID_P is not null) and a.EffDate <= getdate() AND a.ExpirDate > getdate()
|
||||
go
|
||||
|
||||
--竣工日期<=5年+同一办公分类+ 同一环线
|
||||
with BindLoop as(
|
||||
select a.*, b.BuildingID_P BuildingID_B, b.ProjectID_P ProjectID_B, b.MainPricePst, b.MainPriceRentPst, b.MainPriceType, b.MainPriceRentType
|
||||
from DIM_OFFICE_PROJECT_BUILDING_201909 a
|
||||
inner join #TempBindCounty b
|
||||
on abs(a.[Year]-b.[Year])<=5 and a.OfficeClass = b.OfficeClass and (a.OfficeClass is not null and a.OfficeClass<>'未确定') and a.Loop = b.Loop
|
||||
)
|
||||
select a.BuildingID_P, a.ProjectID_P, a.ProjectName, a.ProjectAddr, a.BuildingAddr, a.County, a.Loop, a.Block, a.Street,
|
||||
a.[Year], a.AvgArea, a.TotalFloorSum, a.UpperFloorSum, a.OfficeClass, a.Grade,
|
||||
case when c.MainPricePst is not null then c.MainPricePst
|
||||
when b.MainPricePst is not null then b.MainPricePst end as MainPricePst,
|
||||
case when c.MainPriceRentPst is not null then c.MainPriceRentPst
|
||||
when b.MainPriceRentPst is not null then b.MainPriceRentPst end as MainPriceRentPst,
|
||||
case when c.MainPricePst is not null then c.MainPriceType
|
||||
when b.MainPricePst is not null then 't4' end as MainPriceType,
|
||||
case when c.MainPriceRentPst is not null then c.MainPriceRentType
|
||||
when b.MainPriceRentPst is not null then 't4' end as MainPriceRentType
|
||||
into #TempBindLoop
|
||||
from DIM_OFFICE_PROJECT_BUILDING_201909 a
|
||||
left join (
|
||||
select BuildingID_P, ProjectID_P, avg(MainPricePst) MainPricePst, avg(MainPriceRentPst) MainPriceRentPst
|
||||
from BindLoop group by BuildingID_P, ProjectID_P
|
||||
) b on a.BuildingID_P = b.BuildingID_P
|
||||
left join #TempBindCounty c
|
||||
on a.BuildingID_P= c.BuildingID_P
|
||||
where (b.ProjectID_P is not null or c.BuildingID_P is not null) and a.EffDate <= getdate() AND a.ExpirDate > getdate()
|
||||
go
|
||||
|
||||
---添加上期基价
|
||||
---///非t~t4,且上期价格非空,且上期价格类型非t5,则另当期基价类型为t5
|
||||
select newid() as id
|
||||
, a.BuildingID
|
||||
, a.UnifiedID
|
||||
, a.ProjectID
|
||||
, a.BuildingID_P
|
||||
, a.ProjectID_P
|
||||
, c.MainPrice * (1 + isnull(b.MainPricePst, 0)) as MainPrice
|
||||
, c.MainPriceRent * (1 + isnull(b.MainPriceRentPst, 0)) as MainPriceRent
|
||||
, case
|
||||
when b.MainPricePst is not null then
|
||||
b.MainPricePst
|
||||
when c.MainPrice is not null then
|
||||
0
|
||||
end MainPricePst
|
||||
, case
|
||||
when b.MainPriceRentPst is not null then
|
||||
b.MainPriceRentPst
|
||||
when c.MainPriceRent is not null then
|
||||
0
|
||||
end MainPriceRentPst
|
||||
, case
|
||||
when b.MainPriceType is not null then
|
||||
b.MainPriceType
|
||||
when c.MainPrice is not null then
|
||||
't5'
|
||||
end as MainPriceType
|
||||
, case
|
||||
when b.MainPriceRentType is not null then
|
||||
b.MainPriceRentType
|
||||
when c.MainPriceRent is not null then
|
||||
't5'
|
||||
end as MainPriceRentType
|
||||
, cast(getdate() as date) ModifyDate
|
||||
, cast(1 as nvarchar) Status
|
||||
, a.BuildingStd
|
||||
, cast(null as nvarchar(1000)) as AdjEvd
|
||||
, c.MainPrice as MainPrice_1
|
||||
, c.MainPriceRent as MainPriceRent_1
|
||||
, a.AreaCoff as AreaCoff
|
||||
, a.YearCoff as YearCoff
|
||||
, a.BuildingCoff as BuildingCoff
|
||||
, a.ProjectName as ProjectName
|
||||
, a.ProjectAddr as ProjectAddr
|
||||
,a.BuildingAddr as BuildingAddr
|
||||
,a.County as County
|
||||
,a.Loop as Loop
|
||||
,a.Block as Block
|
||||
,a.Street as Street
|
||||
,a.Year as Year
|
||||
,a.AvgArea as AvgArea
|
||||
,a.TotalFloorSum as TotalFloorSum
|
||||
,a.UpperFloorSum as UpperFloorSum
|
||||
,a.OfficeClass as OfficeClass
|
||||
,a.Grade as Grade
|
||||
into ODS_OFFICE_BUILDING_PRICE_INFO_#yearMonth#
|
||||
from DIM_OFFICE_PROJECT_BUILDING_201909 a
|
||||
left join #TempBindLoop b
|
||||
on a.BuildingID_P = b.BuildingID_P
|
||||
left join ODS_OFFICE_BUILDING_PRICE_INFO_#lastYearMonth# c
|
||||
on a.BuildingID_P = c.BuildingID_P
|
||||
where a.EffDate <= getdate()
|
||||
and a.ExpirDate > getdate()
|
||||
and c.Status = 1;
|
||||
|
||||
drop table #AddressMatchSF
|
||||
drop table #AddressMatchAJK
|
||||
drop table #BuildingPriceWithCase
|
||||
drop table #TempBindUnifiedID
|
||||
drop table #TempBindStreet
|
||||
drop table #TempBindBlock
|
||||
drop table #TempBindCounty
|
||||
drop table #TempBindLoop
|
@ -1,105 +1,45 @@
|
||||
select a.BuildingID as BuildingID_P
|
||||
, a.ProjectID as ProjectID_P
|
||||
, a.MainPrice
|
||||
, a.MainPriceRent
|
||||
, a.MainPrice_1
|
||||
, a.MainPriceRent_1
|
||||
, getdate() as ModifyDate
|
||||
, case
|
||||
when b.BuildingID is not null
|
||||
and cast(a.MainPrice as decimal(18, 1)) <> cast(isnull(b.MainPrice, 0) as decimal(18, 1)) then
|
||||
1
|
||||
else
|
||||
0
|
||||
end as MainPriceChg
|
||||
, case
|
||||
when b.BuildingID is not null
|
||||
and cast(a.MainPriceRent as decimal(18, 1)) <> cast(isnull(b.MainPriceRent, 0) as decimal(18, 1)) then
|
||||
1
|
||||
else
|
||||
0
|
||||
end as MainPriceRentChg
|
||||
, case
|
||||
when c.BuildingID is not null
|
||||
and cast(a.MainPrice_1 as decimal(18, 1)) <> cast(isnull(c.MainPrice, 0) as decimal(18, 1)) then
|
||||
1
|
||||
else
|
||||
0
|
||||
end as MainPrice_1Chg
|
||||
, case
|
||||
when c.BuildingID is not null
|
||||
and cast(a.MainPriceRent_1 as decimal(18, 1)) <> cast(isnull(c.MainPriceRent, 0) as decimal(18, 1)) then
|
||||
1
|
||||
else
|
||||
0
|
||||
end as MainPriceRent_1Chg
|
||||
select a.BuildingID_p, a.ProjectID_p, a.MainPrice, a.MainPriceRent, a.MainPrice_1, a.MainPriceRent_1,
|
||||
getdate() as ModifyDate,
|
||||
case when b.BuildingID is not null and cast(a.MainPrice as decimal(18,1)) <> cast(isnull(b.MainPrice, 0) as decimal(18,1)) then 1 else 0 end as MainPriceChg, --指当期基价变化
|
||||
case when b.BuildingID is not null and cast(a.MainPriceRent as decimal(18,1)) <> cast(isnull(b.MainPriceRent, 0) as decimal(18,1)) then 1 else 0 end as MainPriceRentChg, --指当期租金变化
|
||||
case when c.BuildingID is not null and cast(a.MainPrice_1 as decimal(18,1)) <> cast(isnull(c.MainPrice, 0) as decimal(18,1)) then 1 else 0 end as MainPrice_1Chg, --指上期基价变化
|
||||
case when c.BuildingID is not null and cast(a.MainPriceRent_1 as decimal(18,1)) <> cast(isnull(c.MainPriceRent, 0) as decimal(18,1)) then 1 else 0 end as MainPriceRent_1Chg --指上期租金变化
|
||||
into #InfoChg
|
||||
from dbo.DWA_PROJECTBASEPRICE_OFFICE_MANU_#yearMonth# a
|
||||
left join ODS_OFFICE_BUILDING_PRICE_INFO_#yearMonth# b
|
||||
on a.BuildingID = b.BuildingID_P
|
||||
and b.Status = 1
|
||||
and
|
||||
(
|
||||
cast(a.MainPrice as decimal(18, 1)) <> cast(isnull(b.MainPrice, 0) as decimal(18, 1))
|
||||
or cast(a.MainPriceRent as decimal(18, 1)) <> cast(isnull(b.MainPriceRent, 0) as decimal(18, 1))
|
||||
)
|
||||
left join ODS_OFFICE_BUILDING_PRICE_INFO_#lastYearMonth# c
|
||||
on a.BuildingID = c.BuildingID_P
|
||||
and c.Status = 1
|
||||
and
|
||||
(
|
||||
cast(a.MainPrice_1 as decimal(18, 1)) <> cast(isnull(c.MainPrice, 0) as decimal(18, 1))
|
||||
or cast(a.MainPriceRent_1 as decimal(18, 1)) <> cast(isnull(c.MainPriceRent, 0) as decimal(18, 1))
|
||||
)
|
||||
where b.BuildingID_P is not null
|
||||
or c.BuildingID_P is not null;
|
||||
from DWA_PROJECTBASEPRICE_OFFICE_MANU_#yearMonth# a
|
||||
left join ODS_OFFICE_BUILDING_PRICE_INFO_#yearMonth# b
|
||||
on a.BuildingID = b.BuildingID and b.status=1 and (
|
||||
cast(a.MainPrice as decimal(18,1)) <> cast(isnull(b.MainPrice, 0) as decimal(18,1)) or
|
||||
cast(a.MainPriceRent as decimal(18,1)) <> cast(isnull(b.MainPriceRent, 0) as decimal(18,1)))
|
||||
left join ODS_OFFICE_BUILDING_PRICE_INFO_#lastYearMonth# c
|
||||
on a.BuildingID = c.BuildingID and c.status=1 and (
|
||||
cast(a.MainPrice_1 as decimal(18,1)) <> cast(isnull(c.MainPrice, 0) as decimal(18,1)) or
|
||||
cast(a.MainPriceRent_1 as decimal(18,1)) <> cast(isnull(c.MainPriceRent, 0) as decimal(18,1)))
|
||||
where b.BuildingID is not null or c.BuildingID is not null;
|
||||
|
||||
|
||||
select a.UnifiedID
|
||||
, a.BuildingID_P
|
||||
, a.ProjectID_P
|
||||
, b.MainPrice_1
|
||||
, b.MainPriceRent_1
|
||||
, a.MainPricePst
|
||||
, a.MainPriceRentPst
|
||||
, a.MainPriceType
|
||||
, a.MainPriceRentType
|
||||
, b.ModifyDate
|
||||
, 1 as Status
|
||||
, a.BuildingStd
|
||||
, case
|
||||
when MainPrice_1Chg = 0 then
|
||||
''
|
||||
else
|
||||
'MainPrice_1Chg|'
|
||||
end + case
|
||||
when MainPriceRent_1Chg = 0 then
|
||||
''
|
||||
else
|
||||
'MainPriceRent_1Chg|'
|
||||
end as AdjEvd
|
||||
--价格调整
|
||||
select a.BuildingID, a.UnifiedID, a.ProjectID, a.BuildingID_P, a.ProjectID_P, b.MainPrice_1, b.MainPriceRent_1,
|
||||
a.MainPricePst, a.MainPriceRentPst,
|
||||
a.MainPriceType, a.MainPriceRentType, b.ModifyDate, 1 as Status, a.BuildingStd,
|
||||
case when MainPrice_1Chg=0 then '' else 'MainPrice_1Chg|' end + case when MainPriceRent_1Chg=0 then '' else 'MainPriceRent_1Chg|' end as AdjEvd
|
||||
into #InfoChgLst
|
||||
from ODS_OFFICE_BUILDING_PRICE_INFO_#lastYearMonth# a
|
||||
inner join #InfoChg b
|
||||
on a.BuildingID_P = b.BuildingID_P
|
||||
where (
|
||||
b.MainPrice_1Chg = 1
|
||||
or b.MainPriceRent_1Chg = 1
|
||||
)
|
||||
and a.Status = 1;
|
||||
inner join #InfoChg b
|
||||
on a.BuildingID_p = b.BuildingID_p
|
||||
where (b.MainPrice_1Chg=1 or b.MainPriceRent_1Chg=1) and a.status=1;
|
||||
|
||||
update a
|
||||
set a.Status = 0
|
||||
from ODS_OFFICE_BUILDING_PRICE_INFO_#lastYearMonth# a
|
||||
left join #InfoChgLst b
|
||||
on a.BuildingID_P = b.BuildingID_P
|
||||
where b.BuildingID_P is not null
|
||||
and a.Status = 1;
|
||||
left join #InfoChgLst b
|
||||
on a.BuildingID_p = b.BuildingID_P
|
||||
where b.BuildingID_p is not null and a.status=1;
|
||||
|
||||
insert into dbo.ODS_OFFICE_BUILDING_PRICE_INFO_#lastYearMonth#
|
||||
insert into ODS_OFFICE_BUILDING_PRICE_INFO_#lastYearMonth#
|
||||
(
|
||||
ID
|
||||
id
|
||||
, BuildingID
|
||||
, UnifiedID
|
||||
, ProjectID
|
||||
, BuildingID_P
|
||||
, ProjectID_P
|
||||
, MainPrice
|
||||
@ -112,71 +52,88 @@ insert into dbo.ODS_OFFICE_BUILDING_PRICE_INFO_#lastYearMonth#
|
||||
, Status
|
||||
, BuildingStd
|
||||
, AdjEvd
|
||||
, MainPrice_1
|
||||
, MainPriceRent_1
|
||||
, AreaCoff
|
||||
, YearCoff
|
||||
, BuildingCoff
|
||||
, ProjectName
|
||||
, ProjectAddr
|
||||
, BuildingAddr
|
||||
, County
|
||||
, Loop
|
||||
, Block
|
||||
, Street
|
||||
, Year
|
||||
, AvgArea
|
||||
, TotalFloorSum
|
||||
, UpperFloorSum
|
||||
, OfficeClass
|
||||
, Grade
|
||||
)
|
||||
select newid()
|
||||
, UnifiedID
|
||||
, BuildingID_P
|
||||
, ProjectID_P
|
||||
, MainPrice_1
|
||||
, MainPriceRent_1
|
||||
, MainPricePst
|
||||
, MainPriceRentPst
|
||||
, MainPriceType
|
||||
, MainPriceRentType
|
||||
, getdate()
|
||||
, Status
|
||||
, BuildingStd
|
||||
, AdjEvd
|
||||
select
|
||||
newid()
|
||||
, BuildingID
|
||||
, UnifiedID
|
||||
, ProjectID
|
||||
, BuildingID_P
|
||||
, ProjectID_P
|
||||
, MainPrice
|
||||
, MainPriceRent
|
||||
, MainPricePst
|
||||
, MainPriceRentPst
|
||||
, MainPriceType
|
||||
, MainPriceRentType
|
||||
, ModifyDate
|
||||
, Status
|
||||
, BuildingStd
|
||||
, AdjEvd
|
||||
, MainPrice_1
|
||||
, MainPriceRent_1
|
||||
, AreaCoff
|
||||
, YearCoff
|
||||
, BuildingCoff
|
||||
, ProjectName
|
||||
, ProjectAddr
|
||||
, BuildingAddr
|
||||
, County
|
||||
, Loop
|
||||
, Block
|
||||
, Street
|
||||
, Year
|
||||
, AvgArea
|
||||
, TotalFloorSum
|
||||
, UpperFloorSum
|
||||
, OfficeClass
|
||||
, Grade
|
||||
from #InfoChgLst;
|
||||
|
||||
select a.UnifiedID
|
||||
, a.BuildingID_P
|
||||
, a.ProjectID_P
|
||||
, b.MainPrice
|
||||
, b.MainPriceRent
|
||||
, b.MainPrice * 1.0 / c.MainPrice as MainPricePst
|
||||
, b.MainPriceRent * 1.0 / c.MainPriceRent as MainPriceRentPst
|
||||
, a.MainPriceType
|
||||
, a.MainPriceRentType
|
||||
, b.ModifyDate
|
||||
, 1 as Status
|
||||
, a.BuildingStd
|
||||
, case
|
||||
when MainPriceChg = 0 then
|
||||
''
|
||||
else
|
||||
'MainPriceChg|'
|
||||
end + case
|
||||
when MainPriceRentChg = 0 then
|
||||
''
|
||||
else
|
||||
'MainPriceRentChg|'
|
||||
end as AdjEvd
|
||||
--当周期价格调整
|
||||
select a.BuildingID, a.UnifiedID, a.ProjectID, a.BuildingID_P, a.ProjectID_P, b.MainPrice, b.MainPriceRent,
|
||||
b.MainPrice*1.0/c.MainPrice as MainPricePst, b.MainPriceRent*1.0/c.MainPriceRent as MainPriceRentPst,
|
||||
a.MainPriceType, a.MainPriceRentType, b.ModifyDate, 1 as Status, a.BuildingStd,
|
||||
case when MainPriceChg=0 then '' else 'MainPriceChg|' end + case when MainPriceRentChg=0 then '' else 'MainPriceRentChg|' end as AdjEvd
|
||||
into #InfoChgCurr
|
||||
from ODS_OFFICE_BUILDING_PRICE_INFO_#yearMonth# a
|
||||
inner join #InfoChg b
|
||||
on a.BuildingID_P = b.BuildingID_P
|
||||
left join ODS_OFFICE_BUILDING_PRICE_INFO_#lastYearMonth# c
|
||||
on a.BuildingID = c.BuildingID_P
|
||||
where (
|
||||
b.MainPriceChg = 1
|
||||
or b.MainPriceRentChg = 1
|
||||
)
|
||||
and a.Status = 1
|
||||
and c.Status = 1;
|
||||
from ODS_OFFICE_BUILDING_PRICE_INFO_#yearMonth# a
|
||||
inner join #InfoChg b
|
||||
on a.BuildingID_p = b.BuildingID_p
|
||||
left join ODS_OFFICE_BUILDING_PRICE_INFO_#lastYearMonth# c
|
||||
on a.BuildingID_p = c.BuildingID_p
|
||||
where (b.MainPriceChg=1 or b.MainPriceRentChg=1) and a.status=1 and c.Status=1;
|
||||
|
||||
update a
|
||||
set a.Status = 0
|
||||
from ODS_OFFICE_BUILDING_PRICE_INFO_#yearMonth# a
|
||||
left join #InfoChgCurr b
|
||||
on a.BuildingID_P = b.BuildingID_P
|
||||
where b.BuildingID_P is not null
|
||||
and a.Status = 1;
|
||||
left join #InfoChgCurr b
|
||||
on a.BuildingID_p = b.BuildingID_p
|
||||
where b.BuildingID_p is not null and a.status=1;
|
||||
|
||||
insert into dbo.ODS_OFFICE_BUILDING_PRICE_INFO_#yearMonth#
|
||||
(
|
||||
ID
|
||||
id
|
||||
, BuildingID
|
||||
, UnifiedID
|
||||
, ProjectID
|
||||
, BuildingID_P
|
||||
, ProjectID_P
|
||||
, MainPrice
|
||||
@ -189,76 +146,62 @@ insert into dbo.ODS_OFFICE_BUILDING_PRICE_INFO_#yearMonth#
|
||||
, Status
|
||||
, BuildingStd
|
||||
, AdjEvd
|
||||
, MainPrice_1
|
||||
, MainPriceRent_1
|
||||
, AreaCoff
|
||||
, YearCoff
|
||||
, BuildingCoff
|
||||
, ProjectName
|
||||
, ProjectAddr
|
||||
, BuildingAddr
|
||||
, County
|
||||
, Loop
|
||||
, Block
|
||||
, Street
|
||||
, Year
|
||||
, AvgArea
|
||||
, TotalFloorSum
|
||||
, UpperFloorSum
|
||||
, OfficeClass
|
||||
, Grade
|
||||
)
|
||||
select newid()
|
||||
, UnifiedID
|
||||
, BuildingID_P
|
||||
, ProjectID_P
|
||||
, MainPrice
|
||||
, MainPriceRent
|
||||
, MainPricePst
|
||||
, MainPriceRentPst
|
||||
, MainPriceType
|
||||
, MainPriceRentType
|
||||
, getdate()
|
||||
, Status
|
||||
, BuildingStd
|
||||
, AdjEvd
|
||||
from #InfoChgCurr;
|
||||
|
||||
select
|
||||
newid()
|
||||
, BuildingID
|
||||
, UnifiedID
|
||||
, ProjectID
|
||||
, BuildingID_P
|
||||
, ProjectID_P
|
||||
, MainPrice
|
||||
, MainPriceRent
|
||||
, MainPricePst
|
||||
, MainPriceRentPst
|
||||
, MainPriceType
|
||||
, MainPriceRentType
|
||||
, ModifyDate
|
||||
, Status
|
||||
, BuildingStd
|
||||
, AdjEvd
|
||||
, MainPrice_1
|
||||
, MainPriceRent_1
|
||||
, AreaCoff
|
||||
, YearCoff
|
||||
, BuildingCoff
|
||||
, ProjectName
|
||||
, ProjectAddr
|
||||
, BuildingAddr
|
||||
, County
|
||||
, Loop
|
||||
, Block
|
||||
, Street
|
||||
, Year
|
||||
, AvgArea
|
||||
, TotalFloorSum
|
||||
, UpperFloorSum
|
||||
, OfficeClass
|
||||
, Grade
|
||||
from #InfoChgCurr
|
||||
|
||||
drop table #InfoChg;
|
||||
drop table #InfoChgLst;
|
||||
drop table #InfoChgCurr;
|
||||
|
||||
|
||||
-- 更新上月基价;
|
||||
update a
|
||||
set a.ITEM_MAINAREAPRICE = b.MainPrice_1
|
||||
from obpm_LianCheng_Data.dbo.TLK_基价信息 a
|
||||
join dbo.ODS_OFFICE_BUILDING_PRICE_INFO_#yearMonth# b
|
||||
on a.ITEM_AIRAID = b.ProjectID_P
|
||||
where a.ITEM_PROJECTTYPE = 2
|
||||
and a.ITEM_PRICETYPE = 1
|
||||
and a.ITEM_VALUEPOINT = '#lastMonth#'
|
||||
and b.Status = 1
|
||||
and b.BuildingStd = 1;
|
||||
|
||||
update a
|
||||
set a.ITEM_MAINAREAPRICE = b.MainPriceRent_1
|
||||
from obpm_LianCheng_Data.dbo.TLK_基价信息 a
|
||||
join dbo.ODS_OFFICE_BUILDING_PRICE_INFO_#yearMonth# b
|
||||
on a.ITEM_AIRAID = b.ProjectID_P
|
||||
where a.ITEM_PROJECTTYPE = 2
|
||||
and a.ITEM_PRICETYPE = 2
|
||||
and a.ITEM_VALUEPOINT = '#lastMonth#'
|
||||
and b.Status = 1
|
||||
and b.BuildingStd = 1
|
||||
|
||||
-- 插入本月新增信息;
|
||||
insert into obpm_LianCheng_Data.dbo.TLK_基价信息
|
||||
(LASTMODIFIED,FORMNAME,AUTHOR,AUTHOR_DEPT_INDEX,CREATED,FORMID,ISTMP,VERSIONS,APPLICATIONID,STATEINT,LASTMODIFIER,DOMAINID,AUDITORLIST,COAUDITORLIST,ID,ITEM_PriceID,ITEM_AIRAID,ITEM_PROJECTTYPE,ITEM_PRICETYPE,ITEM_STANDARDPRICE,ITEM_MAINAREAPRICE,ITEM_VALUEPOINT,ITEM_PRICEEXPLAIN,ITEM_UPDATEPERSON,ITEM_UPDATEDATE,ITEM_PRICECHG)
|
||||
select getdate(),'物业信息管理/基价信息','amQRUkvYQAsAec1JGLp','Os6qe4Pmq5viTO8lTnW',getdate(),'ybte0OakLV17UzAyoVU',0,1,'Ts7TykYmuEzzZgWhXHj',0,'amQRUkvYQAsAec1JGLp','BclzHtmfLQoAA5ICTb5','{}','{}',newid(),newid(),ProjectID_P,2,1,null,MainPrice,'#today#',AdjEvd,'李贺',getdate(),MainPricePst
|
||||
from dbo.ODS_OFFICE_BUILDING_PRICE_INFO_#yearMonth# a
|
||||
join obpm_LianCheng_Data.dbo.TLK_基价信息 b
|
||||
on a.ProjectID_P=b.ITEM_AIRAID and b.ITEM_VALUEPOINT='#today#' and b.ITEM_PRICETYPE=1
|
||||
where Status=1 and BuildingStd=1 and b.ID is null;
|
||||
|
||||
insert into obpm_LianCheng_Data.dbo.TLK_基价信息
|
||||
(LASTMODIFIED,FORMNAME,AUTHOR,AUTHOR_DEPT_INDEX,CREATED,FORMID,ISTMP,VERSIONS,APPLICATIONID,STATEINT,LASTMODIFIER,DOMAINID,AUDITORLIST,COAUDITORLIST,ID,ITEM_PriceID,ITEM_AIRAID,ITEM_PROJECTTYPE,ITEM_PRICETYPE,ITEM_STANDARDPRICE,ITEM_MAINAREAPRICE,ITEM_VALUEPOINT,ITEM_PRICEEXPLAIN,ITEM_UPDATEPERSON,ITEM_UPDATEDATE,ITEM_PRICECHG)
|
||||
select getdate(),'物业信息管理/基价信息','amQRUkvYQAsAec1JGLp','Os6qe4Pmq5viTO8lTnW',getdate(),'ybte0OakLV17UzAyoVU',0,1,'Ts7TykYmuEzzZgWhXHj',0,'amQRUkvYQAsAec1JGLp','BclzHtmfLQoAA5ICTb5','{}','{}',newid(),newid(),ProjectID_P,2,2,null,MainPriceRent,'#today#',AdjEvd,'李贺',getdate(),MainPriceRentPst
|
||||
from dbo.ODS_OFFICE_BUILDING_PRICE_INFO_#yearMonth# a
|
||||
join obpm_LianCheng_Data.dbo.TLK_基价信息 b
|
||||
on a.ProjectID_P=b.ITEM_AIRAID and b.ITEM_VALUEPOINT='#today#' and b.ITEM_PRICETYPE=2
|
||||
where Status=1 and BuildingStd=1 and b.ID is null;
|
||||
|
||||
-- 插入t_document
|
||||
insert into obpm_LianCheng_Data.dbo.T_DOCUMENT
|
||||
(ID,LASTMODIFIED,FORMNAME,AUTHOR,AUTHOR_DEPT_INDEX,CREATED,FORMID,ISTMP,VERSIONS,APPLICATIONID,STATEINT,LASTMODIFIER,DOMAINID,AUDITORLIST,COAUDITORLIST,MAPPINGID)
|
||||
SELECT a.ID,a.LASTMODIFIED,a.FORMNAME,a.AUTHOR,a.AUTHOR_DEPT_INDEX,a.CREATED,a.FORMID,a.ISTMP,a.VERSIONS,a.APPLICATIONID,a.STATEINT,a.LASTMODIFIER,a.DOMAINID,a.AUDITORLIST,a.COAUDITORLIST,a.ID
|
||||
from obpm_LianCheng_Data.dbo.TLK_基价信息 a
|
||||
left join obpm_LianCheng_Data.dbo.T_DOCUMENT b
|
||||
on a.ID = b.ID
|
||||
where a.ITEM_VALUEPOINT='#today#' and a.ITEM_PROJECTTYPE=2 and b.id is null;
|
||||
|
||||
-- 计算之前,更新上个月的价格;
|
||||
drop table #InfoChgLst;
|
||||
|
Reference in New Issue
Block a user