feat(每月作价):优化住宅售价计算

1. 成交案例下载和清洗
2. 挂牌案例下载、上传、清洗
3. 编写单元测试
4. 批量导入性能优化
This commit is contained in:
purple
2020-06-19 11:34:17 +08:00
parent 0d14af53ac
commit d7cd4e0b6d
35 changed files with 4378 additions and 820 deletions

View File

@ -163,6 +163,145 @@
, 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>