feature (办公作价): 推送作价数据

1. 创建案例表
2. 推送案例数据
3. 创建价格表(备份上期价格表)
4. 推送价格数据
This commit is contained in:
purple
2020-07-08 18:57:57 +08:00
parent 991f21a96d
commit 482fefebfd
16 changed files with 730 additions and 153 deletions

View File

@ -70,9 +70,9 @@ spring:
password: Lcdatacenter_888
calc:
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://139.196.201.83:1433;DatabaseName=CALC
username: purple
password: liancheng
url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=uv_calc
username: sa
password: Lcdatacenter_888
spider:
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://139.196.201.83:1433;DatabaseName=TEST

View File

@ -70,9 +70,9 @@ spring:
password: Lcdatacenter_888
calc:
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://139.196.201.83:1433;DatabaseName=CALC
username: purple
password: liancheng
url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=uv_calc
username: sa
password: Lcdatacenter_888
spider:
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://139.196.201.83:1433;DatabaseName=TEST

View File

@ -154,4 +154,54 @@
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
</update>
<!-- 汇总案例 -->
<select id="getOfficeAggregationCases" resultType="com.ruoyi.project.data.cases.domain.OfficeAggregationCase">
SELECT url as url
,title as title
,容积率 as floorAreaRatio
,总价售 as caseTotalPrice
,均价售 as caseUnitPrice
,楼盘名称 as name
,楼盘名称_M as name_m
,楼层 as caseFloor
,面积 as area
,物业费 as managementFee
,工位数 as seatCount
,地址 as address
,地铁 as metro
,发布时间 as publishDate
,房源编号 as sourceNo
,百度lng as lng
,百度lat as lat
,区域 as county
,分类 as catalog
,来源 as source
,等级 as level
,楼盘网址 as homePageUrl
,装修 as decoration
,类型 as type
,板块 as block
,挂牌中介 as agency
,月租金租 as rentOfMonthly
,标准租金租 as rentOfStandard
,更新时间 as updateDate
,得房率 as score
,总价 as totalPrice
,单价 as unitPrice
,BuildingID_P as buildingId
,ProjectID_P as communityId
,TotalFloorSum as totalFloor
,FloorCoff as floorCoefficient
,DecorationCoff as decorationCoefficient
,PriceAmend as priceAmend
,MainPrice_1 as mainPrice_1
,MainPriceRent_1 as mainPriceRent_1
,ListedPrice_1 as listedPrice_1
,ListedPriceRent_1 as listedPriceRent_1
,ListedPrice as listedPrice
,ListedPriceRent as listedPriceRent
,VOPP as vopp
,VOPPT as voppt
FROM dbo.DW_OFFICECASE_COMM_${yearMonth}
</select>
</mapper>

View File

@ -0,0 +1,279 @@
<?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.SyncOfficeAggregationCaseMapper">
<!-- 创建表 -->
<update id="createAggregationCaseTable">
<bind name="targetTableName" value="'dbo.DW_OFFICECASE_COMM_' + yearMonth"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
CREATE TABLE ${targetTableName}
(
ID int identity(1,1) NOT NULL,
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,
BuildingID_P bigint NULL,
ProjectID_P bigint NULL,
TotalFloorSum nvarchar (32) NULL,
FloorCoff decimal (7, 4) NULL,
DecorationCoff decimal (7, 4) NULL,
PriceAmend numeric (38, 12) NULL,
MainPrice_1 decimal (38, 6) NULL,
MainPriceRent_1 decimal (38, 6) NULL,
ListedPrice_1 decimal (38, 6) NULL,
ListedPriceRent_1 decimal (38, 6) NULL,
ListedPrice decimal (38, 6) NULL,
ListedPriceRent decimal (38, 6) NULL,
VOPP numeric (38, 6) NULL,
VOPPT nvarchar (32) NULL
)
</update>
<!--同步-->
<insert id="insertAggregationCase" parameterType="com.ruoyi.project.data.cases.domain.OfficeAggregationCase">
insert into dbo.DW_OFFICECASE_COMM_${yearMonth}
(
url
, title
, 容积率
, 总价售
, 均价售
, 楼盘名称
, 楼盘名称_M
, 楼层
, 面积
, 物业费
, 工位数
, 地址
, 地铁
, 发布时间
, 房源编号
, 百度lng
, 百度lat
, 区域
, 分类
, 来源
, 等级
, 楼盘网址
, 装修
, 类型
, 板块
, 挂牌中介
, 月租金租
, 标准租金租
, 更新时间
, 得房率
, 总价
, 单价
, BuildingID_P
, ProjectID_P
, TotalFloorSum
, FloorCoff
, DecorationCoff
, PriceAmend
, MainPrice_1
, MainPriceRent_1
, ListedPrice_1
, ListedPriceRent_1
, ListedPrice
, ListedPriceRent
, VOPP
, VOPPT
) values
(
#{url},
#{title},
#{floorAreaRatio},
#{caseTotalPrice},
#{caseUnitPrice},
#{name},
#{name_m},
#{caseFloor},
#{area},
#{managementFee},
#{seatCount},
#{address},
#{metro},
#{publishDate,jdbcType=DATE},
#{sourceNo},
#{lng},
#{lat},
#{county},
#{catalog},
#{source},
#{level},
#{homePageUrl},
#{decoration},
#{type},
#{block},
#{agency},
#{rentOfMonthly},
#{rentOfStandard},
#{updateDate,jdbcType=DATE},
#{score},
#{totalPrice},
#{unitPrice},
#{buildingId},
#{communityId},
#{totalFloor},
#{floorCoefficient},
#{decorationCoefficient},
#{priceAmend},
#{mainPrice_1},
#{mainPriceRent_1},
#{listedPrice_1},
#{listedPriceRent_1},
#{listedPrice},
#{listedPriceRent},
#{vopp},
#{voppt}
)
</insert>
<!--备份表-->
<update id="dumpPriceTable">
<bind name="targetTableName" value="'dbo.ODS_OFFICE_BUILDING_PRICE_INFO_' + yearMonth"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
select * into ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}_${operateDate}_bak from ${targetTableName}
</update>
<!--创建价格表-->
<update id="createPriceTable">
<bind name="targetTableName" value="'dbo.ODS_OFFICE_BUILDING_PRICE_INFO_' + yearMonth"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
create table ${targetTableName}(
id bigint identity 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>
<!--插入价格表-->
<update id="insertUltimatePriceTable" parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice">
insert into dbo.ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}
(
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
) values(
#{buildingId},
#{communityId},
#{mainPrice},
#{mainPriceRent},
#{mainPricePst},
#{mainPriceRentPst},
#{mainPriceType},
#{mainPriceRentType},
#{updateDate,jdbcType=DATE},
#{status},
#{standardBuilding},
#{adjustPriceComment},
#{mainPrice_1},
#{mainPriceRent_1},
#{areaCoefficient},
#{yearCoefficient},
#{buildingCoefficient},
#{communityName},
#{communityAddress},
#{buildingAddress},
#{countyName},
#{loopName},
#{blockName},
#{streetName},
#{year},
#{avgArea},
#{totalFloorSum},
#{upperFloorSum},
#{officeClass},
#{officeLevel}
)
</update>
</mapper>

View File

@ -333,4 +333,41 @@
<update id="clearArtificialTable">
truncate table DWA_PROJECTBASEPRICE_OFFICE_MANU_${yearMonth}
</update>
<update id="clearPriceTable">
truncate table ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}
</update>
<select id="getUltimateOfficeBasePrices" resultType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice">
SELECT BuildingID_P as buildingId
,ProjectID_P as communityId
,MainPrice as mainPrice
,MainPriceRent as mainPriceRent
,MainPricePst as mainPricePst
,MainPriceRentPst as mainPriceRentPst
,MainPriceType as mainPriceType
,MainPriceRentType as mainPriceRentType
,ModifyDate as updateDate
,Status as status
,BuildingStd as standardBuilding
,AdjEvd as adjustPriceComment
,MainPrice_1 as mainPrice_1
,MainPriceRent_1 as mainPriceRent_1
,AreaCoff as areaCoefficient
,YearCoff as yearCoefficient
,BuildingCoff as buildingCoefficient
,ProjectName as communityName
,ProjectAddr as communityAddress
,BuildingAddr as buildingAddress
,County as countyName
,Loop as loopName
,Block as blockName
,Street as streetName
,Year as year
,AvgArea as avgArea
,TotalFloorSum as totalFloorSum
,UpperFloorSum as upperFloorSum
,OfficeClass as officeClass
,Grade as officeLevel,
${yearMonth} as yearMonth
FROM dbo.ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}
</select>
</mapper>

View File

@ -16,7 +16,7 @@ on a.BuildingID_p = c.BuildingID_p and c.status=1 and (
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 is not null;
--
-- 上期价格变化
select a.BuildingID, a.UnifiedID, a.ProjectID, a.BuildingID_P, a.ProjectID_P, b.MainPrice_1 as MainPrice, b.MainPriceRent_1 as MainPriceRent,
a.MainPricePst, a.MainPriceRentPst,
a.MainPriceType, a.MainPriceRentType, b.ModifyDate, 1 as Status, a.BuildingStd,
@ -126,7 +126,8 @@ from #InfoChgLst;
--
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,
((b.MainPrice*1.0/c.MainPrice) - 1) as MainPricePst,
((b.MainPriceRent*1.0/c.MainPriceRent) - 1) 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
, c.MainPrice_1