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

1. 创建案例表
2. 推送案例数据
3. 创建价格表(备份上期价格表)
4. 推送价格数据
This commit is contained in:
purple
2020-07-09 11:18:08 +08:00
parent 482fefebfd
commit 2b28b51717
8 changed files with 205 additions and 165 deletions

View File

@ -154,54 +154,102 @@
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
</update>
<resultMap id="AggregationCaseResultMapping" type="com.ruoyi.project.data.cases.domain.OfficeAggregationCase">
<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="name_m" column="楼盘名称_M"/>
<result property="caseFloor" column="楼层"/>
<result property="area" column="面积"/>
<result property="managementFee" column="物业费"/>
<result property="seatCount" column="工位数"/>
<result property="address" column="地址"/>
<result property="metro" column="地铁"/>
<result property="publishDate" column="发布时间" jdbcType="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="updateDate" column="更新时间" jdbcType="DATE"/>
<result property="score" column="得房率"/>
<result property="totalPrice" column="总价"/>
<result property="unitPrice" column="单价"/>
<result property="buildingId" column="BuildingID_P"/>
<result property="communityId" column="ProjectID_P"/>
<result property="totalFloor" column="TotalFloorSum"/>
<result property="floorCoefficient" column="FloorCoff"/>
<result property="decorationCoefficient" column="DecorationCoff"/>
<result property="priceAmend" column="PriceAmend"/>
<result property="mainPrice_1" column="MainPrice_1"/>
<result property="mainPriceRent_1" column="MainPriceRent_1"/>
<result property="listedPrice_1" column="ListedPrice_1"/>
<result property="listedPriceRent_1" column="ListedPriceRent_1"/>
<result property="listedPrice" column="ListedPrice"/>
<result property="listedPriceRent" column="ListedPriceRent"/>
<result property="vopp" column="VOPP"/>
<result property="voppt" column="VOPPT"/>
</resultMap>
<!-- 汇总案例 -->
<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
<select id="getOfficeAggregationCases" resultMap="AggregationCaseResultMapping">
SELECT 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
FROM dbo.DW_OFFICECASE_COMM_${yearMonth}
</select>
</mapper>

View File

@ -162,21 +162,28 @@
</insert>
<!--备份表-->
<update id="dumpPriceTable">
<bind name="backUpTableName" value="'dbo.ODS_OFFICE_BUILDING_PRICE_INFO_' + yearMonth+'_'+operateDate+'_bak'"/>
<bind name="targetTableName" value="'dbo.ODS_OFFICE_BUILDING_PRICE_INFO_' + yearMonth"/>
IF OBJECT_ID(#{backUpTableName}, 'U') IS NOT NULL
drop table ${backUpTableName}
select * into ${backUpTableName} from ${targetTableName}
</update>
<update id="clearPriceTable">
<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}
truncate table ${targetTableName}
</update>
<!--创建价格表-->
<update id="createPriceTable">
<update id="createUltimatePriceTable">
<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,
BuildingID bigint null,
UnifiedID bigint null,
ProjectID bigint not null,
ProjectID bigint null,
BuildingID_P nvarchar(20) not null,
ProjectID_P bigint null,
MainPrice decimal(38, 6) null,
@ -243,6 +250,9 @@
, UpperFloorSum
, OfficeClass
, Grade
, BuildingID
, ProjectID
, UnifiedID
) values(
#{buildingId},
#{communityId},
@ -273,7 +283,10 @@
#{totalFloorSum},
#{upperFloorSum},
#{officeClass},
#{officeLevel}
#{officeLevel},
#{deprecatedBuildingId},
#{deprecatedCommunityId},
#{unifiedId}
)
</update>
</mapper>

View File

@ -16,7 +16,7 @@
<result property="mainPriceRentPst" column="MainPriceRentPst"/>
<result property="mainPriceType" column="MainPriceType"/>
<result property="mainPriceRentType" column="MainPriceRentType"/>
<result property="updateDate" column="ModifyDate"/>
<result property="updateDate" column="ModifyDate" jdbcType="DATE"/>
<result property="status" column="Status"/>
<result property="standardBuilding" column="BuildingStd"/>
<result property="adjustPriceComment" column="AdjEvd"/>
@ -38,10 +38,16 @@
<result property="officeLevel" column="Grade"/>
<result property="mainPrice_1" column="mainPrice_1"/>
<result property="mainPriceRent_1" column="mainPriceRent_1"/>
<result property="deprecatedBuildingId" column="BuildingID"/>
<result property="deprecatedCommunityId" column="ProjectID"/>
<result property="unifiedId" column="UnifiedID"/>
</resultMap>
<sql id="getById">
SELECT a.ID
,a.BuildingID
,a.ProjectID
,a.UnifiedID
,a.BuildingID_P
,a.ProjectID_P
,a.MainPrice
@ -336,38 +342,42 @@
<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
<select id="getUltimateOfficeBasePrices" resultMap="OfficeBasePriceUltimateResult">
SELECT id
, BuildingID
, ProjectID
, UnifiedID
,BuildingID_P
,ProjectID_P
,MainPrice
,MainPriceRent
,MainPricePst
,MainPriceRentPst
,MainPriceType
,MainPriceRentType
,ModifyDate
,Status
,BuildingStd
,AdjEvd
,AreaCoff
,YearCoff
,BuildingCoff
,ProjectName
,ProjectAddr
,BuildingAddr
,County
,Loop
,Block
,Street
,Year
,AvgArea
,TotalFloorSum
,UpperFloorSum
,OfficeClass
,Grade
,MainPrice_1
,MainPriceRent_1
,${yearMonth} as yearMonth
FROM dbo.ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}
</select>
</mapper>