feature (办公基价迁移): 完成办公计价迁移

1. 办公案例下载
2. 办公案例清洗
3. 办公基价计算
4. 办公基价导入
5. 物业基价菜单调整
6. 住宅租赁挂牌案例下载
7. 住宅租赁案例清洗
This commit is contained in:
purple 2020-07-03 18:52:11 +08:00
parent 0ace1f040f
commit 706dddeedd
43 changed files with 1759 additions and 681 deletions

View File

@ -3,7 +3,7 @@ import request from '@/utils/request'
// 查询住宅销售基价修正列表
export function list(query) {
return request({
url: '/data/sale-price/residence/ultimate/list',
url: '/data/sale-price/residence/artificial/list',
method: 'get',
params: query
})
@ -12,7 +12,7 @@ export function list(query) {
// 查询住宅销售基价修正详细
// export function get(id) {
// return request({
// url: '/data/sale-price/residence/ultimate/' + id,
// url: '/data/sale-price/residence/artificial/' + id,
// method: 'get'
// })
// }
@ -20,7 +20,7 @@ export function list(query) {
// // 修改住宅销售基价修正
// export function update(data) {
// return request({
// url: '/data/sale-price/residence/ultimate',
// url: '/data/sale-price/residence/artificial',
// method: 'put',
// data: data
// })
@ -29,7 +29,7 @@ export function list(query) {
// 导出住宅销售基价修正
export function export2File(query) {
return request({
url: '/data/sale-price/residence/ultimate/export',
url: '/data/sale-price/residence/artificial/export',
method: 'get',
params: query
})
@ -37,7 +37,7 @@ export function export2File(query) {
export function getYearMonthList() {
return request({
url: '/data/sale-price/residence/ultimate/yearmonth',
url: '/data/sale-price/residence/artificial/yearmonth',
method: 'get'
})
}

View File

@ -41,3 +41,17 @@ export function getYearMonthList() {
method: 'get'
})
}
export function getBlockChange(yearmonth) {
return request({
url: '/data/sale-price/residence/compute/block-change/' + yearmonth,
method: 'get'
})
}
export function getCountyChange(yearmonth) {
return request({
url: '/data/sale-price/residence/compute/county-change/' + yearmonth,
method: 'get'
})
}

View File

@ -1,17 +1,17 @@
<template>
<div class="app-container">
<el-form :model="queryParams" :rules="rules" ref="queryForm" :inline="true" label-width="100px">
<el-form-item label="联城小区ID" prop="communityId" clearable>
<el-form-item label="小区ID" prop="communityId" clearable>
<el-input
v-model="queryParams.communityId"
placeholder="请输入案例小区名称"
placeholder="请输入案例小区ID"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="小区类型" prop="communityType" clearable>
<el-select v-model="queryParams.communityType" placeholder="请输入小区类型">
<el-form-item label="项目类型" prop="communityType" clearable>
<el-select v-model="queryParams.communityType" placeholder="请选择项目类型">
<el-option
v-for="item in communityTypeOptions"
:value="item.value"
@ -21,7 +21,7 @@
</el-select>
</el-form-item>
<el-form-item label="价格类型" prop="priceType" clearable>
<el-select v-model="queryParams.priceType" placeholder="请输入价格类型">
<el-select v-model="queryParams.priceType" placeholder="请选择价格类型">
<el-option
v-for="item in priceTypeOptions"
:value="item.value"
@ -47,17 +47,7 @@
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:user:edit']"
>修改</el-button>
</el-col>-->
<!-- <el-col :span="1.5">
<el-col :span="1.5">
<el-button
type="warning"
icon="el-icon-download"
@ -66,15 +56,6 @@
v-hasPermi="['system:user:export']"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
icon="el-icon-upload2"
size="mini"
@click="handleImport"
v-hasPermi="['system:user:import']"
>导入</el-button>
</el-col>-->
</el-row>
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
@ -86,12 +67,6 @@
<el-tag size="big" type="success" v-if="2 == scope.row.communityType">办公</el-tag>
</template>
</el-table-column>
<!-- <el-table-column
label=""
align="center"
prop=""
:formatter="priceTypeFormatter"
/> -->
<el-table-column label="价格类型" align="center" prop="priceType">
<template slot-scope="scope">
<el-tag size="big" v-if="1 == scope.row.priceType">售价</el-tag>
@ -101,117 +76,15 @@
<el-table-column label="价值时点" align="center" prop="valuePoint" />
<el-table-column label="标准基价" align="center" prop="standardPrice" />
<el-table-column label="主力面积基价" align="center" prop="mainAreaPrice" />
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:user:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:user:remove']"
>删除</el-button>
</template>
</el-table-column>-->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:page.sync="queryParams.pageIndex"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改办公基价对话框 -->
<!-- <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="160px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="小区ID">
<el-input v-model="form.communityId" disabled="true" readonly />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="楼栋ID">
<el-input v-model="form.buildingId" disabled="true" readonly />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="主力基价(元/㎡)">
<el-input v-model="form.mainPrice" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="主力租金(元/月·㎡)">
<el-input v-model="form.mainPriceRent" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="主力基价涨跌幅">
<el-input v-model="form.mainPricePst" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="主力租金涨跌幅">
<el-input v-model="form.mainPriceRentPst" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="主力基价类型">
<el-input v-model="form.mainPriceType" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="主力租金类型">
<el-input v-model="form.mainPriceRentType" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处
<em>点击上传</em>
</div>
<div class="el-upload__tip" style="color:red" slot="tip">提示仅允许导入xlsxlsx格式文件</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>-->
</div>
</template>
@ -262,7 +135,7 @@ export default {
communityType: undefined,
priceType: undefined,
valuePoint: undefined,
pageNum: 1,
pageIndex: 1,
pageSize: 10
},
yearMonthList: [],
@ -301,9 +174,6 @@ export default {
},
created() {
this.loading = false;
// getYearMonthList().then(response => {
// this.yearMonthList = response.data;
// });
},
methods: {
priceTypeFormatter: function(row, column, cellValue, index) {
@ -365,7 +235,7 @@ export default {
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.queryParams.pageIndex = 1;
this.getList();
},
/** 重置按钮操作 */
@ -379,12 +249,6 @@ export default {
this.single = selection.length != 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
// handleAdd() {
// this.reset();
// this.open = true;
// this.title = "";
// },
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
@ -409,16 +273,6 @@ export default {
this.msgError(response.msg);
}
});
} else {
// addUltimate(this.form).then(response => {
// if (response.code === 200) {
// this.msgSuccess("");
// this.open = false;
// this.getList();
// } else {
// this.msgError(response.msg);
// }
// });
}
}
});
@ -426,7 +280,7 @@ export default {
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有住宅租赁基价数据项?", "警告", {
this.$confirm("确认导出物业基价?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"

View File

@ -45,6 +45,24 @@
v-hasPermi="['system:user:export']"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-s-data"
size="mini"
@click="queryBlockChart"
v-hasPermi="['system:user:list']"
>板块涨跌幅</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-s-data"
size="mini"
@click="queryCountyChart"
v-hasPermi="['system:user:list']"
>区域涨跌幅</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
@ -120,24 +138,6 @@
<el-table-column label="绑定板块+小区类型的涨跌幅" align="center" prop="bindBlockProjectTypePst" />
<el-table-column label="绑定区县+小区类型" align="center" prop="bindCountyProjectType" />
<el-table-column label="绑定区县+小区类型的涨跌幅" align="center" prop="bindCountyProjectTypePst" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:user:edit']"
>修改</el-button>
<!-- <el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:user:remove']"
>删除</el-button>-->
</template>
</el-table-column>
</el-table>
<pagination
@ -147,17 +147,25 @@
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<el-dialog :title="changeChart.title" :visible.sync="changeChart.open" append-to-body>
<line-chart :chart-data="changeChart" />
</el-dialog>
</div>
</template>
<script>
import { getToken } from "@/utils/auth";
import LineChart from "./DistrictBlockChangeChart";
import {
list,
get,
update,
export2File,
getYearMonthList
getYearMonthList,
getBlockChange,
getCountyChange
} from "@/api/data/computeResidenceSalePrice";
export default {
@ -191,6 +199,15 @@ export default {
title: "",
//
open: false,
//
blockChart: null,
changeChart: {
title: "",
graph: null,
open: false,
name: [],
value: []
},
//
queryParams: {
yearMonth: undefined,
@ -235,7 +252,16 @@ export default {
this.yearMonthList = response.data;
});
},
components: {
LineChart
},
methods: {
initChart() {
console.log(document.getElementById("main"));
echarts.init(document.getElementById("main"));
console.log("====>");
console.log(this.blockChart);
},
yesOrNotFormatter: function(row, column, cellValue, index) {
if (cellValue) return "是";
return "否";
@ -321,16 +347,6 @@ export default {
this.msgError(response.msg);
}
});
} else {
// addUltimate(this.form).then(response => {
// if (response.code === 200) {
// this.msgSuccess("");
// this.open = false;
// this.getList();
// } else {
// this.msgError(response.msg);
// }
// });
}
}
});
@ -374,6 +390,43 @@ export default {
//
submitFileForm() {
this.$refs.upload.submit();
},
//
queryBlockChart() {
this.$refs["queryForm"].validate(valid => {
if (valid) {
getBlockChange(this.queryParams.yearMonth).then(response => {
var name = new Array();
var value = new Array();
for (var i = 0; i < response.data.length; i++) {
name.push(response.data[i]["name"]);
value.push(response.data[i]["value"]);
}
this.changeChart.name = name;
this.changeChart.value = value;
});
this.changeChart.open = true;
this.changeChart.title = "板块涨跌幅";
}
});
},
queryCountyChart() {
this.$refs["queryForm"].validate(valid => {
if (valid) {
getCountyChange(this.queryParams.yearMonth).then(response => {
var name = new Array();
var value = new Array();
for (var i = 0; i < response.data.length; i++) {
name.push(response.data[i]["name"]);
value.push(response.data[i]["value"]);
}
this.changeChart.name = name;
this.changeChart.value = value;
this.changeChart.title = "区域涨跌幅";
});
this.changeChart.open = true;
}
});
}
}
};

View File

@ -0,0 +1,86 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import echarts from "echarts";
require("echarts/theme/macarons"); // echarts theme
export default {
props: {
className: {
type: String,
default: "chart"
},
width: {
type: String,
default: "100%"
},
height: {
type: String,
default: "400px"
},
autoResize: {
type: Boolean,
default: true
},
chartData: {
type: Object,
required: true
}
},
data() {
return {
chart: null
};
},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val);
}
}
},
mounted() {
this.$nextTick(() => {
this.initChart();
});
},
beforeDestroy() {
if (!this.chart) {
return;
}
this.chart.dispose();
this.chart = null;
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, "macarons");
this.setOptions(this.chartData);
},
setOptions({ name, value } = {}) {
this.chart.setOption({
xAxis: {
type: "category",
data: name,
axisLabel: {
formatter: function(value) {
return value.split("").join("\n");
}
}
},
yAxis: {
type: "value"
},
series: [
{
data: value,
type: "line"
}
]
});
}
}
};
</script>

View File

@ -18,16 +18,16 @@
<el-form-item label="联城小区ID" prop="communityId" clearable>
<el-input
v-model="queryParams.communityId"
placeholder="请输入案例小区名称"
placeholder="请输入案例小区ID"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="联城楼栋ID" prop="buildingId" clearable>
<el-form-item label="名称或地址" prop="nameOrAddress" clearable>
<el-input
v-model="queryParams.buildingId"
placeholder="请输入联城楼栋ID"
v-model="queryParams.nameOrAddress"
placeholder="请输入名称或地址"
clearable
size="small"
@keyup.enter.native="handleQuery"
@ -39,6 +39,12 @@
<el-option label="失效" value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item label="标准楼栋">
<el-select v-model="queryParams.standardBuilding" clearable>
<el-option label="是" value="1"></el-option>
<el-option label="否" value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -62,7 +68,7 @@
size="mini"
@click="handleImport"
v-hasPermi="['system:user:import']"
>导入</el-button>
>文件导入</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button
@ -76,9 +82,9 @@
</el-row>
<el-table v-loading="loading" :data="dataList">
<el-table-column label="年月" align="center" prop="yearMonth" />
<el-table-column label="小区ID" align="center" prop="communityId" width="110" />
<el-table-column label="楼栋ID" align="center" prop="buildingId" width="110" />
<el-table-column label="年月" align="center" prop="yearMonth" fixed />
<el-table-column label="小区ID" align="center" prop="communityId" width="110" fixed />
<el-table-column label="楼栋ID" align="center" prop="buildingId" width="110" fixed />
<el-table-column label="项目名称" align="center" prop="communityName" />
<el-table-column label="办公项目地址" align="center" prop="communityAddress" />
<el-table-column label="楼栋地址" align="center" prop="buildingAddress" />
@ -293,7 +299,7 @@
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url"
:action="upload.url+ '/' + queryParams.yearMonth "
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
@ -380,14 +386,12 @@ export default {
queryParams: {
yearMonth: undefined,
communityId: undefined,
buildingId: undefined,
nameOrAddress: undefined,
status: undefined,
standardBuilding: undefined,
pageNum: 1,
pageSize: 10
},
statusOptions: [
{ value: 1, text: "正常" },
{ value: 1, text: "失效" }
],
upload: {
//
open: false,
@ -442,8 +446,8 @@ export default {
},
methods: {
yearMonthChange: function(yearMonth) {
this.upload.url += "/" + yearMonth;
console.log(this.upload.url);
// this.upload.url += "/" + yearMonth;
// console.log(this.upload.url);
},
regionFormatter: function(row, column, cellValue, index) {
// --线-

View File

@ -0,0 +1,58 @@
-- create type dbo.DWA_PROJECTBASEPRICE_OFFICE_MANU_Table as table(
-- BuildingID bigint NOT NULL,
-- ProjectID bigint NULL,
-- County nvarchar (512) NULL,
-- Loop nvarchar (512) NULL,
-- Block nvarchar (512) NULL,
-- ProjectAddr nvarchar (1024) NULL,
-- ProjectName nvarchar (1024) 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,
-- MainPrice_1 decimal (18, 2) NULL,
-- MainPriceRent_1 decimal (18, 2) NULL,
-- MainPrice decimal (18, 2) NULL,
-- MainPriceRent decimal (18, 2) NULL,
-- ModifyDate date NULL
-- )
-- go
create type dbo.DWA_PROJECTBASEPRICE_OFFICE_MANU_Table as table
(
BuildingID nvarchar(20) null
, UnifiedID nvarchar(20) null
, ProjectID nvarchar(20) null
, BuildingID_P nvarchar(20) not null
, ProjectID_P nvarchar(20) 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 not null
, Status bit not null
, BuildingStd bit null
, AdjEvd nvarchar(1000) null
, MainPrice_1 decimal(18, 6) null
, MainPriceRent_1 decimal(18, 6) null
, AreaCoff decimal(18, 6) null
, YearCoff decimal(18, 6) null
, BuildingCoff decimal(18, 6) null
, ProjectName nvarchar(200) null
, ProjectAddr nvarchar(200) null
, BuildingAddr nvarchar(200) null
, County nvarchar(200) null
, Loop nvarchar(200) null
, Block nvarchar(200) null
, Street nvarchar(200) null
, Year int null
, AvgArea decimal(10, 2) null
, TotalFloorSum nvarchar(50) null
, UpperFloorSum nvarchar(50) null
, OfficeClass nvarchar(50) null
, Grade nvarchar(50) null
)
go

View File

@ -2,6 +2,7 @@ package com.ruoyi.project.data.basis.domain;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;
@ -12,33 +13,40 @@ public class UVBasePrice extends BaseEntity {
/**
* 小区id
*/
@Excel(name = "小区ID")
private String communityId;
/**
* 价格类型
*/
@Excel(name = "价格类型")
private Integer priceType;
/**
* 小区类型(1住宅2办公)
*/
@Excel(name = "项目类型")
private Integer communityType;
/**
* 基价售价租金
*/
@Excel(name = "主力基价", cellType = Excel.ColumnType.NUMERIC)
private BigDecimal standardPrice;
/**
* 主力面积基价售价租金
*/
@Excel(name = "主力面积基价", cellType = Excel.ColumnType.NUMERIC)
private BigDecimal mainAreaPrice;
/**
* 价值时点
*/
@JsonFormat(pattern="yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "价值时点", dateFormat = "yyyy-MM-dd")
private Date valuePoint;
/**
* 修改说明
*/
@Excel(name = "价格说明")
private String comment;
public String getCommunityId() {

View File

@ -40,7 +40,7 @@ public class OriginalOfficeCase {
/**
* 面积
*/
private String area;
private BigDecimal area;
/**
* 物业费
*/
@ -128,6 +128,10 @@ public class OriginalOfficeCase {
* 单价
*/
private BigDecimal unitPrice;
/**
* 更新时间
*/
private Date updateDate;
public String getUrl() {
return url;
@ -193,11 +197,11 @@ public class OriginalOfficeCase {
this.caseFloor = caseFloor;
}
public String getArea() {
public BigDecimal getArea() {
return area;
}
public void setArea(String area) {
public void setArea(BigDecimal area) {
this.area = area;
}
@ -384,4 +388,12 @@ public class OriginalOfficeCase {
public void setUnitPrice(BigDecimal unitPrice) {
this.unitPrice = unitPrice;
}
public Date getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
}

View File

@ -0,0 +1,17 @@
package com.ruoyi.project.data.cases.domain;
import org.springframework.util.DigestUtils;
import java.math.BigDecimal;
/**
* 租赁挂牌案例
*/
public class OriginalResidencePlatformRentOpeningCase extends OriginalResidenceRentOpeningCase {
@Override
public String getNewCaseId() {
return DigestUtils.md5DigestAsHex(getCaseUrl().getBytes());
}
}

View File

@ -9,7 +9,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* 租赁数据
* 租赁挂牌案例
*/
public class OriginalResidenceRentOpeningCase extends OriginalResidenceSaleOpeningCase {
@ -17,6 +17,10 @@ public class OriginalResidenceRentOpeningCase extends OriginalResidenceSaleOpeni
* 外部案例编号
*/
private String caseNo;
/**
* 案例匹配小区id
*/
private String cleanCommunityId;
/**
* 总面积
*/
@ -121,4 +125,12 @@ public class OriginalResidenceRentOpeningCase extends OriginalResidenceSaleOpeni
public void setCaseRoomNum(Integer caseRoomNum) {
this.caseRoomNum = caseRoomNum;
}
public String getCleanCommunityId() {
return cleanCommunityId;
}
public void setCleanCommunityId(String cleanCommunityId) {
this.cleanCommunityId = cleanCommunityId;
}
}

View File

@ -627,10 +627,6 @@ public class OriginalResidenceSaleOpeningCase {
this.caseLastDeal = caseLastDeal;
}
public void setNewCaseId(String newCaseId) {
this.newCaseId = newCaseId;
}
/**
* 生成caseid根据caseid来确定唯一案例还有案例来源
*
@ -639,7 +635,6 @@ public class OriginalResidenceSaleOpeningCase {
public String getNewCaseId() {
return DigestUtils.md5DigestAsHex(getCaseLianJiaId().getBytes());
}
public Integer getYearMonth() {
return yearMonth;
}
@ -743,6 +738,8 @@ public class OriginalResidenceSaleOpeningCase {
}
}
@Override
public String toString() {
return "OriginalResidenceOpeningCase{" +

View File

@ -1,6 +1,7 @@
package com.ruoyi.project.data.cases.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import org.apache.ibatis.annotations.Param;
@DS("compute")
public interface OriginalOfficeCaseMapper {
@ -9,12 +10,22 @@ public interface OriginalOfficeCaseMapper {
*
* @param yearMonth
*/
void createTable(Integer yearMonth);
void createTable(@Param("yearMonth") Integer yearMonth);
/**
* 创建人工修正表
*
* @param yearMonth
*/
void createArtificialTable(Integer yearMonth);
void createArtificialTable(@Param("yearMonth") Integer yearMonth);
/**
* 创建案例汇总表
*
* @param yearMonth
*/
void createAssembleTable(@Param("yearMonth") Integer yearMonth);
void initAssembleTable(@Param("yearMonth") Integer yearMonth);
void initPriceTable(@Param("yearMonth") Integer yearMonth);
}

View File

@ -26,6 +26,14 @@ public interface OriginalResidenceRentOpeningCaseMapper {
*/
int createCleanTable(@Param("yearMonth") Integer yearMonth);
/**
* 租赁平台案例
*
* @param yearMonth
* @return
*/
int createPlatformCaseTable(@Param("yearMonth") Integer yearMonth);
/**
* 案例汇总表挂牌成交
*

View File

@ -1,8 +1,11 @@
package com.ruoyi.project.data.cases.mapper.sync;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.ruoyi.project.data.cases.domain.OriginalResidencePlatformRentOpeningCase;
import com.ruoyi.project.data.cases.domain.OriginalResidenceRentOpeningCase;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
@DS("spider")
@ -11,5 +14,5 @@ public interface DownloadOriginalResidenceRentPlatformCaseMapper {
/**
* @return
*/
List<OriginalResidenceRentOpeningCase> download();
List<OriginalResidencePlatformRentOpeningCase> download(@Param("startDate") Date startDate, @Param("endDate") Date endDate);
}

View File

@ -1,10 +1,13 @@
package com.ruoyi.project.data.cases.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.ruoyi.common.utils.LoadUtil;
import com.ruoyi.project.data.cases.domain.OriginalOfficeCase;
import com.ruoyi.project.data.cases.mapper.OriginalOfficeCaseMapper;
import com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalOfficeCaseMapper;
import com.ruoyi.project.data.cases.service.IOriginalOfficeCaseService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
@ -18,7 +21,11 @@ import java.util.Date;
import java.util.List;
@Service
@DS("compute")
public class OriginalOfficeCaseServiceImpl implements IOriginalOfficeCaseService {
private static Logger logger = LoggerFactory.getLogger(OriginalOfficeCaseServiceImpl.class);
@Autowired
private JdbcTemplate jdbcTemplate;
@Autowired
@ -46,6 +53,13 @@ public class OriginalOfficeCaseServiceImpl implements IOriginalOfficeCaseService
Integer yearMonth = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
calendar.get(Calendar.MONTH) + 1));
// yearMonth = 202007;
// lastYearMonth = 202006;
// calendar.set(2020, 5, 16);
// startDate = calendar.getTime();
// calendar.set(2020, 6, 16);
// endDate = calendar.getTime();
before(yearMonth, startDate, endDate);
running(yearMonth, lastYearMonth);
}
@ -59,16 +73,23 @@ public class OriginalOfficeCaseServiceImpl implements IOriginalOfficeCaseService
// 创建表
originalOfficeCaseMapper.createTable(yearMonth);
originalOfficeCaseMapper.createArtificialTable(yearMonth);
originalOfficeCaseMapper.initAssembleTable(yearMonth);
originalOfficeCaseMapper.initPriceTable(yearMonth);
// 下载列表
List<OriginalOfficeCase> downloadList = downloadOriginalOfficeCaseMapper.download(startDate, endDate);
SqlParameterSource[] batchParams = SqlParameterSourceUtils.createBatch(downloadList.toArray());
namedParameterJdbcTemplate.batchUpdate("insert into dbo.ODS_OFFICECASELISTED_" + yearMonth.toString() + "_RAW" +
"(url, title,容积率,总价售,均价售, 楼盘名称, 楼盘名称_M, 楼层, 面积, 物业费, 工位数, 地址, 地铁, 发布时间, 房源编号, 百度lng, 百度lat, 区域, 分类, " +
"来源, 等级, 楼盘网址, 装修,类型, 板块, 挂牌中介, 月租金租, 标准租金租, 得房率, 总价, 单价) values(:url,:title,:floorAreaRatio," +
"(case_id,url, title,容积率,总价售,均价售, 楼盘名称, 楼盘名称_M, 楼层, 面积, 物业费, 工位数, 地址, 地铁, 发布时间, 房源编号, 百度lng, 百度lat, " +
"区域, 分类, " +
"来源, 等级, 楼盘网址, 装修,类型, 板块, 挂牌中介, 月租金租, 标准租金租, 得房率, 总价, 单价,更新时间) values(replace(newid(),'-',''),:url," +
":title," +
":floorAreaRatio," +
":caseTotalPrice," +
":caseUnitPrice,:name,:name_m,:caseFloor,:area,:managementFee,:seatCount,:address,:metro," +
":publishDate,:sourceNo,:lng,:lat,:county,:catalog,:source,:level,:homePageUrl,:decoration," +
":type,:block,:agency,:rentOfMonthly,:rentOfStandard,:score,:totalPrice,:unitPrice) ", batchParams);
":type,:block,:agency,:rentOfMonthly,:rentOfStandard,:score,:totalPrice,:unitPrice,:updateDate) ",
batchParams);
}
private void running(Integer yearMonth, Integer lastYearMonth) {
@ -78,5 +99,6 @@ public class OriginalOfficeCaseServiceImpl implements IOriginalOfficeCaseService
.replace("#lastYearMonth#", lastYearMonth.toString());
jdbcTemplate.execute(sql);
logger.debug(sql);
}
}

View File

@ -1,111 +1,111 @@
//package com.ruoyi.project.data.cases.service.impl;
//
//import com.baomidou.dynamic.datasource.annotation.DS;
//import com.ruoyi.common.utils.LoadUtil;
//import com.ruoyi.project.data.cases.domain.OriginalResidenceSaleClosingCase;
//import com.ruoyi.project.data.cases.mapper.OriginalResidenceSaleClosingCaseMapper;
//import com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalResidenceSaleClosingCaseMapper;
//import com.ruoyi.project.data.cases.service.IOriginalResidenceRentClosingCaseService;
//import com.ruoyi.project.data.cases.service.IOriginalResidenceSaleClosingCaseService;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.jdbc.core.JdbcTemplate;
//import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
//import org.springframework.jdbc.core.namedparam.SqlParameterSource;
//import org.springframework.jdbc.core.namedparam.SqlParameterSourceUtils;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Service;
//
//import java.util.Calendar;
//import java.util.Date;
//import java.util.List;
//
//@Service
//@DS("compute")
//public class OriginalResidenceRentClosingCaseServiceImpl implements IOriginalResidenceRentClosingCaseService {
//
// private static Logger logger = LoggerFactory.getLogger(OriginalResidenceRentClosingCaseServiceImpl.class);
//
// @Autowired
// private OriginalResidenceSaleClosingCaseMapper originalResidenceSaleClosingCaseMapper;
// @Autowired
// private DownloadOriginalResidenceSaleClosingCaseMapper downloadOriginalResidenceSaleClosingCaseMapper;
// @Autowired
// private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
// @Autowired
// private JdbcTemplate jdbcTemplate;
//
// /**
// *
// */
// @Scheduled(cron = "0 0 5 9 * ?")
// @Override
// public void pullData() {
// Calendar calendar = Calendar.getInstance();
// calendar.setTime(new Date());
// Integer targetTableRoute = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
// calendar.get(Calendar.MONTH)));
// calendar.add(Calendar.MONTH, 1);
// Integer computeTableRoute = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
// calendar.get(Calendar.MONTH) + 1));
//
// prepare(computeTableRoute);
// List<OriginalResidenceSaleClosingCase> list =
// downloadOriginalResidenceSaleClosingCaseMapper.download(targetTableRoute);
// list.parallelStream().forEach(originalResidenceSaleClosingCase -> {
// originalResidenceSaleClosingCase.setCaseId(originalResidenceSaleClosingCase.generateCaseId());
//// originalResidenceSaleClosingCase.setCleanPropertyType(originalResidenceSaleClosingCase.refinePropertyType());
//// originalResidenceSaleClosingCase.setCleanCurrentFloor(originalResidenceSaleClosingCase
//// .refineCurrentFloor());
//// originalResidenceSaleClosingCase.setCleanBuildingAddress(originalResidenceSaleClosingCase
//// .refineBuildingAddress());
// });
// running(computeTableRoute, list);
//// after(computeTableRoute);
// }
//
// /**
// * 准备工作 创建表
// *
// * @param computeTableRoute
// */
// public void prepare(Integer computeTableRoute) {
// originalResidenceSaleClosingCaseMapper.createTable(computeTableRoute);
//// originalResidenceSaleClosingCaseMapper.createClosingCaseRawTable(computeTableRoute);
// originalResidenceSaleClosingCaseMapper.createCleanTable(computeTableRoute);
// }
//
// /**
// * 批量入库
// *
// * @param computeTableRoute
// * @param list
// */
// public void running(Integer computeTableRoute, List<OriginalResidenceSaleClosingCase> list) {
// SqlParameterSource[] batchParams = SqlParameterSourceUtils.createBatch(list.toArray());
// int[] updateCounts = namedParameterJdbcTemplate.batchUpdate("insert into dbo" +
// ".original_residence_sale_closing_case_" + computeTableRoute + "(case_id,case_county_name," +
// "case_block_name,case_loopline_name,case_community_name,case_address,case_area," +
// "case_unit_price,case_total_price,case_house_type,case_signing_date,case_register_date," +
// "case_agency_name,case_agency_type,case_seller_type,case_buyer_type,case_birthday," +
// "case_deal_type,clean_property_type,create_time) " +
// "values (:caseId,:caseCountyName,:caseBlockName,:caseLoopName,:caseCommunityName," +
// ":caseAddress,:caseArea,:caseUnitPrice,:caseTotalPrice,:caseHouseType,:caseSigningDate," +
// ":caseRegisterDate,:agencyName,:agencyType,:sellerType,:buyerType,:birthday," +
// ":cleanCaseType,:cleanPropertyType,GETDATE());",
// batchParams);
// }
//
// /**
// * 匹配数据
// *
// * @param yearMonth
// */
// public void after(Integer yearMonth) {
// // 清洗挂牌案例
// String rawSql = LoadUtil.loadContent("sql-template/clear_residence_sale_closing_case.sql");
// String sql = rawSql.replace("#yearMonth#", yearMonth.toString());
// jdbcTemplate.update(sql);
// }
//}
package com.ruoyi.project.data.cases.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.ruoyi.common.utils.LoadUtil;
import com.ruoyi.project.data.cases.domain.OriginalResidenceSaleClosingCase;
import com.ruoyi.project.data.cases.mapper.OriginalResidenceSaleClosingCaseMapper;
import com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalResidenceSaleClosingCaseMapper;
import com.ruoyi.project.data.cases.service.IOriginalResidenceRentClosingCaseService;
import com.ruoyi.project.data.cases.service.IOriginalResidenceSaleClosingCaseService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
import org.springframework.jdbc.core.namedparam.SqlParameterSourceUtils;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@Service
@DS("compute")
public class OriginalResidenceRentClosingCaseServiceImpl implements IOriginalResidenceRentClosingCaseService {
private static Logger logger = LoggerFactory.getLogger(OriginalResidenceRentClosingCaseServiceImpl.class);
@Autowired
private OriginalResidenceSaleClosingCaseMapper originalResidenceSaleClosingCaseMapper;
@Autowired
private DownloadOriginalResidenceSaleClosingCaseMapper downloadOriginalResidenceSaleClosingCaseMapper;
@Autowired
private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
@Autowired
private JdbcTemplate jdbcTemplate;
/**
*
*/
@Scheduled(cron = "0 0 5 9 * ?")
@Override
public void pullData() {
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
Integer targetTableRoute = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
calendar.get(Calendar.MONTH)));
calendar.add(Calendar.MONTH, 1);
Integer computeTableRoute = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
calendar.get(Calendar.MONTH) + 1));
prepare(computeTableRoute);
List<OriginalResidenceSaleClosingCase> list =
downloadOriginalResidenceSaleClosingCaseMapper.download(targetTableRoute);
list.parallelStream().forEach(originalResidenceSaleClosingCase -> {
originalResidenceSaleClosingCase.setCaseId(originalResidenceSaleClosingCase.generateCaseId());
// originalResidenceSaleClosingCase.setCleanPropertyType(originalResidenceSaleClosingCase.refinePropertyType());
// originalResidenceSaleClosingCase.setCleanCurrentFloor(originalResidenceSaleClosingCase
// .refineCurrentFloor());
// originalResidenceSaleClosingCase.setCleanBuildingAddress(originalResidenceSaleClosingCase
// .refineBuildingAddress());
});
running(computeTableRoute, list);
// after(computeTableRoute);
}
/**
* 准备工作 创建表
*
* @param computeTableRoute
*/
public void prepare(Integer computeTableRoute) {
originalResidenceSaleClosingCaseMapper.createTable(computeTableRoute);
// originalResidenceSaleClosingCaseMapper.createClosingCaseRawTable(computeTableRoute);
originalResidenceSaleClosingCaseMapper.createCleanTable(computeTableRoute);
}
/**
* 批量入库
*
* @param computeTableRoute
* @param list
*/
public void running(Integer computeTableRoute, List<OriginalResidenceSaleClosingCase> list) {
SqlParameterSource[] batchParams = SqlParameterSourceUtils.createBatch(list.toArray());
int[] updateCounts = namedParameterJdbcTemplate.batchUpdate("insert into dbo" +
".original_residence_sale_closing_case_" + computeTableRoute + "(case_id,case_county_name," +
"case_block_name,case_loopline_name,case_community_name,case_address,case_area," +
"case_unit_price,case_total_price,case_house_type,case_signing_date,case_register_date," +
"case_agency_name,case_agency_type,case_seller_type,case_buyer_type,case_birthday," +
"case_deal_type,clean_property_type,create_time) " +
"values (:caseId,:caseCountyName,:caseBlockName,:caseLoopName,:caseCommunityName," +
":caseAddress,:caseArea,:caseUnitPrice,:caseTotalPrice,:caseHouseType,:caseSigningDate," +
":caseRegisterDate,:agencyName,:agencyType,:sellerType,:buyerType,:birthday," +
":cleanCaseType,:cleanPropertyType,GETDATE());",
batchParams);
}
/**
* 匹配数据
*
* @param yearMonth
*/
public void after(Integer yearMonth) {
// 清洗挂牌案例
String rawSql = LoadUtil.loadContent("sql-template/clear_residence_sale_closing_case.sql");
String sql = rawSql.replace("#yearMonth#", yearMonth.toString());
jdbcTemplate.update(sql);
}
}

View File

@ -2,14 +2,12 @@ package com.ruoyi.project.data.cases.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.ruoyi.common.utils.LoadUtil;
import com.ruoyi.project.data.cases.domain.OriginalResidencePlatformRentOpeningCase;
import com.ruoyi.project.data.cases.domain.OriginalResidenceRentOpeningCase;
import com.ruoyi.project.data.cases.domain.OriginalResidenceSaleOpeningCase;
import com.ruoyi.project.data.cases.mapper.OriginalResidenceRentOpeningCaseMapper;
import com.ruoyi.project.data.cases.mapper.OriginalResidenceSaleOpeningCaseMapper;
import com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalResidenceRentOpeningCaseMapper;
import com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalResidenceSaleOpeningCaseMapper;
import com.ruoyi.project.data.cases.mapper.sync.SyncOriginalResidenceRentOpeningCaseMapper;
import com.ruoyi.project.data.cases.mapper.sync.SyncOriginalResidenceSaleOpeningCaseMapper;
import com.ruoyi.project.data.cases.mapper.sync.*;
import com.ruoyi.project.data.cases.service.IOriginalResidenceRentOpeningCaseService;
import com.ruoyi.project.data.cases.service.IOriginalResidenceSaleOpeningCaseService;
import org.slf4j.Logger;
@ -43,6 +41,8 @@ public class OriginalResidenceRentOpeningCaseServiceImpl implements IOriginalRes
private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
@Autowired
private JdbcTemplate jdbcTemplate;
@Autowired
private DownloadOriginalResidenceRentPlatformCaseMapper downloadOriginalResidenceRentPlatformCaseMapper;
/**
* 29号拉取挂牌案例
@ -57,22 +57,35 @@ public class OriginalResidenceRentOpeningCaseServiceImpl implements IOriginalRes
Integer lastYearMonth = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
calendar.get(Calendar.MONTH) + 1));
calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), 1);
Date valuePoint = calendar.getTime();
Date startDate = calendar.getTime();
calendar.add(Calendar.MONTH, 1);
Integer computeTableRoute = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
calendar.get(Calendar.MONTH) + 1));
Date endDate = calendar.getTime();
computeTableRoute = 202007;
lastYearMonth = 202006;
syncTableRoute = 202005;
calendar.set(2020, 5, 15);
startDate = calendar.getTime();
calendar.set(2020, 6, 15);
endDate = calendar.getTime();
prepare(computeTableRoute, syncTableRoute);
List<OriginalResidenceRentOpeningCase> list = downloadOriginalResidenceRentOpeningCaseMapper.download();
list.parallelStream().forEach(originalResidenceOpeningCase -> {
// originalResidenceOpeningCase.clear();
originalResidenceOpeningCase.setYearMonth(syncTableRoute);
syncOriginalResidenceRentOpeningCaseMapper.insert(originalResidenceOpeningCase);
});
List<OriginalResidencePlatformRentOpeningCase> platformCaseList =
downloadOriginalResidenceRentPlatformCaseMapper.download(startDate, endDate);
// list.parallelStream().forEach(originalResidenceOpeningCase -> {
//// originalResidenceOpeningCase.clear();
// originalResidenceOpeningCase.setYearMonth(syncTableRoute);
// syncOriginalResidenceRentOpeningCaseMapper.insert(originalResidenceOpeningCase);
// });
// 两种数据分别插入不同的表当中
running(computeTableRoute, list);
after(computeTableRoute, lastYearMonth, valuePoint);
running(computeTableRoute, list, platformCaseList);
after(computeTableRoute, lastYearMonth, startDate);
}
/**
@ -84,34 +97,46 @@ public class OriginalResidenceRentOpeningCaseServiceImpl implements IOriginalRes
public void prepare(Integer computeTableRoute, Integer syncTableRoute) {
originalResidenceRentOpeningCaseMapper.createTable(computeTableRoute);
originalResidenceRentOpeningCaseMapper.createCleanTable(computeTableRoute);
originalResidenceRentOpeningCaseMapper.createPlatformCaseTable(computeTableRoute);
originalResidenceRentOpeningCaseMapper.createAssembleTable(computeTableRoute);
originalResidenceRentOpeningCaseMapper.createComputePriceTable(computeTableRoute);
originalResidenceRentOpeningCaseMapper.createArtificialPriceTable(computeTableRoute);
originalResidenceRentOpeningCaseMapper.createUltimatePriceTable(computeTableRoute);
syncOriginalResidenceRentOpeningCaseMapper.createTable(syncTableRoute);
// syncOriginalResidenceRentOpeningCaseMapper.createTable(syncTableRoute);
}
/**
* 批量入库
*
* @param computeTableRoute
* @param list
* @param lianjiaList
*/
public void running(Integer computeTableRoute, List<OriginalResidenceRentOpeningCase> list) {
SqlParameterSource[] batchParams = SqlParameterSourceUtils.createBatch(list.toArray());
public void running(Integer computeTableRoute, List<OriginalResidenceRentOpeningCase> lianjiaList,
List<OriginalResidencePlatformRentOpeningCase> platformCaseList) {
SqlParameterSource[] batchParams = SqlParameterSourceUtils.createBatch(lianjiaList.toArray());
int[] updateCounts = namedParameterJdbcTemplate.batchUpdate("insert into dbo" +
".original_residence_rent_opening_case_" + computeTableRoute + "(case_id,case_lianjia_id," +
"case_lianjia_community_id,case_title,case_apartment_layout,case_area,case_total_area," +
"case_rent_type,case_status,case_hall_num,case_room_num,case_toward,case_storey," +
"case_decoration,case_address,case_price,case_community_name,case_visited_num," +
"case_visited_num_15,case_visited_num_30," +
"case_first_visited_date,case_url,case_get_date,case_provider,create_time) values " +
"(:newCaseId,:caseLianJiaId,:caseLianJiaCommunityId,:caseTitle," +
":caseApartmentLayout,:caseArea,:caseTotalArea,:caseRentType,:caseStatus,:caseHallNum," +
":caseRoomNum,:caseToward,:caseStorey,:caseDecoration,:caseAddress,:casePrice,:caseCommunityName," +
":caseVisitedNum,:caseVisitedNum15,:caseVisitedNum30,:caseFirstVisitTime,:caseUrl," +
":caseGetDate,:caseProvider,GETDATE());",
".ODS_HOUSINGCASELISTED_RENT_LJ_" + computeTableRoute + "_RAW (case_id, Llid,Lcid,Airaid," +
"Name,Type,Roomtype,Area,TotalArea,Towards,Storey,Visited_Num,First_Visit_Time," +
"Visited_Num_15,Visited_Num_30,Decoration,Address," +
"StatusTxt,Price,Url,Curl,Cname,SynDate) values " +
"(:newCaseId,:caseLianJiaId,:caseLianJiaCommunityId,:cleanCommunityId,:caseTitle," +
":caseRentType," +
":caseApartmentLayout,:caseArea,:caseTotalArea,:caseToward,:caseStorey,:caseVisitedNum," +
":caseFirstVisitTime,:caseVisitedNum15,:caseVisitedNum30,:caseDecoration,:caseAddress," +
":caseStatus,:casePrice,:caseUrl,:caseCommunityUrl,:caseCommunityName,GETDATE());",
batchParams);
// 租赁平台案例入库
batchParams = SqlParameterSourceUtils.createBatch(platformCaseList.toArray());
updateCounts = namedParameterJdbcTemplate.batchUpdate("insert into dbo" +
".residence_rent_platform_case_" + computeTableRoute + " (case_id,case_area,case_block," +
"case_address,case_community_name,case_url,case_decoration,case_floor,case_hall_num,case_no," +
"case_price,case_county,case_rent_type,case_room_num,case_source,savetime) values " +
"(:newCaseId,:caseArea,:caseBlock,:caseAddress,:caseCommunityName,:caseUrl," +
":caseDecoration," +
":caseStorey,:caseHallNum,:caseNo,:casePrice,:caseCounty,:caseRentType,:caseRoomNum," +
":caseProvider,:caseGetDate);",
batchParams);
}
@ -125,18 +150,18 @@ public class OriginalResidenceRentOpeningCaseServiceImpl implements IOriginalRes
*/
public void after(Integer yearMonth, Integer lastYearMonth, Date valuePoint) {
// 清洗挂牌案例
String rawSql = LoadUtil.loadContent("sql-template/clear_residence_sale_opening_case.sql");
String rawSql = LoadUtil.loadContent("sql-template/clear_rent_opening_case.sql");
String sql = rawSql.replace("#yearMonth#", yearMonth.toString())
.replace("#lastYearMonth#", lastYearMonth.toString());
jdbcTemplate.update(sql);
// 作价
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
rawSql = LoadUtil.loadContent("sql-template/compute_residence_sale_base_price.sql");
sql = rawSql.replace("#yearMonth#", yearMonth.toString())
.replace("#lastYearMonth#", lastYearMonth.toString())
.replace("#valuePoint#", simpleDateFormat.format(valuePoint));
jdbcTemplate.update(sql);
// // 作价
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
// rawSql = LoadUtil.loadContent("sql-template/compute_residence_sale_base_price.sql");
// sql = rawSql.replace("#yearMonth#", yearMonth.toString())
// .replace("#lastYearMonth#", lastYearMonth.toString())
// .replace("#valuePoint#", simpleDateFormat.format(valuePoint));
// jdbcTemplate.update(sql);
logger.debug("#作价完成#");
}

View File

@ -1,12 +1,17 @@
package com.ruoyi.project.data.price.controller;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.framework.web.page.TableSupport;
import com.ruoyi.project.data.basis.domain.UVBasePrice;
import com.ruoyi.project.data.basis.domain.UVBasePriceQueryModel;
import com.ruoyi.project.data.basis.service.IUVBasePriceService;
import com.ruoyi.project.data.price.domain.ArtificialResidenceSaleBasePrice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
@ -25,12 +30,26 @@ public class BasePriceController extends BaseController {
@PreAuthorize("@ss.hasPermi('system:user:list')")
@GetMapping("/list")
public TableDataInfo list(UVBasePriceQueryModel queryModel) {
int pageIndex = ServletUtils.getParameterToInt(TableSupport.PAGE_NUM);
int pageSize = ServletUtils.getParameterToInt(TableSupport.PAGE_SIZE);
int pageIndex = queryModel.getPageIndex();
int pageSize = queryModel.getPageSize();
queryModel.setPageIndex(pageIndex <= 1 ? 0 : (pageIndex - 1) * pageSize);
queryModel.setPageSize(pageSize);
int total = basePriceService.pageCount(queryModel);
List<UVBasePrice> list = basePriceService.pageList(queryModel);
return getDataTable(list, total);
}
@PreAuthorize("@ss.hasPermi('system:user:export')")
@Log(title = "物业基价", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(UVBasePriceQueryModel queryModel) {
int total = basePriceService.pageCount(queryModel);
queryModel.setPageIndex(0);
queryModel.setPageSize(total);
List<UVBasePrice> list = basePriceService.pageList(queryModel);
ExcelUtil<UVBasePrice> util = new ExcelUtil<>(UVBasePrice.class);
return util.exportExcel(list, "物业基价");
}
}

View File

@ -16,11 +16,11 @@ import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.framework.web.page.TableSupport;
import com.ruoyi.project.common.VueSelectModel;
import com.ruoyi.project.data.price.domain.ArtificialResidenceSaleBasePrice;
import com.ruoyi.project.data.price.domain.DistrictBlockChange;
import com.ruoyi.project.data.price.domain.ComputeResidenceSaleBasePrice;
import com.ruoyi.project.data.price.domain.UltimateResidenceSaleBasePrice;
import com.ruoyi.project.data.price.service.IArtificialResidenceSalePriceService;
import com.ruoyi.project.data.price.service.IComputeResidenceSalePriceService;
import com.ruoyi.project.data.price.service.IUltimateResidenceRentBasePriceService;
import com.ruoyi.project.data.price.service.IUltimateResidenceSalePriceService;
import com.ruoyi.project.system.domain.UploadFile;
import com.ruoyi.project.system.service.IUploadFileService;
@ -96,6 +96,32 @@ public class ResidenceSaleBasePriceController extends BaseController {
return util.exportExcel(list, "住宅销售基价" + computeResidenceSaleBasePrice.getYearMonth());
}
/**
* 板块涨跌幅
*
* @param yearMonth
* @return
*/
@PreAuthorize("@ss.hasPermi('system:user:list')")
@GetMapping("/compute/block-change/{yearMonth}")
public AjaxResult blockChange(@PathVariable("yearMonth") Integer yearMonth) {
List<DistrictBlockChange> districtBlockChanges = computeResidenceSalePriceService.getBlockChange(yearMonth);
return AjaxResult.success(districtBlockChanges);
}
/**
* 区域跌幅
*
* @param yearMonth
* @return
*/
@PreAuthorize("@ss.hasPermi('system:user:list')")
@GetMapping("/compute/county-change/{yearMonth}")
public AjaxResult countyChange(@PathVariable("yearMonth") Integer yearMonth) {
List<DistrictBlockChange> districtBlockChanges = computeResidenceSalePriceService.getCountyChange(yearMonth);
return AjaxResult.success(districtBlockChanges);
}
/**
* 查询 住宅租赁基价列表
*/
@ -246,4 +272,5 @@ public class ResidenceSaleBasePriceController extends BaseController {
return util.exportExcel(list, "住宅销售基价" + ultimateResidenceSaleBasePrice.getYearMonth());
}
}

View File

@ -0,0 +1,24 @@
package com.ruoyi.project.data.price.domain;
import java.math.BigDecimal;
public class DistrictBlockChange {
private String name;
private BigDecimal value;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public BigDecimal getValue() {
return value;
}
public void setValue(BigDecimal value) {
this.value = value;
}
}

View File

@ -83,6 +83,10 @@ public class UltimateOfficeBasePrice extends BaseEntity {
private Boolean isStandardBuilding;
// @Excel(name = "更改价格说明")
private String adjustPriceComment;
/**
* 名称或者地址
*/
private String nameOrAddress;
public Integer getLastYearMonth() {
return lastYearMonth;
@ -364,4 +368,11 @@ public class UltimateOfficeBasePrice extends BaseEntity {
this.adjustPriceComment = adjustPriceComment;
}
public String getNameOrAddress() {
return nameOrAddress;
}
public void setNameOrAddress(String nameOrAddress) {
this.nameOrAddress = nameOrAddress;
}
}

View File

@ -2,13 +2,31 @@ package com.ruoyi.project.data.price.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.ruoyi.project.common.VueSelectModel;
import com.ruoyi.project.data.price.domain.DistrictBlockChange;
import com.ruoyi.project.data.price.domain.ComputeResidenceSaleBasePrice;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@DS("compute")
public interface ComputeResidenceSalePriceMapper {
/**
* 板块涨跌幅
*
* @param yearMonth
* @return
*/
List<DistrictBlockChange> getBlockChange(@Param("yearMonth") Integer yearMonth);
/**
* 区域涨跌幅
*
* @param yearMonth
* @return
*/
List<DistrictBlockChange> getCountyChange(@Param("yearMonth") Integer yearMonth);
/**
* 分页列表
*

View File

@ -94,6 +94,17 @@ public interface UltimateOfficeBasePriceMapper {
*/
List<VueSelectModel> getYearMonthList();
/**
* 准备批量执行环境
*/
void initImport();
/**
* @param yearMonth
* @return
*/
int prepareBachImport(@Param("yearMonth") Integer yearMonth);
/**
* 插入人工修正的办公基价
*
@ -102,6 +113,7 @@ public interface UltimateOfficeBasePriceMapper {
*/
int insertArtificialOfficeBasePrice(UltimateOfficeBasePrice ultimateOfficeBasePrice);
/**
* 批量插入人工修正办公基价
*

View File

@ -1,6 +1,7 @@
package com.ruoyi.project.data.price.service;
import com.ruoyi.project.common.VueSelectModel;
import com.ruoyi.project.data.price.domain.DistrictBlockChange;
import com.ruoyi.project.data.price.domain.ComputeResidenceSaleBasePrice;
import java.util.List;
@ -10,6 +11,21 @@ import java.util.List;
*/
public interface IComputeResidenceSalePriceService {
/**
* 板块涨跌幅
*
* @param yearMonth
* @return
*/
List<DistrictBlockChange> getBlockChange(Integer yearMonth);
/**
* 区域涨跌幅
* @param yearMonth
* @return
*/
List<DistrictBlockChange> getCountyChange(Integer yearMonth);
/**
* 查询列表
*
@ -31,9 +47,6 @@ public interface IComputeResidenceSalePriceService {
*/
List<VueSelectModel> getYearMonth();
}

View File

@ -1,6 +1,7 @@
package com.ruoyi.project.data.price.service.impl;
import com.ruoyi.project.common.VueSelectModel;
import com.ruoyi.project.data.price.domain.DistrictBlockChange;
import com.ruoyi.project.data.price.domain.ComputeResidenceSaleBasePrice;
import com.ruoyi.project.data.price.mapper.ComputeResidenceSalePriceMapper;
import com.ruoyi.project.data.price.service.IComputeResidenceSalePriceService;
@ -39,4 +40,14 @@ public class ComputeResidenceSalePriceServiceImpl implements IComputeResidenceSa
public List<VueSelectModel> getYearMonth() {
return computeResidenceSalePriceMapper.yearMonthList();
}
@Override
public List<DistrictBlockChange> getBlockChange(Integer yearMonth) {
return computeResidenceSalePriceMapper.getBlockChange(yearMonth);
}
@Override
public List<DistrictBlockChange> getCountyChange(Integer yearMonth) {
return computeResidenceSalePriceMapper.getCountyChange(yearMonth);
}
}

View File

@ -1,10 +1,17 @@
package com.ruoyi.project.data.price.service.impl;
import java.math.BigDecimal;
import java.sql.*;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.Date;
import java.util.concurrent.CopyOnWriteArrayList;
import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.microsoft.sqlserver.jdbc.SQLServerCallableStatement;
import com.microsoft.sqlserver.jdbc.SQLServerDataTable;
import com.microsoft.sqlserver.jdbc.SQLServerException;
import com.ruoyi.common.exception.CustomException;
import com.ruoyi.common.utils.LoadUtil;
import com.ruoyi.common.utils.StringUtils;
@ -13,6 +20,7 @@ import com.ruoyi.project.common.UVResponse;
import com.ruoyi.project.common.VueSelectModel;
import com.ruoyi.project.data.cases.mapper.OriginalOfficeCaseMapper;
import com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalOfficeCaseMapper;
import com.ruoyi.project.data.price.domain.ArtificialResidenceSaleBasePrice;
import com.ruoyi.project.data.price.domain.OfficeBasePriceModifyModel;
import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice;
import com.ruoyi.project.data.price.mapper.UltimateOfficeBasePriceMapper;
@ -20,7 +28,9 @@ import com.ruoyi.project.data.price.service.IUltimateOfficeBasePriceService;
import com.ruoyi.project.system.service.impl.SysUserServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
@ -41,6 +51,9 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
private static final Logger log = LoggerFactory.getLogger(UltimateOfficeBasePriceServiceImpl.class);
@Value("spring.datasource.dynamic.datasource.")
private String computeConnUrl;
@Autowired
private UltimateOfficeBasePriceMapper officeBasePriceUltimateMapper;
@Autowired
@ -88,30 +101,134 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
StringBuilder failureMsg = new StringBuilder();
Integer lastYearMonth = getLastYearMonth(yearMonth);
// 批量插入
officeBasePriceUltimates.stream().parallel().forEach(inputModel -> {
inputModel.setYearMonth(yearMonth);
officeBasePriceUltimateMapper.insertArtificialOfficeBasePrice(inputModel);
});
officeBasePriceUltimateMapper.initImport();
officeBasePriceUltimateMapper.prepareBachImport(yearMonth);
String rawSql = LoadUtil.loadContent("sql-template/update_office_price.sql");
Calendar calendar = Calendar.getInstance();
int year = yearMonth / 100;
int month = yearMonth % 100;
calendar.set(year, month, 1);
Date firstOfMonth = calendar.getTime();
calendar.add(Calendar.MONTH, -1);
Date lastMonth = calendar.getTime();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
try {
// 声明变量
// 构造一个
String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
String dbURL = "jdbc:sqlserver://172.16.30.233:1433;DatabaseName=uv_compute_test";
String name = "sa";
String pwd = "Lcdatacenter_888";
Class.forName(driverName);
Connection conn = DriverManager.getConnection(dbURL, name, pwd);
SQLServerDataTable sourceDataTable = new SQLServerDataTable();
String sql = rawSql.replace("#yearMonth#", yearMonth.toString())
.replace("#lastYearMonth#", lastYearMonth.toString())
.replace("#today#", simpleDateFormat.format(firstOfMonth))
.replace("#lastMonth#", simpleDateFormat.format(lastMonth));
jdbcTemplate.update(sql);
sourceDataTable.addColumnMetadata("id", java.sql.Types.NVARCHAR);
sourceDataTable.addColumnMetadata("BuildingID_P", java.sql.Types.NVARCHAR);
sourceDataTable.addColumnMetadata("ProjectID_P", java.sql.Types.NVARCHAR);
sourceDataTable.addColumnMetadata("ProjectName", java.sql.Types.NVARCHAR);
sourceDataTable.addColumnMetadata("ProjectAddr", java.sql.Types.NVARCHAR);
sourceDataTable.addColumnMetadata("BuildingAddr", java.sql.Types.NVARCHAR);
sourceDataTable.addColumnMetadata("County", java.sql.Types.NVARCHAR);
sourceDataTable.addColumnMetadata("Loop", java.sql.Types.NVARCHAR);
sourceDataTable.addColumnMetadata("Block", java.sql.Types.NVARCHAR);
sourceDataTable.addColumnMetadata("Street", java.sql.Types.NVARCHAR);
sourceDataTable.addColumnMetadata("Year", java.sql.Types.INTEGER);
sourceDataTable.addColumnMetadata("AvgArea", java.sql.Types.DECIMAL);
sourceDataTable.addColumnMetadata("TotalFloorSum", java.sql.Types.NVARCHAR);
sourceDataTable.addColumnMetadata("UpperFloorSum", java.sql.Types.NVARCHAR);
sourceDataTable.addColumnMetadata("OfficeClass", java.sql.Types.NVARCHAR);
sourceDataTable.addColumnMetadata("Grade", java.sql.Types.NVARCHAR);
sourceDataTable.addColumnMetadata("MainPrice_1", java.sql.Types.DECIMAL);
sourceDataTable.addColumnMetadata("MainPriceRent_1", java.sql.Types.DECIMAL);
sourceDataTable.addColumnMetadata("MainPrice", java.sql.Types.DECIMAL);
sourceDataTable.addColumnMetadata("MainPriceRent", java.sql.Types.DECIMAL);
sourceDataTable.addColumnMetadata("MainPricePst", java.sql.Types.DECIMAL);
sourceDataTable.addColumnMetadata("MainPriceRentPst", java.sql.Types.DECIMAL);
sourceDataTable.addColumnMetadata("MainPriceType", java.sql.Types.NVARCHAR);
sourceDataTable.addColumnMetadata("MainPriceRentType", java.sql.Types.NVARCHAR);
sourceDataTable.addColumnMetadata("AreaCoff", java.sql.Types.DECIMAL);
sourceDataTable.addColumnMetadata("YearCoff", java.sql.Types.DECIMAL);
sourceDataTable.addColumnMetadata("BuildingCoff", java.sql.Types.DECIMAL);
sourceDataTable.addColumnMetadata("BuildingStd", java.sql.Types.NVARCHAR);
sourceDataTable.addColumnMetadata("AdjEvd", java.sql.Types.NVARCHAR);
officeBasePriceUltimates.forEach(x -> {
try {
sourceDataTable.addRow(
x.getId(),
x.getBuildingId(),
x.getCommunityId(),
x.getCommunityName(),
x.getCommunityAddress(),
x.getBuildingAddress(),
x.getCountyName(),
x.getLoopName(),
x.getBlockName(),
x.getStreetName(),
x.getYear(),
x.getAvgArea(),
x.getTotalFloorSum(),
x.getUpperFloorSum(),
x.getOfficeClass(),
x.getOfficeLevel(),
x.getMainPrice_1(),
x.getMainPriceRent_1(),
x.getMainPrice(),
x.getMainPriceRent(),
x.getMainPricePst(),
x.getMainPriceRentPst(),
x.getMainPriceType(),
x.getMainPriceRentType(),
x.getAreaCoefficient(),
x.getYearCoefficient(),
x.getBuildingCoefficient(),
x.getStandardBuilding(),
x.getAdjustPriceComment()
);
} catch (SQLServerException e) {
e.printStackTrace();
}
});
Statement statement = conn.createStatement();
try (CallableStatement cs = conn.prepareCall("{CALL BatchImportOfArtificialOfficePrice (?) }")) {
((SQLServerCallableStatement) cs).setStructured(1, "DWA_PROJECTBASEPRICE_OFFICE_MANU_Table",
sourceDataTable);
boolean resultSetReturned = cs.execute();
if (resultSetReturned) {
try (ResultSet rs = cs.getResultSet()) {
rs.next();
System.out.println(rs.getInt(1));
}
}
}
// 删除存储过程还原环境
officeBasePriceUltimateMapper.initImport();
conn.close();
Calendar calendar = Calendar.getInstance();
int year = yearMonth / 100;
int month = yearMonth % 100;
calendar.set(year, month, 1);
Date lastValuePoint = calendar.getTime();
calendar.add(Calendar.MONTH, -1);
Date valuePoint = calendar.getTime();
after(yearMonth, lastYearMonth, valuePoint, lastValuePoint);
} catch (Exception e) {
e.printStackTrace();
}
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + "");
return successMsg.toString();
// String rawSql = LoadUtil.loadContent("sql-template/update_office_price.sql");
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
//
// String sql = rawSql.replace("#yearMonth#", yearMonth.toString())
// .replace("#lastYearMonth#", lastYearMonth.toString())
// .replace("#today#", simpleDateFormat.format(firstOfMonth))
// .replace("#lastMonth#", simpleDateFormat.format(lastMonth));
// jdbcTemplate.update(sql);
//
}
@Override
@ -232,4 +349,23 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
return officeBasePriceModifyModel;
}
/**
* @param yearMonth
* @param lastYearMonth
* @param valuePoint
* @param lastValuePoint
*/
private void after(Integer yearMonth, Integer lastYearMonth, Date valuePoint, Date lastValuePoint) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
String priceDate = simpleDateFormat.format(valuePoint);
String lastPriceDate = simpleDateFormat.format(lastValuePoint);
String rawSql = LoadUtil.loadContent("sql-template/update_office_price.sql");
String sql = rawSql.replace("#yearMonth#", yearMonth.toString())
.replace("#lastYearMonth#", lastYearMonth.toString())
.replace("#today#", priceDate)
.replace("#lastMonth#", lastPriceDate);
jdbcTemplate.update(sql);
}
}

View File

@ -49,7 +49,7 @@ spring:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: dev
active: uat
# 文件上传
servlet:
multipart:

View File

@ -143,7 +143,8 @@
AND ProjectID = #{communityId}
</if>
<if test="nameOrAddress != null">
AND (ProjectName like concat('%', #{nameOrAddress}, '%') or ProjectAddr like concat('%', #{nameOrAddress}, '%'))
AND (ProjectName like concat('%', #{nameOrAddress}, '%') or ProjectAddr like concat('%',
#{nameOrAddress}, '%'))
</if>
</where>
</select>
@ -157,7 +158,8 @@
AND ProjectID = #{communityId}
</if>
<if test="nameOrAddress != null">
AND (ProjectName like concat('%', #{nameOrAddress}, '%') or ProjectAddr like concat('%', #{nameOrAddress}, '%'))
AND (ProjectName like concat('%', #{nameOrAddress}, '%') or ProjectAddr like concat('%',
#{nameOrAddress}, '%'))
</if>
</where>
order by ProjectID ASC OFFSET #{pageIndex} rows fetch next #{pageSize} rows only
@ -170,17 +172,28 @@
</select>
<!-- 获取表名 -->
<select id="yearMonthList" resultType="com.ruoyi.project.common.VueSelectModel">
SELECT right(name,6) as value, right(name,6) as label
SELECT top 12 right(name,6) as value, right(name,6) as label
FROM sys.tables
where name like 'DWA_PROJECTBASEPRICE_IMDT_%'
order by cast(right(name,6) as int) desc
</select>
<!-- <update id="updateComputeResidenceRentBasePrice" parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice">-->
<!-- update TLK_计价办公核准基价 set ITEM_YEARMONTH=ITEM_YEARMONTH-->
<!-- <trim prefix="SET" suffixOverrides=",">-->
<!-- </trim>-->
<!-- where id = #{id}-->
<!-- </update>-->
<!-- 区域涨跌幅 -->
<select id="getBlockChange" resultType="com.ruoyi.project.data.price.domain.DistrictBlockChange">
select Block as name
, avg(VOPPA) as value
from dbo.DWA_PROJECTBASEPRICE_IMDT_${yearMonth}
where Block is not null
group by Block
order by avg(VOPPA)
</select>
<!--区域涨跌幅-->
<select id="getCountyChange" resultType="com.ruoyi.project.data.price.domain.DistrictBlockChange">
select left(County,2) as name
, avg(VOPPA) as value
from dbo.DWA_PROJECTBASEPRICE_IMDT_${yearMonth}
where County is not null
group by left(County,2)
order by avg(VOPPA)
</select>
</mapper>

View File

@ -11,7 +11,7 @@
<result property="caseUnitPrice" column="均价售"/>
<result property="name" column="楼盘名称"/>
<result property="caseFloor" column="楼层"/>
<result property="area" column="面积" javaType="java.math.BigDecimal"/>
<result property="area" column="面积" javaType="java.math.BigDecimal" />
<result property="managementFee" column="物业费"/>
<result property="seatCount" column="工位数"/>
<result property="address" column="地址"/>
@ -32,17 +32,19 @@
<result property="rentOfMonthly" column="月租金租"/>
<result property="rentOfStandard" column="标准租金租"/>
<result property="score" column="得房率"/>
<result property="totalPrice" column="总价"/>
<result property="unitPrice" column="单价"/>
<result property="totalPrice" column="总价" javaType="java.math.BigDecimal"/>
<result property="unitPrice" column="单价" javaType="java.math.BigDecimal"/>
<result property="updateDate" column="更新时间" javaType="java.sql.Date"/>
</resultMap>
<select id="download" resultMap="DownloadMapping">
select url, title, 容积率, 总价售, 均价售, 楼盘名称, 楼层, 面积, 物业费, 工位数, 地址, 地铁,
select url, title, 容积率, 总价售, 均价售, 楼盘名称, 楼层, case 面积 when 'nan' then NULL ELSE 面积 END 面积,
物业费, 工位数, 地址, 地铁,
发布时间,房源编号, 百度lng, 百度lat, 区域, 分类, 来源, 等级, 楼盘网址, 装修,
类型, 板块, 挂牌中介, 月租金租, 标准租金租, 更新时间, 得房率,
case when 分类 = '售' then 总价售
when 分类 = '租' then 月租金租 end as 总价,
case when 分类 = '售' then 均价售
when 分类 = '租' then 标准租金租 end as 单价
case when 分类 = '售' then (case 总价售 when 'nan' then NULL ELSE 总价售 END)
when 分类 = '租' then (case 月租金租 when 'nan' then NULL ELSE 月租金租 END) end as 总价,
case when 分类 = '售' then (case 均价售 when 'nan' then NULL ELSE 均价售 END)
when 分类 = '租' then (case 标准租金租 when 'nan' then NULL ELSE 标准租金租 END) end as 单价
from dbo.办公
where 更新时间 >= #{startDate} and 更新时间 <![CDATA[ < ]]> #{endDate}
</select>

View File

@ -24,11 +24,12 @@
<result property="casePrice" column="price" javaType="java.math.BigDecimal"/>
<result property="caseUrl" column="url"/>
<result property="caseCommunityUrl" column="curl"/>
<result property="caseCommunityName" column="cname"/>
<result property="caseGetDate" column="created" javaType="java.sql.Date"/>
<result property="caseProvider" column="caseProvider"/>
</resultMap>
<select id="download" resultMap="resultMapping">
SELECT llid
SELECT top 1000 llid
,lcid
,airaid
,name
@ -42,10 +43,8 @@
,first_visit_time
,visited_num_15
,visited_num_30
,postDate
,decoration
,address
,created
,statustxt
,price
,url

View File

@ -3,7 +3,7 @@
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.DownloadOriginalResidenceRentPlatformCaseMapper">
<resultMap id="resultMapping" type="com.ruoyi.project.data.cases.domain.OriginalResidenceRentOpeningCase">
<resultMap id="resultMapping" type="com.ruoyi.project.data.cases.domain.OriginalResidencePlatformRentOpeningCase">
<result property="caseArea" column="面积" javaType="java.math.BigDecimal"/>
<result property="caseBlock" column="block" />
<result property="caseAddress" column="地址"/>
@ -23,7 +23,7 @@
</resultMap>
<select id="download" resultMap="resultMapping">
select 面积
select top 100 面积
,block
,地址
,小区名
@ -32,7 +32,6 @@
,楼层
,厅数
,编号
,type
,price
,区域
,出租方式
@ -40,6 +39,6 @@
,来源
,savetime
FROM dbo.挂牌房源
where savetime <![CDATA[ > ]]> #{startDate} and savetime <![CDATA[ <= ]]> #{endDate}
where savetime <![CDATA[ > ]]> #{startDate,jdbcType=DATE} and savetime <![CDATA[ <= ]]> #{endDate,jdbcType=DATE}
</select>
</mapper>

View File

@ -6,43 +6,43 @@
<update id="createTable">
<bind name="targetTableName" value="'dbo.ODS_OFFICECASELISTED_' + yearMonth + '_RAW'"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
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
case_id varchar(32) 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,
更新时间 date NULL,
得房率 varchar (1000) NULL,
总价 decimal (18, 2) NULL,
单价 decimal (18, 2) NULL
);
</update>
<!-- 创建人工修正表 -->
@ -51,26 +51,107 @@
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
CREATE TABLE ${targetTableName}
create table ${targetTableName}
(
BuildingID bigint NOT NULL,
ProjectID bigint NULL,
County nvarchar (512) NULL,
Loop nvarchar (512) NULL,
Block nvarchar (512) NULL,
ProjectAddr nvarchar (1024) NULL,
ProjectName nvarchar (1024) 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,
MainPrice_1 decimal (18, 2) NULL,
MainPriceRent_1 decimal (18, 2) NULL,
MainPrice decimal (18, 2) NULL,
MainPriceRent decimal (18, 2) NULL,
ModifyDate date NULL
id int not null,
BuildingID_P nvarchar(20) not null,
ProjectID_P nvarchar(20) null,
ProjectName nvarchar(200) null,
ProjectAddr nvarchar(200) null,
BuildingAddr nvarchar(200) null,
County nvarchar(200) null,
Loop nvarchar(200) null,
Block nvarchar(200) null,
Street nvarchar(200) null,
Year int null,
AvgArea decimal(10, 2) null,
TotalFloorSum nvarchar(50) null,
UpperFloorSum nvarchar(50) null,
OfficeClass nvarchar(50) null,
Grade nvarchar(50) null,
MainPrice_1 decimal(18, 6) null,
MainPriceRent_1 decimal(18, 6) 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,
AreaCoff decimal(18, 6) null,
YearCoff decimal(18, 6) null,
BuildingCoff decimal(18, 6) null,
BuildingStd bit null,
AdjEvd nvarchar(1000) null,
ModifyDate date not null
);
</update>
<!--案例汇总表-->
<update id="createAssembleTable">
<bind name="targetTableName" value="'dbo.DW_OFFICECASE_COMM_' + yearMonth"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
CREATE TABLE ${targetTableName}
(
ID uniqueidentifier 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>
<!-- 初始化汇总表-->
<update id="initAssembleTable">
<bind name="targetTableName" value="'dbo.DW_OFFICECASE_COMM_' + yearMonth"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
</update>
<!-- 初始化汇总表-->
<update id="initPriceTable">
<bind name="targetTableName" value="'dbo.ODS_OFFICE_BUILDING_PRICE_INFO_' + yearMonth"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
</update>
</mapper>

View File

@ -5,122 +5,191 @@
<mapper namespace="com.ruoyi.project.data.cases.mapper.OriginalResidenceRentOpeningCaseMapper">
<update id="createTable">
<bind name="targetTableName" value="'dbo.original_residence_rent_opening_case_' + yearMonth"/>
<bind name="targetTableName" value="'dbo.ODS_HOUSINGCASELISTED_RENT_LJ_' + yearMonth +'_RAW' "/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
drop table ${targetTableName};
CREATE 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
case_id varchar(32) not null
, Llid nvarchar(64)
, Lcid nvarchar(64)
, Airaid nvarchar(64)
, Name sql_variant
, Type nvarchar(128)
, Roomtype nvarchar(50)
, Area decimal(18, 2)
, TotalArea decimal(18, 2)
, Towards nvarchar(50)
, Storey nvarchar(50)
, Visited_Num int
, First_Visit_Time date
, Visited_Num_15 int
, Visited_Num_30 int
, PostDate date
, Decoration nvarchar(50)
, Address nvarchar(1024)
, DataType nvarchar(128)
, Created datetime
, Modified datetime
, StatusTxt nvarchar(1024)
, Price decimal(18, 2)
, Url nvarchar(512)
, Curl nvarchar(512)
, Cname nvarchar(1024)
, SynDate date
);
</update>
<update id="createCleanTable">
<bind name="targetTableName" value="'dbo.ODS_HOUSINGCASELISTED_LJ_' + yearMonth"/>
-- 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="createPlatformCaseTable">
<bind name="targetTableName" value="'dbo.residence_rent_platform_case_' + yearMonth"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
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
case_id varchar(32) not null,
case_area varchar (255) NULL,
case_block varchar (255) NULL,
case_address varchar (255) NULL,
case_community_name varchar (255) NULL,
case_url varchar (255) NULL,
case_decoration varchar (255) NULL,
case_floor varchar (255) NULL,
case_hall_num varchar (255) NULL,
case_no varchar (255) NULL,
case_type varchar (255) NULL,
case_price varchar (255) NULL,
case_county varchar (255) NULL,
case_rent_type varchar (255) NULL,
case_room_num varchar (255) NULL,
case_source varchar (255) NULL,
savetime date NULL
)
</update>
<update id="createCleanTable">
<bind name="targetTableName" value="'dbo.ODS_HOUSINGCASELISTED_RENT_' + yearMonth"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
create table ${targetTableName}
(
SID int identity
, HouseholdsID_SRC nvarchar(64) primary key
, ProjectID_SRC nvarchar(64) not null
, ProjectID bigint
, BuildingID bigint
, RentType tinyint
, Room tinyint
, Hall tinyint
, Bashroom tinyint
, 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)
, RoomTypeCoff decimal(7, 4)
, PriceTotal decimal(18, 2) not null
, PriceUnit decimal(18, 2) not null
, PriceScatterRent decimal(18, 2)
, PriceEntireRent decimal(18, 2)
, PriceShareRent0 decimal(18, 2)
, PriceShareRent decimal(18, 2)
, 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)
, PriceTotalOut decimal(18, 2)
, PriceDateIn date
, PriceDateOut date
, Origin nvarchar(64)
, UrlHouseholds nvarchar(max)
, UrlProjects nvarchar(max)
, CaseName nvarchar(1024)
);
</update>
<update id="createAssembleTable">
@ -266,14 +335,14 @@
</update>
<!-- 核准住宅租赁基价 -->
<update id="createUltimateTable">
<update id="createUltimatePriceTable">
<bind name="targetTableName" value="'dbo.ODS_PROJECT_RENT_PRICE_INFO_' + yearMonth"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
create table ODS_PROJECT_RENT_PRICE_INFO_202007
create table ${targetTableName}
(
id uniqueidentifier primary key
id varchar(32) primary key
, ProjectID bigint not null
, PriceType int
, BasePrice_1 decimal(18, 2)

View File

@ -88,6 +88,16 @@
<if test="status != null">
AND a.STATUS = #{status}
</if>
<if test="isStandardBuilding != null">
AND a.BuildingStd = #{isStandardBuilding}
</if>
<if test="nameOrAddress != null">
AND (
a.ProjectName like concat('%', #{nameOrAddress} ,'%') or
a.ProjectAddr like concat('%', #{nameOrAddress} ,'%') or
a.BuildingAddr like concat('%', #{nameOrAddress} ,'%')
)
</if>
</where>
</select>
@ -104,8 +114,17 @@
<if test="status != null">
AND a.STATUS = #{status}
</if>
<if test="isStandardBuilding != null">
AND a.BuildingStd = #{isStandardBuilding}
</if>
<if test="nameOrAddress != null">
AND (
a.ProjectName like concat('%', #{nameOrAddress} ,'%') or
a.ProjectAddr like concat('%', #{nameOrAddress} ,'%') or
a.BuildingAddr like concat('%', #{nameOrAddress} ,'%')
)
</if>
</where>
order by a.id desc OFFSET #{pageIndex} rows fetch next #{pageSize} rows only;
</select>
@ -293,4 +312,18 @@
from ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}
where id=#{id};
</update>
<update id="initImport">
IF OBJECT_ID('BatchImportOfArtificialOfficePrice', 'P') IS NOT NULL
drop procedure BatchImportOfArtificialOfficePrice;
</update>
<!--准备批量导入-->
<update id="prepareBachImport">
create procedure dbo.BatchImportOfArtificialOfficePrice @table DWA_PROJECTBASEPRICE_OFFICE_MANU_Table readonly
as
begin
insert into dbo.DWA_PROJECTBASEPRICE_OFFICE_MANU_${yearMonth} (id,BuildingID_P,ProjectID_P,ProjectName,ProjectAddr,BuildingAddr,County,Loop,Block,Street,Year,AvgArea,TotalFloorSum,UpperFloorSum,OfficeClass,Grade,MainPrice_1,MainPriceRent_1,MainPrice,MainPriceRent,MainPricePst,MainPriceRentPst,MainPriceType,MainPriceRentType,AreaCoff,YearCoff,BuildingCoff,BuildingStd,AdjEvd,ModifyDate)
select id,BuildingID_P,ProjectID_P,ProjectName,ProjectAddr,BuildingAddr,County,Loop,Block,Street,Year,AvgArea,TotalFloorSum,UpperFloorSum,OfficeClass,Grade,MainPrice_1,MainPriceRent_1,MainPrice,MainPriceRent,MainPricePst,MainPriceRentPst,MainPriceType,MainPriceRentType,AreaCoff,YearCoff,BuildingCoff,BuildingStd,AdjEvd,getdate()
from @table;
end;
</update>
</mapper>

View File

@ -74,7 +74,7 @@
<select id="yearMonthList" resultType="com.ruoyi.project.common.VueSelectModel">
SELECT right(name,6) as value, right(name,6) as label
FROM sys.tables
where name like 'ODS_PROJECT_PRICE_INFO_%'
where name like 'ODS_PROJECT_PRICE_INFO_%' and name not like '%_bak'
order by cast(right(name,6) as int) desc
</select>
</mapper>

View File

@ -0,0 +1,384 @@
create table #HousingCaseListAdj
(
HouseholdsID_SRC nvarchar(64) primary key
, ProjectID_SRC nvarchar(64) not null
, RentType tinyint
, Room tinyint
, Hall tinyint
, Bashroom tinyint
, Area decimal(18, 2)
, Towards nvarchar(64)
, UpperFloorSum nvarchar(32)
, UpperFloorNum nvarchar(32)
, Elevator tinyint
, Decoration nvarchar(64)
, Year int
, PriceTotal decimal(18, 2) not null
, PriceUnit decimal(18, 2) not null
, Visited_Num int
, First_Visit_Time date
, Visited_Num_15 int
, Visited_Num_30 int
, PriceDateIn date
, TowardsCoff decimal(7, 4)
, Origin nvarchar(64)
, UrlHouseholds nvarchar(max)
, UrlProjects nvarchar(max)
, CaseName nvarchar(1024)
);
DECLARE @llid NVARCHAR(64), @lcid NVARCHAR(64), @name NVARCHAR(1024), @roomtype nvarchar(50), @area decimal(18,2)
DECLARE @towards nvarchar(50), @storey nvarchar(50), @Created DATE, @price decimal(18,2), @UrlHouseholds NVARCHAR(MAX), @UrlProjects NVARCHAR(MAX)
DECLARE @RentType TINYINT, @Room TINYINT, @Hall TINYINT, @Bashroom TINYINT, @TowardsCoff DECIMAL(7,4),@UpperFloorSum NVARCHAR(32), @UpperFloorNum NVARCHAR(32), @priceunit decimal(18,2)
--(, )
select SingleKey, Coefficient INTO #TEMP from DIM_PARAMETERS where ProjectType = '公寓' and CoffType='朝向(租金)'
DECLARE Record2Insert CURSOR FOR
SELECT llid, lcid, cast([Name] as nvarchar(1024)) as Name, roomtype, area, towards, storey, Created, price, Url, Curl FROM ODS_HOUSINGCASELISTED_RENT_LJ_#yearMonth#_Raw
OPEN Record2Insert
FETCH NEXT FROM Record2Insert INTO @llid , @lcid , @name, @roomtype , @area , @towards , @storey , @Created, @price, @UrlHouseholds, @UrlProjects
SET NOCOUNT ON --
WHILE @@FETCH_STATUS=0
BEGIN
BEGIN
--
SET @RentType = CASE WHEN LEFT(@name,2) IN ('整租') THEN 1
WHEN LEFT(@name,2) IN ('散租') THEN 2
WHEN LEFT(@name,2) IN ('分租') THEN 3
ELSE NULL END
--
SET @Room = CASE WHEN isnumeric(substring(@roomtype, 1, charindex('', @roomtype, 1)-1))=1 THEN substring(@roomtype, 1, charindex('', @roomtype, 1)-1) END
SET @Hall = CASE WHEN isnumeric(substring(@roomtype, charindex('', @roomtype, 1)+1, charindex('', @roomtype, 1)-charindex('', @roomtype, 1)-1))=1
THEN substring(@roomtype, charindex('', @roomtype, 1)+1, charindex('', @roomtype, 1)-charindex('', @roomtype, 1)-1) END
SET @Bashroom = CASE WHEN isnumeric(substring(@roomtype, charindex('', @roomtype, 1)+1, charindex('', @roomtype, 1)-charindex('', @roomtype, 1)-1))=1
THEN substring(@roomtype, charindex('', @roomtype, 1)+1, charindex('', @roomtype, 1)-charindex('', @roomtype, 1)-1) END
-- #lastYearMonth#10修改由于链家页面修改朝向规则修改如下
if @towards in ('暂无数据', '--')
set @towards = NULL
-- else
-- set @towards = substring(@towards, 2, len(@towards)-1) --去掉字段中的’朝‘字
while patindex('% %',@towards)>0
SET @towards=STUFF(@towards, patindex('% %',@towards),1,'|') --|
select @TowardsCoff=case when Coefficient is null then 1 else Coefficient end
from (select avg(Coefficient) Coefficient from StringSplit(@towards, '|') a inner join #TEMP b on a.StringSub = b.SingleKey)t --多个朝向的修正系数取均值
--
set @UpperFloorNum = case when substring(@storey,1,3)='高楼层' then '高区'
when substring(@storey,1,3)='中楼层' then '中区'
when substring(@storey,1,3)='低楼层' then '低区' end
set @UpperFloorSum = substring(@storey,charindex('/',@storey,1)+1,charindex('',@storey,charindex('/',@storey,1))-charindex('/',@storey,1)-1)
--
set @priceunit = @price*1.0/isnull(@area,1)
--
insert into #HousingCaseListAdj values(@llid, @lcid, @RentType, @Room, @Hall, @Bashroom, @area, @towards, @UpperFloorSum, @UpperFloorNum, NULL, NULL, NULL,
@price, @priceunit, NULL, NULL, NULL,NULL, @Created, @TowardsCoff, '链家', @UrlHouseholds, @UrlProjects, @name)
END
FETCH NEXT FROM Record2Insert INTO @llid , @lcid , @name, @roomtype , @area , @towards , @storey , @Created, @price, @UrlHouseholds, @UrlProjects
END
CLOSE Record2Insert
DEALLOCATE Record2Insert
SET NOCOUNT OFF
drop table #TEMP
/****个性化:
-----1``,``,``,
-----2``
****/
update #HousingCaseListAdj
set RentType=2 where RentType=1
update #HousingCaseListAdj
set RentType=2 where RentType is null
update #HousingCaseListAdj
set Decoration='中装' where Decoration is null
/****************插入租赁平台数据*********************/
--ID提取
select distinct case_url,
case when case_source in ('21世纪不动产') then 'century21_'+reverse(substring(reverse(case_url), charindex('.', reverse(case_url))+1, charindex('/', reverse(case_url))- charindex('.', reverse(case_url))-1))
when case_source in ('蛋壳') then 'danken_'+reverse(substring(reverse(case_url), charindex('.', reverse(case_url))+1, charindex('/', reverse(case_url))- charindex('.', reverse(case_url))-1))
when case_source in ('我爱我家') then '5i5j_'+reverse(substring(reverse(case_url), charindex('.', reverse(case_url))+1, charindex('/', reverse(case_url))- charindex('.', reverse(case_url))-1))
when case_source in ('中原地产') then 'centanet_'+reverse(substring(reverse(case_url), charindex('.', reverse(case_url))+1, charindex('/', reverse(case_url))- charindex('.', reverse(case_url))-1))
when case_source in ('自如') then 'ziroom_'+reverse(substring(reverse(case_url), charindex('.', reverse(case_url))+1, charindex('/', reverse(case_url))- charindex('.', reverse(case_url))-1))
when case_source in ('平安好房') then 'pinganfang_'+reverse(substring(reverse(case_url), charindex('lmth.', reverse(case_url))+5, charindex('.di', reverse(case_url))- charindex('lmth.', reverse(case_url))-5))
when case_source in ('青客') then 'qk365_'+reverse(substring(reverse(case_url), 1, charindex('/', reverse(case_url))- 1))
when case_source in ('太平洋房屋') then 'taiwu_'+reverse(substring(reverse(case_url), 2, charindex('/', reverse(case_url), 2)- 2))
when case_source in ('信义房屋') then 'sinyi'+reverse(substring(reverse(case_url), 1, charindex('=di', reverse(case_url), 2)- 1)) end as HouseholdsID
into #HouseholdsID
from residence_rent_platform_case_#yearMonth#
select t.*
into #HouseingCaseZFZL
from (
select row_number()over(partition by b.HouseholdsID order by newid()) sq, a.*, b.HouseholdsID
from (select * from residence_rent_platform_case_#yearMonth# where case_source<>'链家') a
inner join #HouseholdsID b
on a.case_url = b.case_url
)t where sq=1;
INSERT INTO #HousingCaseListAdj
SELECT HouseholdsID AS HouseholdsID_SRC, '-1' AS ProjectID_SRC,
CASE WHEN case_rent_type='整租' then 1
WHEN case_rent_type='散租' then 2
WHEN case_rent_type='分租' then 3
WHEN case_rent_type='按间' then 3 END AS RentType,
case_room_num AS Room, case_hall_num AS Hall, NULL AS Bashroom, case_area AS Area, NULL AS Towards, NULL AS UpperFloorSum,
CASE WHEN case_floor LIKE '%低%' THEN '低区'
WHEN case_floor LIKE '%中%' THEN '中区'
WHEN case_floor LIKE '%高%' THEN '高区' END AS UpperFloorNum, NULL AS Elevator, case_decoration AS Decoration, NULL AS Year, ISNULL(case_price, 1) PriceTotal,
ISNULL(CONVERT(DECIMAL(18,2),case_price), 1)*1.0/ISNULL(CONVERT(DECIMAL(18,2),case_area),1) AS PriceUnit, NULL Visited_Num, NULL First_Visit_Time, NULL Visited_Num_15, NULL Visited_Num_30, savetime AS PriceDateIn,
NULL AS TowardsCoff, case_source AS Origin, case_url as UrlHouseholds, NULL as UrlProjects, case_community_name + '|' + case_address as CaseName
FROM #HouseingCaseZFZL A
/****************地址匹配*********************/
--select top 3000* from BAK_HousingCaseListAdj_20190725 order by newid()
create table #HousingCaseListAdj2ID
(
HouseholdsID_SRC nvarchar(64) primary key
, ProjectID_SRC nvarchar(64) not null
, ProjectID bigint
, BuildingID bigint
);
--
INSERT INTO #HousingCaseListAdj2ID
SELECT A.HouseholdsID_SRC, A.ProjectID_SRC, B.ProjectID, B.BuildingID
FROM #HousingCaseListAdj A
LEFT JOIN DIM_PROJECTID_LJ2AI B
ON A.ProjectID_SRC = cast(B.ProjectID_LJ as varchar)
WHERE A.Origin = '链家'
--
select
CommunityId as ProjectID,
ITEM_RANAME as ProjectName,
ITEM_RAADRESS as ProjectAddr,
County,
Block,
Loop,
item_UpperFloorSum as UpperFloorSum
into #TEMP_ODS_PROJECT_INFO
from obpm_LianCheng_Data.dbo.V_ResidenceCommunity;
with HouseingCaseZFZL_STD as(
select a.case_county , HouseholdsID,
case when [_1] is not null then [_1] else case_address end as [_1],
case when [_1] is not null then [_1] else case_community_name end as [_1]
from (
SELECT A.*,
STUFF(case_address, patindex('%(%',case_address),patindex('%)%',case_address)-patindex('%(%',case_address)+1,'') as [_1],
STUFF(case_community_name, patindex('%(%',case_community_name),patindex('%)%',case_community_name)-patindex('%(%',case_community_name)+1,'') as [_1]
FROM #HouseingCaseZFZL A
)a
)
select t.HouseHoldsID as HouseHoldsID_SRC, '-1' as ProjectID_SRC,
case when a.[ID] is not null then a.[ID]
when c.[ID] is not null then c.[ID]
else d.ProjectID end as "ProjectID",
a.[ID] as "BuildingID"
INTO #HousingCaseListAdj2ID_ZFZL
from HouseingCaseZFZL_STD t
left join (select * from [AI楼栋地址20190729] where [] = '居住') a
on LEFT(a.[],2)=LEFT(t.case_county,2) and (t.[_1] = a.[] or t.[_1] = a.[])
left join (select * from [AI小区地址20190729] where [] = '居住') c
on LEFT(c.[],2)=LEFT(t.case_county,2) and (t.[_1] = c.[] or t.[_1] = c.[] or t.[_1] = c.[] or t.[_1] = c.[])
left join #TEMP_ODS_PROJECT_INFO d
on LEFT(d.County,2)=LEFT(t.case_county,2) and (t.[_1] = d.ProjectName or t.[_1] = d.ProjectAddr);
INSERT INTO #HousingCaseListAdj2ID
SELECT HouseHoldsID_SRC, ProjectID_SRC, ProjectID, BuildingID
FROM (
SELECT ROW_NUMBER()OVER(PARTITION BY HouseHoldsID_SRC ORDER BY BuildingID DESC) SQ, A.*
FROM #HousingCaseListAdj2ID_ZFZL A
)T WHERE SQ=1;
DROP TABLE #HousingCaseListAdj2ID_ZFZL
DROP TABLE #HouseingCaseZFZL;
/****个性化:
***** NULL
***** 1.
***** 2.7
****/
UPDATE A
SET A.UpperFloorSum =
CASE WHEN A.UpperFloorSum<>0 AND A.UpperFloorSum IS NOT NULL THEN A.UpperFloorSum
WHEN C.[AI小区ID] IS NOT NULL THEN C.[]
ELSE D.UpperFloorSum END
FROM #HousingCaseListAdj A
LEFT JOIN #HousingCaseListAdj2ID B
ON A.HouseHoldsID_SRC = B.HouseHoldsID_SRC
LEFT JOIN [AI楼栋基价201709] C
ON B.ProjectID=C.[AI小区ID] AND B.BuildingID=C.[AI楼栋ID]
LEFT JOIN #TEMP_ODS_PROJECT_INFO D
ON B.ProjectID=D.ProjectID;
UPDATE #HousingCaseListAdj
SET UpperFloorSum = 7
WHERE UpperFloorSum IS NULL;
/***************************案例标准化*******************************/
create table #HousingCaseListSTD
(
HouseholdsID_SRC nvarchar(64)
, ProjectID_SRC nvarchar(64)
, ProjectID bigint
, BuildingID bigint
, AreaCoff decimal(7, 4)
, TowardsCoff decimal(7, 4)
, FloorCoff decimal(7, 4)
, DecorationRng int
, YearCoff decimal(7, 4)
, BuildingCoff decimal(7, 4)
, RoomTypeCoff decimal(7, 4)
, PriceUnit decimal(18, 2) not null
, PriceScatterRent decimal(18, 2) --
, PriceEntireRent decimal(18, 2) --
, PriceShareRent0 decimal(18, 2) --
, PriceShareRent decimal(18, 2) --
);
INSERT INTO #HousingCaseListSTD
SELECT A.HouseholdsID_SRC, A.ProjectID_SRC, B.ProjectID, B.BuildingID,
D.CoefficientA*A.Area+D.CoefficientB as AreaCoff, a.TowardsCoff as TowardsCoff, F.Coefficient as FloorCoff,
G.Coefficient as DecorationRng, 1 as YearCoff, I.Coefficient as BuildingCoff, J.Coefficient AS RoomTypeCoff, A.PriceUnit,
(A.PriceUnit-isnull(G.Coefficient,0))*1.0/isnull(D.CoefficientA*A.Area+D.CoefficientB,1)/isnull(a.TowardsCoff,1)/isnull(F.Coefficient,1)/isnull(I.Coefficient,1)/isnull(J.Coefficient,1) PriceScatterRent,
(A.PriceUnit-isnull(G.Coefficient,0))*1.0/isnull(D.CoefficientA*A.Area+D.CoefficientB,1)/isnull(a.TowardsCoff,1)/isnull(F.Coefficient,1)/isnull(I.Coefficient,1)/isnull(J.Coefficient,1)+isnull(G.Coefficient,0) PriceEntireRent,
A.PriceTotal*1.0/isnull(F.Coefficient,1)/isnull(a.TowardsCoff,1) as PriceShareRent0,
CASE WHEN A.Hall=0 THEN A.PriceTotal*A.Room*1.0/isnull(F.Coefficient,1)/isnull(a.TowardsCoff,1)
ELSE A.PriceTotal*(A.Room+A.Hall-1)*1.0/isnull(F.Coefficient,1)/isnull(a.TowardsCoff,1) END AS PriceShareRent
FROM #HousingCaseListAdj A
LEFT JOIN #HousingCaseListAdj2ID B
ON A.HouseholdsID_SRC = B.HouseholdsID_SRC
left join (select CommunityId,ProjectLevel from obpm_LianCheng_Data.dbo.V_ResidenceCommunity ) C
on B.ProjectID = C.CommunityId
LEFT JOIN (SELECT * FROM DIM_PARAMETERS WHERE CoffType='面积修正(租金)' and ProjectType = '公寓') D --
on C.ProjectLevel = D.ProjectLevel and ( A.Area > D.LowerKey and A.Area <= D.UpperKey)
LEFT JOIN (SELECT * FROM DIM_PARAMETERS WHERE CoffType='楼层(租金)' and ProjectType = '公寓') F --
on isnull(A.Elevator,99)=isnull(F.Elevator,99) and A.UpperFloorSum = F.UpperKey and A.UpperFloorNum = F.LowerKey
LEFT JOIN (SELECT * FROM DIM_PARAMETERS WHERE CoffType='室内装修(租金)' and ProjectType = '公寓') G --
on A.Decoration = G.SingleKey
LEFT JOIN DIM_BUILDING_COFF I
on B.BuildingID = I.BuildingID
LEFT JOIN (SELECT * FROM DIM_PARAMETERS WHERE CoffType='室加厅修正(租金)' and ProjectType = '公寓') J --
on A.Room = J.UpperKey and A.Hall = J.LowerKey;
--
select
a.HouseholdsID_SRC,
case when b.Status is null then 3
when a.PriceTotal=b.PriceTotal then 1
else 2 end as Status,
case when a.PriceTotal=b.PriceTotal then b.AdjustedValue
when b.Status is null then 0
else a.PriceTotal-b.PriceTotal end AdjustedValue,
case when a.PriceTotal=b.PriceTotal then b.AdjustedPst
when b.Status is null then 0
else (a.PriceTotal-b.PriceTotal)*1.0/b.PriceTotal end AdjustedPst,
case when a.PriceTotal=b.PriceTotal then b.AdjustedCumValue
when b.Status is null then 0
else b.AdjustedCumValue + a.PriceTotal-b.PriceTotal end AdjustedCumValue,
case when a.PriceTotal=b.PriceTotal then b.AdjustedCumPst
when b.Status is null then 0
else (b.AdjustedCumValue + a.PriceTotal-b.PriceTotal)*1.0/b.PriceTotalIn end AdjustedCumPst,
case when a.PriceTotal=b.PriceTotal then b.AdjustedCumValueAbs
when b.Status is null then 0
else b.AdjustedCumValueAbs + abs(a.PriceTotal-b.PriceTotal) end AdjustedCumValueAbs,
case when a.PriceTotal=b.PriceTotal then b.AdjustedCumPstAbs
when b.Status is null then 0
else (b.AdjustedCumValueAbs+ abs(a.PriceTotal-b.PriceTotal))*1.0/b.PriceTotalIn end AdjustedCumPstAbs,
case when a.PriceTotal=b.PriceTotal then b.AdjustedCumPstAbs
when b.Status is null then 0
else b.AdjustedCumNum+1 end AdjustedCumNum,
case when b.Status is null then a.PriceTotal else b.PriceTotalIn end PriceTotalIn,
NULL as PriceTotalOut,
case when b.Status is not null then b.PriceDateIn
when a.PriceDateIn is not null then a.PriceDateIn
else getdate() end as PriceDateIn,
cast(NULL as date) as PriceDateOut,
case when b.Status is not null then b.Origin
else a.Origin end as Origin
into #HousingCaseListStatic
from #HousingCaseListAdj a
left join dbo.Ods_HousingCaseListed_RENT_#lastYearMonth# b
on a.HouseholdsID_SRC = b.HouseholdsID_SRC;
/**************************插入案例到案例清洗表(非首期)***********************************/
--
--
insert into ODS_HOUSINGCASELISTED_RENT_#yearMonth#
select a.HouseholdsID_SRC, a.ProjectID_SRC, b.ProjectID, b.BuildingID, a.RentType, a.Room, a.Hall, a.Bashroom,
a.Area, a.Towards, a.UpperFloorSum, a.UpperFloorNum, a.Elevator, a.Decoration, a.[Year],
b.AreaCoff, b.TowardsCoff, b.FloorCoff, b.DecorationRng, b.YearCoff, b.BuildingCoff, b.RoomTypeCoff,
a.PriceTotal, a.PriceUnit, b.PriceScatterRent, b.PriceEntireRent, b.PriceShareRent0, b.PriceShareRent,
a.Visited_Num, a.First_Visit_Time, a.Visited_Num_15, a.Visited_Num_30,
c.Status, c.AdjustedValue, c.AdjustedPst, c.AdjustedCumValue, c.AdjustedCumPst, c.AdjustedCumValueAbs,
c.AdjustedCumPstAbs, c.AdjustedCumNum, c.PriceTotalIn, c.PriceTotalOut, c.PriceDateIn, c.PriceDateOut,
c.Origin, a.UrlHouseholds, a.UrlProjects, a.CaseName
from #HousingCaseListAdj a
left join #HousingCaseListSTD b
on a.HouseholdsID_SRC = b.HouseholdsID_SRC
left join #HousingCaseListStatic c
on a.HouseholdsID_SRC = c.HouseholdsID_SRC;
--
select a.HouseholdsID_SRC, a.ProjectID_SRC, a.ProjectID, a.BuildingID, a.RentType, a.Room, a.Hall, a.Bashroom,
a.Area, a.Towards, a.UpperFloorSum, a.UpperFloorNum, a.Elevator, a.Decoration, a.[Year],
a.AreaCoff, a.TowardsCoff, a.FloorCoff, a.DecorationRng, a.YearCoff, a.BuildingCoff, a.RoomTypeCoff,
a.PriceTotal, a.PriceUnit, a.PriceScatterRent, a.PriceEntireRent, a.PriceShareRent0, a.PriceShareRent,
a.Visited_Num, a.First_Visit_Time, a.Visited_Num_15, a.Visited_Num_30,
4 as Status, a.AdjustedValue, a.AdjustedPst, a.AdjustedCumValue, a.AdjustedCumPst, a.AdjustedCumValueAbs,
a.AdjustedCumPstAbs, a.AdjustedCumNum, a.PriceTotalIn, a.PriceTotal as PriceTotalOut, a.PriceDateIn, getdate() as PriceDateOut,
a.Origin, a.UrlHouseholds, a.UrlProjects, a.CaseName
into #TmpRecordAddCurr
from ODS_HOUSINGCASELISTED_RENT_#lastYearMonth# a
left join ODS_HOUSINGCASELISTED_RENT_#yearMonth# b
on a.HouseholdsID_SRC = b.HouseholdsID_SRC
where b.HouseholdsID_SRC is null and a.Status not in (4,5);
insert into ODS_HOUSINGCASELISTED_RENT_#yearMonth# select * from #TmpRecordAddCurr;
--
select a.HouseholdsID_SRC, a.ProjectID_SRC, a.ProjectID, a.BuildingID, a.RentType, a.Room, a.Hall, a.Bashroom,
a.Area, a.Towards, a.UpperFloorSum, a.UpperFloorNum, a.Elevator, a.Decoration, a.[Year],
a.AreaCoff, a.TowardsCoff, a.FloorCoff, a.DecorationRng, a.YearCoff, a.BuildingCoff, a.RoomTypeCoff,
a.PriceTotal, a.PriceUnit, a.PriceScatterRent, a.PriceEntireRent, a.PriceShareRent0, a.PriceShareRent,
a.Visited_Num, a.First_Visit_Time, a.Visited_Num_15, a.Visited_Num_30,
5 as Status, a.AdjustedValue, a.AdjustedPst, a.AdjustedCumValue, a.AdjustedCumPst, a.AdjustedCumValueAbs,
a.AdjustedCumPstAbs, a.AdjustedCumNum, a.PriceTotalIn, a.PriceTotal as PriceTotalOut, a.PriceDateIn, a.PriceDateOut,
a.Origin, a.UrlHouseholds, a.UrlProjects, a.CaseName
into #TmpRecordAddHis
from ODS_HOUSINGCASELISTED_RENT_#lastYearMonth# a
left join ODS_HOUSINGCASELISTED_RENT_#yearMonth# b
on a.HouseholdsID_SRC = b.HouseholdsID_SRC
where b.HouseholdsID_SRC is null and a.Status in (4,5);
insert into ODS_HOUSINGCASELISTED_RENT_#yearMonth# select * from #TmpRecordAddHis;
drop table #HousingCaseListAdj
drop table #HousingCaseListAdj2ID
drop table #HousingCaseListSTD
drop table #HousingCaseListStatic
drop table #TmpRecordAddCurr
drop table #TmpRecordAddHis
drop table #HouseholdsID
DROP TABLE #TEMP_ODS_PROJECT_INFO

View File

@ -1,15 +1,10 @@
--
update ODS_OFFICECASELISTED_#yearMonth#_RAW
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,
set [_M] = STUFF([], patindex('%(%',[]),patindex('%)%',[])-patindex('%(%',[])+1,'');
select distinct a.case_id,
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,
@ -24,23 +19,16 @@ 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
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
select distinct a.case_id, 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
----1q=/-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#
@ -55,7 +43,7 @@ coff as(
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
on a.case_id = b.case_id
left join DIM_OFFICE_PROJECT_BUILDING_201909 c
on b.BuildingID_P = c.BuildingID_P and c.EffDate <= getdate() AND c.ExpirDate > getdate()
),
@ -73,7 +61,7 @@ ListedPriceAvg_0_1 as(
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,
select a.*, cast(isnull(a.[],0)*1.0/FloorCoff/DecorationCoff as decimal(18,6)) 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
@ -87,7 +75,7 @@ left join (select BuildingID_P, ProjectID_P, MainPrice, MainPriceRent from ODS_O
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
left join ListedPriceAvg_1 e on a.BuildingID_P = e.BuildingID_P;
alter table DW_OFFICECASE_COMM_#yearMonth# add VOPPT nvarchar(32);
@ -115,7 +103,7 @@ select BuildingID_P, ProjectID_P,
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
group by BuildingID_P, ProjectID_P, MainPrice_1, MainPriceRent_1;
---
--
@ -137,8 +125,8 @@ left join (
)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
where (b.ProjectID_P is not null or c.BuildingID_P is not null) and a.EffDate <= getdate() AND a.ExpirDate > getdate();
--<=5++
with BindStreet as(
@ -147,26 +135,25 @@ with BindStreet as(
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
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
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
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
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
where (b.ProjectID_P is not null or c.BuildingID_P is not null) and a.EffDate <= getdate() AND a.ExpirDate > getdate();
--<=5++
with BindBlock as(
@ -175,26 +162,25 @@ with BindBlock as(
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
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
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
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
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
where(b.ProjectID_P is not null or c.BuildingID_P is not null) and a.EffDate <= getdate() AND a.ExpirDate > getdate();
--<=5++
with BindCounty as(
@ -203,26 +189,26 @@ with BindCounty as(
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
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
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
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
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
where (b.ProjectID_P is not null or c.BuildingID_P is not null) and a.EffDate <= getdate() AND a.ExpirDate > getdate();
--<=5++ 线
with BindLoop as(
@ -231,30 +217,29 @@ with BindLoop as(
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
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
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
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
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
where (b.ProjectID_P is not null or c.BuildingID_P is not null) and a.EffDate <= getdate() AND a.ExpirDate > getdate();
---
---///t~t4t5t5
select newid() as id
select row_number() over( order by newid() ) id
, a.BuildingID
, a.UnifiedID
, a.ProjectID

View File

@ -7,20 +7,38 @@ select a.BuildingID_p, a.ProjectID_p, a.MainPrice, a.MainPriceRent, a.MainPrice_
into #InfoChg
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 (
on a.BuildingID_p = 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 and c.status=1 and (
on a.BuildingID_p = 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 is not null or c.BuildingID is not null;
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, b.MainPriceRent_1,
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,
case when MainPrice_1Chg=0 then '' else 'MainPrice_1Chg|' end + case when MainPriceRent_1Chg=0 then '' else 'MainPriceRent_1Chg|' end as AdjEvd
, a.MainPrice_1
, a.MainPriceRent_1
, a.AreaCoff
, a.YearCoff
, a.BuildingCoff
, 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
into #InfoChgLst
from ODS_OFFICE_BUILDING_PRICE_INFO_#lastYearMonth# a
inner join #InfoChg b
@ -36,8 +54,7 @@ where b.BuildingID_p is not null and a.status=1;
insert into ODS_OFFICE_BUILDING_PRICE_INFO_#lastYearMonth#
(
id
, BuildingID
BuildingID
, UnifiedID
, ProjectID
, BuildingID_P
@ -72,8 +89,7 @@ insert into ODS_OFFICE_BUILDING_PRICE_INFO_#lastYearMonth#
, Grade
)
select
newid()
, BuildingID
BuildingID
, UnifiedID
, ProjectID
, BuildingID_P
@ -113,6 +129,24 @@ select a.BuildingID, a.UnifiedID, a.ProjectID, a.BuildingID_P, a.ProjectID_P, b.
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
, c.MainPrice_1
, c.MainPriceRent_1
, a.AreaCoff
, a.YearCoff
, a.BuildingCoff
, 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
into #InfoChgCurr
from ODS_OFFICE_BUILDING_PRICE_INFO_#yearMonth# a
inner join #InfoChg b
@ -130,8 +164,7 @@ where b.BuildingID_p is not null and a.status=1;
insert into dbo.ODS_OFFICE_BUILDING_PRICE_INFO_#yearMonth#
(
id
, BuildingID
BuildingID
, UnifiedID
, ProjectID
, BuildingID_P
@ -166,8 +199,7 @@ insert into dbo.ODS_OFFICE_BUILDING_PRICE_INFO_#yearMonth#
, Grade
)
select
newid()
, BuildingID
BuildingID
, UnifiedID
, ProjectID
, BuildingID_P

View File

@ -0,0 +1,35 @@
package com.uvaluation.compute;
import com.ruoyi.RuoYiApplication;
import com.ruoyi.project.data.cases.service.IOriginalOfficeCaseService;
import com.ruoyi.project.data.cases.service.IOriginalResidenceSaleClosingCaseService;
import com.ruoyi.project.data.cases.service.IOriginalResidenceSaleOpeningCaseService;
import com.ruoyi.project.data.price.domain.ComputeResidenceSaleBasePrice;
import com.ruoyi.project.data.price.service.IArtificialResidenceSalePriceService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import java.math.BigDecimal;
import java.util.LinkedList;
import java.util.List;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = RuoYiApplication.class)
@ActiveProfiles("uat")
public class OfficeBasePriceTests {
@Autowired
private IOriginalOfficeCaseService originalOfficeCaseService;
/**
* 下载案例并且作价
*/
@Test
public void testCompute() {
originalOfficeCaseService.compute();
}
}

View File

@ -1,6 +1,7 @@
package com.uvaluation.compute;
import com.ruoyi.RuoYiApplication;
import com.ruoyi.project.data.cases.service.IOriginalResidenceRentClosingCaseService;
import com.ruoyi.project.data.cases.service.IOriginalResidenceRentOpeningCaseService;
import com.ruoyi.project.data.cases.service.IOriginalResidenceSaleClosingCaseService;
import com.ruoyi.project.data.cases.service.IOriginalResidenceSaleOpeningCaseService;
@ -10,6 +11,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import java.math.BigDecimal;
@ -18,33 +20,22 @@ import java.util.List;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = RuoYiApplication.class)
@ActiveProfiles("uat")
public class ResidenceRentBasePriceTests {
//
// @Autowired
// private IOriginalResidenceRentOpeningCaseService originalResidenceRentOpeningCaseService;
// @Autowired
// private IArtificialResidenceSalePriceService artificialResidenceSalePriceService;
// @Autowired
// private IOriginalResidenceSaleClosingCaseService originalResidenceClosingCaseService;
//
// @Test
// public void testClearOpeningCase() {
// originalResidenceRentOpeningCaseService.pullData();
// }
//
// @Test
// public void testClearClosingCase() {
// originalResidenceClosingCaseService.clear();
// }
//
// @Test
// public void testBatchImport() {
// List<ComputeResidenceSaleBasePrice> list = new LinkedList<>();
// ComputeResidenceSaleBasePrice computeResidenceSaleBasePrice = new ComputeResidenceSaleBasePrice();
// computeResidenceSaleBasePrice.setCommunityId("10101");
// computeResidenceSaleBasePrice.setBasePriceDraft(new BigDecimal(12222));
// list.add(computeResidenceSaleBasePrice);
// artificialResidenceSalePriceService.batchImport(202007, list);
// }
@Autowired
private IOriginalResidenceRentOpeningCaseService originalResidenceRentOpeningCaseService;
@Autowired
private IOriginalResidenceRentClosingCaseService originalResidenceRentClosingCaseService;
@Test
public void testClearOpeningCase() {
originalResidenceRentOpeningCaseService.pullData();
}
@Test
public void testClearClosingCase() {
originalResidenceRentClosingCaseService.pullData();
}
}