feature(住宅租赁作价):新增成交案例来源
1. 添加太平洋提供住宅租赁案例数据 2. 查询页面和导出添加主力面积字段
This commit is contained in:
@ -79,6 +79,7 @@
|
|||||||
<el-table-column label="租金主力面积系数" align="center" prop="mainCoefficientRent" />
|
<el-table-column label="租金主力面积系数" align="center" prop="mainCoefficientRent" />
|
||||||
<el-table-column label="AI租金(草稿)" align="center" prop="rentPriceDft" />
|
<el-table-column label="AI租金(草稿)" align="center" prop="rentPriceDft" />
|
||||||
<el-table-column label="主力面积租金(草稿)" align="center" prop="mainRentPriceDft" />
|
<el-table-column label="主力面积租金(草稿)" align="center" prop="mainRentPriceDft" />
|
||||||
|
<el-table-column label="主力面积(㎡)" align="center" prop="area" />
|
||||||
<el-table-column label="上月AI租金" align="center" prop="rentPrice_1" />
|
<el-table-column label="上月AI租金" align="center" prop="rentPrice_1" />
|
||||||
<el-table-column label="成交均价(上周期)" align="center" prop="priceDealMean_1" />
|
<el-table-column label="成交均价(上周期)" align="center" prop="priceDealMean_1" />
|
||||||
<el-table-column label="成交最大价(上周期)" align="center" prop="priceDealMax_1" />
|
<el-table-column label="成交最大价(上周期)" align="center" prop="priceDealMax_1" />
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.ruoyi.common.exception;
|
||||||
|
|
||||||
|
import com.ruoyi.common.utils.MessageUtils;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作价数据未找到
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class ComputeDataNotFoundException extends RuntimeException {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属模块
|
||||||
|
*/
|
||||||
|
private String module;
|
||||||
|
|
||||||
|
public ComputeDataNotFoundException(String module) {
|
||||||
|
this.module = module;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getMessage() {
|
||||||
|
return module + "未找到相关案例数据。";
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
package com.ruoyi.framework.task;
|
package com.ruoyi.framework.task;
|
||||||
|
|
||||||
import com.ruoyi.project.data.cases.service.IOriginalOfficeCaseService;
|
import com.ruoyi.project.data.cases.service.IOriginalOfficeCaseService;
|
||||||
|
import com.ruoyi.project.data.cases.service.IOriginalResidenceRentClosingCaseService;
|
||||||
import com.ruoyi.project.data.cases.service.IOriginalResidenceRentOpeningCaseService;
|
import com.ruoyi.project.data.cases.service.IOriginalResidenceRentOpeningCaseService;
|
||||||
import com.ruoyi.project.data.cases.service.impl.DownloadOriginalNewHouseCaseServiceImpl;
|
import com.ruoyi.project.data.cases.service.impl.DownloadOriginalNewHouseCaseServiceImpl;
|
||||||
import com.ruoyi.project.data.cases.service.impl.DownloadOriginalResidenceSaleClosingCaseServiceImpl;
|
import com.ruoyi.project.data.cases.service.impl.DownloadOriginalResidenceSaleClosingCaseServiceImpl;
|
||||||
@ -25,6 +26,10 @@ public class RyTask {
|
|||||||
private DownloadOriginalNewHouseCaseServiceImpl downloadOriginalNewHouseCaseService;
|
private DownloadOriginalNewHouseCaseServiceImpl downloadOriginalNewHouseCaseService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IOriginalOfficeCaseService originalOfficeCaseService;
|
private IOriginalOfficeCaseService originalOfficeCaseService;
|
||||||
|
@Autowired
|
||||||
|
private IOriginalResidenceRentOpeningCaseService originalResidenceRentOpeningCaseService;
|
||||||
|
@Autowired
|
||||||
|
private IOriginalResidenceRentClosingCaseService originalResidenceRentClosingCaseService;
|
||||||
|
|
||||||
public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) {
|
public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) {
|
||||||
System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i));
|
System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i));
|
||||||
@ -73,4 +78,17 @@ public class RyTask {
|
|||||||
originalOfficeCaseService.compute();
|
originalOfficeCaseService.compute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 住宅租赁挂牌案例下载
|
||||||
|
*/
|
||||||
|
public void downloadRentOpeningCase() {
|
||||||
|
originalResidenceRentOpeningCaseService.pullData();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 住宅租赁成交案例下载
|
||||||
|
*/
|
||||||
|
public void downloadRentClosingCase() {
|
||||||
|
originalResidenceRentClosingCaseService.pullData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import java.util.Date;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 租赁成交案例
|
* 租赁成交案例
|
||||||
|
* @author lihe
|
||||||
*/
|
*/
|
||||||
public class OriginalResidenceRentClosingCase {
|
public class OriginalResidenceRentClosingCase {
|
||||||
private String caseId;
|
private String caseId;
|
||||||
|
@ -0,0 +1,184 @@
|
|||||||
|
package com.ruoyi.project.data.cases.domain;
|
||||||
|
|
||||||
|
import org.springframework.util.DigestUtils;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新的租赁成交案例
|
||||||
|
*
|
||||||
|
* @author lihe
|
||||||
|
*/
|
||||||
|
public class OtherResidenceRentClosingCase {
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private String caseId;
|
||||||
|
/**
|
||||||
|
* 案例区域
|
||||||
|
*/
|
||||||
|
private String caseDistrict;
|
||||||
|
/**
|
||||||
|
* 案例小区名称
|
||||||
|
*/
|
||||||
|
private String caseCommunityName;
|
||||||
|
/**
|
||||||
|
* 案例地址
|
||||||
|
*/
|
||||||
|
private String caseAddress;
|
||||||
|
/**
|
||||||
|
* 面积
|
||||||
|
*/
|
||||||
|
private BigDecimal caseArea;
|
||||||
|
/**
|
||||||
|
* 成交日期
|
||||||
|
*/
|
||||||
|
private Date closingDate;
|
||||||
|
/**
|
||||||
|
* 总价
|
||||||
|
*/
|
||||||
|
private BigDecimal caseTotalPrice;
|
||||||
|
/**
|
||||||
|
* 朝向
|
||||||
|
*/
|
||||||
|
private String caseDecoration;
|
||||||
|
/**
|
||||||
|
* 总楼层
|
||||||
|
*/
|
||||||
|
private Integer caseTotalFloor;
|
||||||
|
/**
|
||||||
|
* 所在层
|
||||||
|
*/
|
||||||
|
private String caseCurrentFloor;
|
||||||
|
/**
|
||||||
|
* 朝向
|
||||||
|
*/
|
||||||
|
private String caseToward;
|
||||||
|
/**
|
||||||
|
* 楼层
|
||||||
|
*/
|
||||||
|
private String caseFloor;
|
||||||
|
/**
|
||||||
|
* 小区
|
||||||
|
*/
|
||||||
|
private String uvCommunityId;
|
||||||
|
/**
|
||||||
|
* 楼栋
|
||||||
|
*/
|
||||||
|
private String uvBuildingId;
|
||||||
|
|
||||||
|
|
||||||
|
public String getCaseId() {
|
||||||
|
return UUID.randomUUID().toString().replace("-","");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseId(String caseId) {
|
||||||
|
this.caseId = caseId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCaseDistrict() {
|
||||||
|
return caseDistrict;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseDistrict(String caseDistrict) {
|
||||||
|
this.caseDistrict = caseDistrict;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCaseCommunityName() {
|
||||||
|
return caseCommunityName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseCommunityName(String caseCommunityName) {
|
||||||
|
this.caseCommunityName = caseCommunityName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCaseAddress() {
|
||||||
|
return caseAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseAddress(String caseAddress) {
|
||||||
|
this.caseAddress = caseAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCaseArea() {
|
||||||
|
return caseArea;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseArea(BigDecimal caseArea) {
|
||||||
|
this.caseArea = caseArea;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getClosingDate() {
|
||||||
|
return closingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClosingDate(Date closingDate) {
|
||||||
|
this.closingDate = closingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCaseTotalPrice() {
|
||||||
|
return caseTotalPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseTotalPrice(BigDecimal caseTotalPrice) {
|
||||||
|
this.caseTotalPrice = caseTotalPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCaseDecoration() {
|
||||||
|
return caseDecoration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseDecoration(String caseDecoration) {
|
||||||
|
this.caseDecoration = caseDecoration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCaseTotalFloor() {
|
||||||
|
return caseTotalFloor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseTotalFloor(Integer caseTotalFloor) {
|
||||||
|
this.caseTotalFloor = caseTotalFloor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCaseCurrentFloor() {
|
||||||
|
return caseCurrentFloor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseCurrentFloor(String caseCurrentFloor) {
|
||||||
|
this.caseCurrentFloor = caseCurrentFloor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCaseToward() {
|
||||||
|
return caseToward;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseToward(String caseToward) {
|
||||||
|
this.caseToward = caseToward;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCaseFloor() {
|
||||||
|
return caseFloor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseFloor(String caseFloor) {
|
||||||
|
this.caseFloor = caseFloor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUvCommunityId() {
|
||||||
|
return uvCommunityId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUvCommunityId(String uvCommunityId) {
|
||||||
|
this.uvCommunityId = uvCommunityId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUvBuildingId() {
|
||||||
|
return uvBuildingId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUvBuildingId(String uvBuildingId) {
|
||||||
|
this.uvBuildingId = uvBuildingId;
|
||||||
|
}
|
||||||
|
}
|
@ -18,6 +18,14 @@ public interface OriginalResidenceRentClosingCaseMapper {
|
|||||||
*/
|
*/
|
||||||
int createRawTable(@Param("yearMonth") Integer yearMonth);
|
int createRawTable(@Param("yearMonth") Integer yearMonth);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建其他住宅租赁成交案例
|
||||||
|
*
|
||||||
|
* @param tableRoute
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int createOtherRawTable(@Param("yearMonth") Integer tableRoute);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建清洗完成之后的表ODS_HOUSINGCASELISTED_LJ_YYYYMM
|
* 创建清洗完成之后的表ODS_HOUSINGCASELISTED_LJ_YYYYMM
|
||||||
*
|
*
|
||||||
@ -33,8 +41,10 @@ public interface OriginalResidenceRentClosingCaseMapper {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int createAssembleTable(@Param("yearMonth") Integer yearMonth);
|
int createAssembleTable(@Param("yearMonth") Integer yearMonth);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 作价表
|
* 作价表
|
||||||
|
*
|
||||||
* @param yearMonth
|
* @param yearMonth
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -42,6 +52,7 @@ public interface OriginalResidenceRentClosingCaseMapper {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 人工修正价格表
|
* 人工修正价格表
|
||||||
|
*
|
||||||
* @param yearMonth
|
* @param yearMonth
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -25,6 +25,8 @@ public interface OriginalResidenceSaleClosingCaseMapper {
|
|||||||
*/
|
*/
|
||||||
int createRawTable(@Param("yearMonth") Integer yearMonth);
|
int createRawTable(@Param("yearMonth") Integer yearMonth);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 插入住宅销售成交案例
|
* 插入住宅销售成交案例
|
||||||
*
|
*
|
||||||
@ -54,4 +56,6 @@ public interface OriginalResidenceSaleClosingCaseMapper {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<OriginalResidenceSaleOpeningCase> pageList(OriginalResidenceSaleOpeningCaseQueryModel queryModel);
|
List<OriginalResidenceSaleOpeningCase> pageList(OriginalResidenceSaleOpeningCaseQueryModel queryModel);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,13 +6,20 @@ import org.apache.ibatis.annotations.Param;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 住宅租赁成交案例下载
|
||||||
|
*
|
||||||
|
* @author lihe
|
||||||
|
*/
|
||||||
@DS("calc")
|
@DS("calc")
|
||||||
public interface DownloadOriginalResidenceRentClosingCaseMapper {
|
public interface DownloadOriginalResidenceRentClosingCaseMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 租赁成交案例数据下载
|
* 租赁成交案例数据下载
|
||||||
*
|
*
|
||||||
|
* @param yearMonth
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<OriginalResidenceRentClosingCase> download(@Param("yearMonth") Integer yearMonth);
|
List<OriginalResidenceRentClosingCase> download(@Param("yearMonth") Integer yearMonth);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.ruoyi.project.data.cases.mapper.sync;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.ruoyi.project.data.cases.domain.OriginalResidenceRentClosingCase;
|
||||||
|
import com.ruoyi.project.data.cases.domain.OtherResidenceRentClosingCase;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 其他住宅租赁案例下载
|
||||||
|
*
|
||||||
|
* @author lihe
|
||||||
|
*/
|
||||||
|
@DS("spider2")
|
||||||
|
public interface DownloadOtherResidenceRentClosingCaseMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租赁成交案例数据下载
|
||||||
|
*
|
||||||
|
* @param yearMonth
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<OtherResidenceRentClosingCase> download(@Param("yearMonth") Integer yearMonth);
|
||||||
|
}
|
@ -1,5 +1,13 @@
|
|||||||
package com.ruoyi.project.data.cases.service;
|
package com.ruoyi.project.data.cases.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 住宅租赁成交案例Service
|
||||||
|
*
|
||||||
|
* @author lihe
|
||||||
|
*/
|
||||||
public interface IOriginalResidenceRentClosingCaseService {
|
public interface IOriginalResidenceRentClosingCaseService {
|
||||||
|
/**
|
||||||
|
* 数据下载
|
||||||
|
*/
|
||||||
void pullData();
|
void pullData();
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ public class DownloadOriginalResidenceSaleClosingCaseServiceImpl {
|
|||||||
running(tableRoute, originalResidenceSaleClosingCases);
|
running(tableRoute, originalResidenceSaleClosingCases);
|
||||||
after(tableRoute);
|
after(tableRoute);
|
||||||
|
|
||||||
// copy2UVData(tableRoute, remoteTableRoute);
|
copy2UVData(tableRoute, remoteTableRoute);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.ruoyi.project.data.cases.service.impl;
|
package com.ruoyi.project.data.cases.service.impl;
|
||||||
|
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.ruoyi.common.exception.ComputeDataNotFoundException;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.LoadUtil;
|
import com.ruoyi.common.utils.LoadUtil;
|
||||||
import com.ruoyi.project.data.cases.domain.OriginalOfficeCase;
|
import com.ruoyi.project.data.cases.domain.OriginalOfficeCase;
|
||||||
@ -76,6 +77,9 @@ public class OriginalOfficeCaseServiceImpl implements IOriginalOfficeCaseService
|
|||||||
|
|
||||||
// 下载列表
|
// 下载列表
|
||||||
List<OriginalOfficeCase> downloadList = downloadOriginalOfficeCaseMapper.download(startDate, endDate);
|
List<OriginalOfficeCase> downloadList = downloadOriginalOfficeCaseMapper.download(startDate, endDate);
|
||||||
|
if (0 == downloadList.size()) {
|
||||||
|
throw new ComputeDataNotFoundException("办公作价");
|
||||||
|
}
|
||||||
SqlParameterSource[] batchParams = SqlParameterSourceUtils.createBatch(downloadList.toArray());
|
SqlParameterSource[] batchParams = SqlParameterSourceUtils.createBatch(downloadList.toArray());
|
||||||
namedParameterJdbcTemplate.batchUpdate("insert into dbo.ODS_OFFICECASELISTED_" + yearMonth.toString() + "_RAW" +
|
namedParameterJdbcTemplate.batchUpdate("insert into dbo.ODS_OFFICECASELISTED_" + yearMonth.toString() + "_RAW" +
|
||||||
"(case_id,url, title,容积率,总价售,均价售, 楼盘名称, 楼盘名称_M, 楼层, 面积, 物业费, 工位数, 地址, 地铁, 发布时间, 房源编号, 百度lng, " +
|
"(case_id,url, title,容积率,总价售,均价售, 楼盘名称, 楼盘名称_M, 楼层, 面积, 物业费, 工位数, 地址, 地铁, 发布时间, 房源编号, 百度lng, " +
|
||||||
|
@ -1,10 +1,13 @@
|
|||||||
package com.ruoyi.project.data.cases.service.impl;
|
package com.ruoyi.project.data.cases.service.impl;
|
||||||
|
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.LoadUtil;
|
import com.ruoyi.common.utils.LoadUtil;
|
||||||
import com.ruoyi.project.data.cases.domain.OriginalResidenceRentClosingCase;
|
import com.ruoyi.project.data.cases.domain.OriginalResidenceRentClosingCase;
|
||||||
|
import com.ruoyi.project.data.cases.domain.OtherResidenceRentClosingCase;
|
||||||
import com.ruoyi.project.data.cases.mapper.OriginalResidenceRentClosingCaseMapper;
|
import com.ruoyi.project.data.cases.mapper.OriginalResidenceRentClosingCaseMapper;
|
||||||
import com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalResidenceRentClosingCaseMapper;
|
import com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalResidenceRentClosingCaseMapper;
|
||||||
|
import com.ruoyi.project.data.cases.mapper.sync.DownloadOtherResidenceRentClosingCaseMapper;
|
||||||
import com.ruoyi.project.data.cases.service.IOriginalResidenceRentClosingCaseService;
|
import com.ruoyi.project.data.cases.service.IOriginalResidenceRentClosingCaseService;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -31,6 +34,8 @@ public class OriginalResidenceRentClosingCaseServiceImpl implements IOriginalRes
|
|||||||
@Autowired
|
@Autowired
|
||||||
private DownloadOriginalResidenceRentClosingCaseMapper downloadOriginalResidenceRentClosingCaseMapper;
|
private DownloadOriginalResidenceRentClosingCaseMapper downloadOriginalResidenceRentClosingCaseMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private DownloadOtherResidenceRentClosingCaseMapper downloadOtherResidenceRentClosingCaseMapper;
|
||||||
|
@Autowired
|
||||||
private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
|
private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
|
||||||
@Autowired
|
@Autowired
|
||||||
private JdbcTemplate jdbcTemplate;
|
private JdbcTemplate jdbcTemplate;
|
||||||
@ -38,26 +43,19 @@ public class OriginalResidenceRentClosingCaseServiceImpl implements IOriginalRes
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Scheduled(cron = "0 0 15 29 * ?")
|
|
||||||
@Override
|
@Override
|
||||||
public void pullData() {
|
public void pullData() {
|
||||||
Calendar calendar = Calendar.getInstance();
|
Integer targetTableRoute = DateUtils.getLastYearMonth();
|
||||||
calendar.setTime(new Date());
|
Integer lastYearMonth = DateUtils.getYearMonth();
|
||||||
Integer targetTableRoute = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
|
Integer computeTableRoute = DateUtils.getNextYearMonth();
|
||||||
calendar.get(Calendar.MONTH)));
|
|
||||||
Integer lastYearMonth = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
|
|
||||||
calendar.get(Calendar.MONTH) + 1));
|
|
||||||
calendar.add(Calendar.MONTH, 1);
|
|
||||||
Integer computeTableRoute = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
|
|
||||||
calendar.get(Calendar.MONTH) + 1));
|
|
||||||
|
|
||||||
// targetTableRoute = 202005;
|
|
||||||
// computeTableRoute = 202007;
|
|
||||||
|
|
||||||
prepare(computeTableRoute);
|
prepare(computeTableRoute);
|
||||||
List<OriginalResidenceRentClosingCase> list =
|
List<OriginalResidenceRentClosingCase> list =
|
||||||
downloadOriginalResidenceRentClosingCaseMapper.download(targetTableRoute);
|
downloadOriginalResidenceRentClosingCaseMapper.download(targetTableRoute);
|
||||||
running(computeTableRoute, list);
|
|
||||||
|
List<OtherResidenceRentClosingCase> otherResidenceRentClosingCaseList =
|
||||||
|
downloadOtherResidenceRentClosingCaseMapper.download(targetTableRoute);
|
||||||
|
running(computeTableRoute, list, otherResidenceRentClosingCaseList);
|
||||||
after(computeTableRoute, lastYearMonth);
|
after(computeTableRoute, lastYearMonth);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,6 +66,8 @@ public class OriginalResidenceRentClosingCaseServiceImpl implements IOriginalRes
|
|||||||
*/
|
*/
|
||||||
public void prepare(Integer computeTableRoute) {
|
public void prepare(Integer computeTableRoute) {
|
||||||
originalResidenceRentClosingCaseMapper.createRawTable(computeTableRoute);
|
originalResidenceRentClosingCaseMapper.createRawTable(computeTableRoute);
|
||||||
|
// 新增住宅租赁成交案例
|
||||||
|
originalResidenceRentClosingCaseMapper.createOtherRawTable(computeTableRoute);
|
||||||
originalResidenceRentClosingCaseMapper.createCleanTable(computeTableRoute);
|
originalResidenceRentClosingCaseMapper.createCleanTable(computeTableRoute);
|
||||||
originalResidenceRentClosingCaseMapper.createAssembleTable(computeTableRoute);
|
originalResidenceRentClosingCaseMapper.createAssembleTable(computeTableRoute);
|
||||||
originalResidenceRentClosingCaseMapper.createComputeTable(computeTableRoute);
|
originalResidenceRentClosingCaseMapper.createComputeTable(computeTableRoute);
|
||||||
@ -81,7 +81,8 @@ public class OriginalResidenceRentClosingCaseServiceImpl implements IOriginalRes
|
|||||||
* @param computeTableRoute
|
* @param computeTableRoute
|
||||||
* @param list
|
* @param list
|
||||||
*/
|
*/
|
||||||
public void running(Integer computeTableRoute, List<OriginalResidenceRentClosingCase> list) {
|
public void running(Integer computeTableRoute, List<OriginalResidenceRentClosingCase> list,
|
||||||
|
List<OtherResidenceRentClosingCase> otherResidenceRentClosingCaseList) {
|
||||||
SqlParameterSource[] batchParams = SqlParameterSourceUtils.createBatch(list.toArray());
|
SqlParameterSource[] batchParams = SqlParameterSourceUtils.createBatch(list.toArray());
|
||||||
int[] updateCounts = namedParameterJdbcTemplate.batchUpdate("insert into dbo" +
|
int[] updateCounts = namedParameterJdbcTemplate.batchUpdate("insert into dbo" +
|
||||||
".ODS_HOUSINGCASEDEAL_RENT_" + computeTableRoute + "_RAW(case_id, case_contract_no, " +
|
".ODS_HOUSINGCASEDEAL_RENT_" + computeTableRoute + "_RAW(case_id, case_contract_no, " +
|
||||||
@ -92,6 +93,18 @@ public class OriginalResidenceRentClosingCaseServiceImpl implements IOriginalRes
|
|||||||
":caseRentPrice,:caseTotalFloor,:caseArea,:caseToward,:caseApartmentLayout,:caseDecoration," +
|
":caseRentPrice,:caseTotalFloor,:caseArea,:caseToward,:caseApartmentLayout,:caseDecoration," +
|
||||||
":cleanCommunityId,:cleanBuildingId);",
|
":cleanCommunityId,:cleanBuildingId);",
|
||||||
batchParams);
|
batchParams);
|
||||||
|
|
||||||
|
batchParams = SqlParameterSourceUtils.createBatch(otherResidenceRentClosingCaseList.toArray());
|
||||||
|
updateCounts = namedParameterJdbcTemplate.batchUpdate("insert into dbo" +
|
||||||
|
".TEMP_ODS_HOUSINGCASEDEAL_RENT_" + computeTableRoute + "_RAW(case_id,case_district," +
|
||||||
|
"case_community_name,case_address,case_area,case_closing_date,case_total_price," +
|
||||||
|
"case_decoration,case_total_floor,case_current_floor,case_toward,case_floor,uv_community_id," +
|
||||||
|
"uv_building_id) " +
|
||||||
|
"values (:caseId,:caseDistrict,:caseCommunityName,:caseAddress,:caseArea,:closingDate," +
|
||||||
|
":caseTotalPrice,:caseDecoration,:caseTotalFloor,:caseCurrentFloor,:caseToward,:caseFloor," +
|
||||||
|
":uvCommunityId,:uvBuildingId);",
|
||||||
|
batchParams);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -104,6 +117,12 @@ public class OriginalResidenceRentClosingCaseServiceImpl implements IOriginalRes
|
|||||||
String rawSql = LoadUtil.loadContent("sql-template/clear_rent_closing_case.sql");
|
String rawSql = LoadUtil.loadContent("sql-template/clear_rent_closing_case.sql");
|
||||||
String sql = rawSql.replace("#yearMonth#", yearMonth.toString());
|
String sql = rawSql.replace("#yearMonth#", yearMonth.toString());
|
||||||
jdbcTemplate.update(sql);
|
jdbcTemplate.update(sql);
|
||||||
|
|
||||||
|
// 其他住宅租赁成交案例
|
||||||
|
rawSql = LoadUtil.loadContent("sql-template/clear_other_rent_closing_case.sql");
|
||||||
|
sql = rawSql.replace("#yearMonth#", yearMonth.toString());
|
||||||
|
jdbcTemplate.update(sql);
|
||||||
|
|
||||||
// 计算
|
// 计算
|
||||||
rawSql = LoadUtil.loadContent("sql-template/compute_rent_price.sql");
|
rawSql = LoadUtil.loadContent("sql-template/compute_rent_price.sql");
|
||||||
sql = rawSql.replace("#yearMonth#", yearMonth.toString())
|
sql = rawSql.replace("#yearMonth#", yearMonth.toString())
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.ruoyi.project.data.cases.service.impl;
|
package com.ruoyi.project.data.cases.service.impl;
|
||||||
|
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.common.utils.LoadUtil;
|
import com.ruoyi.common.utils.LoadUtil;
|
||||||
import com.ruoyi.project.data.cases.domain.OriginalResidencePlatformRentOpeningCase;
|
import com.ruoyi.project.data.cases.domain.OriginalResidencePlatformRentOpeningCase;
|
||||||
import com.ruoyi.project.data.cases.domain.OriginalResidenceRentOpeningCase;
|
import com.ruoyi.project.data.cases.domain.OriginalResidenceRentOpeningCase;
|
||||||
@ -43,22 +44,20 @@ public class OriginalResidenceRentOpeningCaseServiceImpl implements IOriginalRes
|
|||||||
/**
|
/**
|
||||||
* 29号拉取挂牌案例
|
* 29号拉取挂牌案例
|
||||||
*/
|
*/
|
||||||
@Scheduled(cron = "0 0 5 29 * ?")
|
|
||||||
@Override
|
@Override
|
||||||
public void pullData() {
|
public void pullData() {
|
||||||
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.setTime(new Date());
|
calendar.setTime(new Date());
|
||||||
Integer syncTableRoute = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
|
|
||||||
calendar.get(Calendar.MONTH)));
|
|
||||||
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);
|
calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), 1);
|
||||||
Date startDate = calendar.getTime();
|
Date startDate = calendar.getTime();
|
||||||
calendar.add(Calendar.MONTH, 1);
|
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();
|
Date endDate = calendar.getTime();
|
||||||
|
|
||||||
|
Integer computeTableRoute = DateUtils.getNextYearMonth();
|
||||||
|
Integer lastYearMonth = DateUtils.getYearMonth();
|
||||||
|
Integer syncTableRoute = DateUtils.getLastYearMonth();
|
||||||
|
|
||||||
prepare(computeTableRoute, syncTableRoute);
|
prepare(computeTableRoute, syncTableRoute);
|
||||||
// 拉取案例
|
// 拉取案例
|
||||||
List<OriginalResidenceRentOpeningCase> list = downloadOriginalResidenceRentOpeningCaseMapper.download();
|
List<OriginalResidenceRentOpeningCase> list = downloadOriginalResidenceRentOpeningCaseMapper.download();
|
||||||
|
@ -18,6 +18,8 @@ public interface ComputeResidenceRentPriceMapper {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询列表
|
* 查询列表
|
||||||
|
* @param ComputeResidenceRentBasePrice
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
List<ComputeResidenceRentBasePrice> selectPageList(ComputeResidenceRentBasePrice ComputeResidenceRentBasePrice);
|
List<ComputeResidenceRentBasePrice> selectPageList(ComputeResidenceRentBasePrice ComputeResidenceRentBasePrice);
|
||||||
|
|
||||||
|
@ -78,3 +78,8 @@ spring:
|
|||||||
url: jdbc:sqlserver://139.196.201.83:1433;DatabaseName=TEST
|
url: jdbc:sqlserver://139.196.201.83:1433;DatabaseName=TEST
|
||||||
username: purple
|
username: purple
|
||||||
password: liancheng
|
password: liancheng
|
||||||
|
spider2:
|
||||||
|
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
url: jdbc:sqlserver://172.16.30.246:1433;DatabaseName=LCSP
|
||||||
|
username: lc_spider
|
||||||
|
password: lc123456
|
@ -84,3 +84,8 @@ spring:
|
|||||||
url: jdbc:sqlserver://139.196.201.83:1433;DatabaseName=TEST
|
url: jdbc:sqlserver://139.196.201.83:1433;DatabaseName=TEST
|
||||||
username: purple
|
username: purple
|
||||||
password: liancheng
|
password: liancheng
|
||||||
|
spider2:
|
||||||
|
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
url: jdbc:sqlserver://172.16.30.246:1433;DatabaseName=LCSP
|
||||||
|
username: lc_spider
|
||||||
|
password: lc123456
|
@ -78,3 +78,8 @@ spring:
|
|||||||
url: jdbc:sqlserver://139.196.201.83:1433;DatabaseName=TEST
|
url: jdbc:sqlserver://139.196.201.83:1433;DatabaseName=TEST
|
||||||
username: purple
|
username: purple
|
||||||
password: liancheng
|
password: liancheng
|
||||||
|
spider2:
|
||||||
|
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
|
url: jdbc:sqlserver://172.16.30.246:1433;DatabaseName=LCSP
|
||||||
|
username: lc_spider
|
||||||
|
password: lc123456
|
@ -65,6 +65,7 @@
|
|||||||
<result property="bind_MixProject_Pst" column="bind_MixProject_Pst"/>
|
<result property="bind_MixProject_Pst" column="bind_MixProject_Pst"/>
|
||||||
<result property="voppat" column="voppat"/>
|
<result property="voppat" column="voppat"/>
|
||||||
<result property="voppa" column="voppa"/>
|
<result property="voppa" column="voppa"/>
|
||||||
|
<result property="area" column="area" javaType="DECIMAL"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectOfficeBasePriceUltimateVo">
|
<sql id="selectOfficeBasePriceUltimateVo">
|
||||||
@ -127,6 +128,7 @@
|
|||||||
,Bind_MixProject_Pst
|
,Bind_MixProject_Pst
|
||||||
,VOPPAT
|
,VOPPAT
|
||||||
,VOPPA
|
,VOPPA
|
||||||
|
,area
|
||||||
FROM dbo.DWA_PROJECTBASEPRICE_RENT_IMDT_${yearMonth}
|
FROM dbo.DWA_PROJECTBASEPRICE_RENT_IMDT_${yearMonth}
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
@ -143,7 +145,8 @@
|
|||||||
<select id="selectPageList"
|
<select id="selectPageList"
|
||||||
parameterType="com.ruoyi.project.data.price.domain.ComputeResidenceRentBasePrice"
|
parameterType="com.ruoyi.project.data.price.domain.ComputeResidenceRentBasePrice"
|
||||||
resultMap="MainMappingResult">
|
resultMap="MainMappingResult">
|
||||||
<![CDATA[ SELECT ID,ProjectID,ProjectName,ProjectAddr,County,Block,[Loop] as loopLine,IsIndxGen,IsPstCalc,StatusRun,PropertyType,ProjectType,ProjectTypeDtl,ProjectLevel,PropertyDevPeriod,BindClassID,MainCoff_Rent,RentPriceDft,MainRentPriceDft,RentPrice_1,PriceDealMean_1,PriceDealMax_1,SumDeal_1,PriceDeal_1_ToAI_Pst,PriceDealMean,PriceDealMax,SumDeal,PriceDeal_ToAI_Pst,PriceDeal_ToLst_Pst,PriceCaseOff,PriceCaseOff_ToLst_Pst,PriceListedMin,PriceLstMn_ToAI_Pst,PriceCase1_ToAI_Pst,PriceCase2_ToAI_Pst,PriceCase1_ToLst_Pst,PriceCase2_ToLst_Pst,PriceCase1,PriceCase1AdjPst,SumCase1,PriceCase2,PriceCase2AdjPst,SumCase2,VOPPBT,VOPPB,BindProjID,Bind_Proj_Pst,Bind_Block_Class,Bind_Block_Class_Pst,Bind_Block_Plevel,Bind_Block_Plevel_Pst,Bind_Block_PType,Bind_Block_Ptype_Pst,Bind_County_PType,Bind_County_Ptype_Pst,Bind_MixProject_PType,Bind_MixProject_Pst,VOPPAT,VOPPA ]]>
|
<![CDATA[
|
||||||
|
SELECT ID,ProjectID,ProjectName,ProjectAddr,County,Block,[Loop] as loopLine,IsIndxGen,IsPstCalc,StatusRun,PropertyType,ProjectType,ProjectTypeDtl,ProjectLevel,PropertyDevPeriod,BindClassID,MainCoff_Rent,RentPriceDft,MainRentPriceDft,RentPrice_1,PriceDealMean_1,PriceDealMax_1,SumDeal_1,PriceDeal_1_ToAI_Pst,PriceDealMean,PriceDealMax,SumDeal,PriceDeal_ToAI_Pst,PriceDeal_ToLst_Pst,PriceCaseOff,PriceCaseOff_ToLst_Pst,PriceListedMin,PriceLstMn_ToAI_Pst,PriceCase1_ToAI_Pst,PriceCase2_ToAI_Pst,PriceCase1_ToLst_Pst,PriceCase2_ToLst_Pst,PriceCase1,PriceCase1AdjPst,SumCase1,PriceCase2,PriceCase2AdjPst,SumCase2,VOPPBT,VOPPB,BindProjID,Bind_Proj_Pst,Bind_Block_Class,Bind_Block_Class_Pst,Bind_Block_Plevel,Bind_Block_Plevel_Pst,Bind_Block_PType,Bind_Block_Ptype_Pst,Bind_County_PType,Bind_County_Ptype_Pst,Bind_MixProject_PType,Bind_MixProject_Pst,VOPPAT,VOPPA,area ]]>
|
||||||
FROM dbo.DWA_PROJECTBASEPRICE_RENT_IMDT_${yearMonth}
|
FROM dbo.DWA_PROJECTBASEPRICE_RENT_IMDT_${yearMonth}
|
||||||
order by ProjectID ASC OFFSET #{pageIndex} rows fetch next #{pageSize} rows only
|
order by ProjectID ASC OFFSET #{pageIndex} rows fetch next #{pageSize} rows only
|
||||||
</select>
|
</select>
|
||||||
|
@ -42,10 +42,10 @@
|
|||||||
物业费, 工位数, 地址, 地铁,
|
物业费, 工位数, 地址, 地铁,
|
||||||
发布时间,房源编号, 百度lng, 百度lat, 区域, 分类, 来源, 等级, 楼盘网址, 装修,
|
发布时间,房源编号, 百度lng, 百度lat, 区域, 分类, 来源, 等级, 楼盘网址, 装修,
|
||||||
类型, 板块, 挂牌中介, 月租金租, 标准租金租, 更新时间, 得房率,
|
类型, 板块, 挂牌中介, 月租金租, 标准租金租, 更新时间, 得房率,
|
||||||
case when 分类 = '售' then (case 总价售 when 'nan' then NULL ELSE 总价售 END)
|
case when 分类 = '售' then (case when ISNUMERIC(总价售)=1 then 总价售 ELSE NULL END)
|
||||||
when 分类 = '租' then (case 月租金租 when 'nan' then NULL ELSE 月租金租 END) end as 总价,
|
when 分类 = '租' then (case when ISNUMERIC(月租金租)=1 then 月租金租 ELSE NULL END) end as 总价,
|
||||||
case when 分类 = '售' then (case 均价售 when 'nan' then NULL ELSE 均价售 END)
|
case when 分类 = '售' then (case when ISNUMERIC(均价售)=1 then 均价售 ELSE NULL END)
|
||||||
when 分类 = '租' then (case 标准租金租 when 'nan' then NULL ELSE 标准租金租 END) end as 单价
|
when 分类 = '租' then (case when ISNUMERIC(标准租金租)=1 then 标准租金租 ELSE NULL END) end as 单价
|
||||||
from dbo.办公
|
from dbo.办公
|
||||||
where 更新时间 >= #{startDate,jdbcType=DATE} and 更新时间 <![CDATA[ < ]]> #{endDate,jdbcType=DATE}
|
where 更新时间 >= #{startDate,jdbcType=DATE} and 更新时间 <![CDATA[ < ]]> #{endDate,jdbcType=DATE}
|
||||||
</select>
|
</select>
|
||||||
|
@ -4,18 +4,18 @@
|
|||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalResidenceRentClosingCaseMapper">
|
<mapper namespace="com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalResidenceRentClosingCaseMapper">
|
||||||
<select id="download" resultType="com.ruoyi.project.data.cases.domain.OriginalResidenceRentClosingCase">
|
<select id="download" resultType="com.ruoyi.project.data.cases.domain.OriginalResidenceRentClosingCase">
|
||||||
SELECT 合同编号 as caseContractNo
|
SELECT 案例ID as caseContractNo
|
||||||
,小区名称 as caseCommunityName
|
,NULL as caseCommunityName
|
||||||
,挂牌时间 as caseOpeningDate
|
,NULL as caseOpeningDate
|
||||||
,交易时间 as caseClosingDate
|
,成交时间 as caseClosingDate
|
||||||
,租金 as caseRentPrice
|
,"租金(元/月)" as caseRentPrice
|
||||||
,建筑面积 as caseArea
|
,面积 as caseArea
|
||||||
,住宅楼总楼层数 as caseTotalFloor
|
,总楼层 as caseTotalFloor
|
||||||
,朝向 as caseToward
|
,朝向 as caseToward
|
||||||
,户型 as caseApartmentLayout
|
,室厅 as caseApartmentLayout
|
||||||
,装修状况 as caseDecoration
|
,NULL as caseDecoration
|
||||||
,小区ID as caseCommunityId
|
,AIID as caseCommunityId
|
||||||
,楼栋ID as caseBuildingId
|
,楼栋ID as caseBuildingId
|
||||||
FROM dbo.ODS_HOUSINGCASEDEAL_RENT_${yearMonth}_RAW
|
FROM dbo.住宅租赁成交案例_链家_${yearMonth}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
@ -30,7 +30,7 @@
|
|||||||
<result property="caseProvider" column="caseProvider"/>
|
<result property="caseProvider" column="caseProvider"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<select id="download" resultMap="resultMapping">
|
<select id="download" resultMap="resultMapping">
|
||||||
SELECT top 1000 llid
|
SELECT llid
|
||||||
,lcid
|
,lcid
|
||||||
,airaid
|
,airaid
|
||||||
,name
|
,name
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<select id="download" resultMap="resultMapping">
|
<select id="download" resultMap="resultMapping">
|
||||||
select top 100 面积
|
select 面积
|
||||||
,block
|
,block
|
||||||
,地址
|
,地址
|
||||||
,小区名
|
,小区名
|
||||||
|
@ -0,0 +1,37 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.project.data.cases.mapper.sync.DownloadOtherResidenceRentClosingCaseMapper">
|
||||||
|
<resultMap id="DownloadMapping" type="com.ruoyi.project.data.cases.domain.OtherResidenceRentClosingCase">
|
||||||
|
<result property="caseDistrict" column="County"/>
|
||||||
|
<result property="caseCommunityName" column="ProjectName_SRC"/>
|
||||||
|
<result property="caseAddress" column="HouseholdsAddr_SRC" />
|
||||||
|
<result property="caseArea" column="Area" javaType="java.math.BigDecimal"/>
|
||||||
|
<result property="closingDate" column="PriceDateOut" javaType="java.sql.Date"/>
|
||||||
|
<result property="caseTotalPrice" column="PriceTotal" javaType="java.math.BigDecimal"/>
|
||||||
|
<result property="caseDecoration" column="Decoration" />
|
||||||
|
<result property="caseTotalFloor" column="UpperFloorSum" />
|
||||||
|
<result property="caseCurrentFloor" column="UpperFloorNum" />
|
||||||
|
<result property="caseToward" column="Towards" />
|
||||||
|
<result property="caseFloor" column="Storey" />
|
||||||
|
<result property="uvCommunityId" column="ProjectID" />
|
||||||
|
<result property="uvBuildingId" column="BuildingID" />
|
||||||
|
</resultMap>
|
||||||
|
<select id="download" resultMap="DownloadMapping">
|
||||||
|
SELECT County
|
||||||
|
,ProjectName_SRC
|
||||||
|
,HouseholdsAddr_SRC
|
||||||
|
,Area
|
||||||
|
,PriceDateOut
|
||||||
|
,PriceTotal
|
||||||
|
,Decoration
|
||||||
|
,UpperFloorSum
|
||||||
|
,UpperFloorNum
|
||||||
|
,Towards
|
||||||
|
,Storey
|
||||||
|
,ProjectID
|
||||||
|
,BuildingID
|
||||||
|
FROM dbo.TEMP_ODS_HOUSINGCASEDEAL_RENT_${yearMonth}_RAW
|
||||||
|
</select>
|
||||||
|
</mapper>
|
@ -25,6 +25,27 @@
|
|||||||
clean_building_id nvarchar (32) NULL
|
clean_building_id nvarchar (32) NULL
|
||||||
)
|
)
|
||||||
</update>
|
</update>
|
||||||
|
<update id="createOtherRawTable">
|
||||||
|
<bind name="targetTableName" value="'dbo.TEMP_ODS_HOUSINGCASEDEAL_RENT_' + yearMonth+'_RAW'"/>
|
||||||
|
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
||||||
|
drop table ${targetTableName};
|
||||||
|
CREATE TABLE ${targetTableName}(
|
||||||
|
case_id varchar(32) NOT NULL primary key,
|
||||||
|
case_district nvarchar(64) NULL,
|
||||||
|
case_community_name nvarchar(1024) NULL,
|
||||||
|
case_address nvarchar(1024) NULL,
|
||||||
|
case_area decimal(18, 2) NULL,
|
||||||
|
case_closing_date date NULL,
|
||||||
|
case_total_price decimal(18, 2) NOT NULL,
|
||||||
|
case_decoration nvarchar(64) NULL,
|
||||||
|
case_total_floor int null,
|
||||||
|
case_current_floor nvarchar(32) NULL,
|
||||||
|
case_toward nvarchar(64) NULL,
|
||||||
|
case_floor nvarchar(32) NULL,
|
||||||
|
uv_community_id nvarchar(20) null,
|
||||||
|
uv_building_id nvarchar(20) null
|
||||||
|
)
|
||||||
|
</update>
|
||||||
<update id="createCleanTable">
|
<update id="createCleanTable">
|
||||||
<bind name="targetTableName" value="'dbo.ODS_HOUSINGCASEDEAL_RENT_' + yearMonth"/>
|
<bind name="targetTableName" value="'dbo.ODS_HOUSINGCASEDEAL_RENT_' + yearMonth"/>
|
||||||
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
||||||
|
@ -0,0 +1,258 @@
|
|||||||
|
delete from ODS_HOUSINGCASEDEAL_RENT_#yearMonth# where Origin='太平洋';
|
||||||
|
|
||||||
|
create table #HousingCaseListAdj
|
||||||
|
(
|
||||||
|
case_id varchar(32) not null
|
||||||
|
, HouseholdsID_SRC nvarchar(64) primary key
|
||||||
|
, ProjectID_SRC nvarchar(64) not null
|
||||||
|
, ProjectID nvarchar(64)
|
||||||
|
, BuildingID nvarchar(64)
|
||||||
|
, RentType tinyint
|
||||||
|
, Area decimal(18, 2)
|
||||||
|
, Towards nvarchar(64)
|
||||||
|
, UpperFloorSum nvarchar(32)
|
||||||
|
, UpperFloorNum nvarchar(32)
|
||||||
|
, Decoration nvarchar(64)
|
||||||
|
, PriceTotal decimal(18, 2) not null
|
||||||
|
, PriceUnit decimal(18, 2) not null
|
||||||
|
, PriceDateOut date
|
||||||
|
, CaseName nvarchar(512)
|
||||||
|
);
|
||||||
|
|
||||||
|
declare @HouseholdsID_SRC nvarchar(64)
|
||||||
|
, @CaseName nvarchar(512)
|
||||||
|
, @ProjectID nvarchar(64)
|
||||||
|
, @BuildingID nvarchar(64)
|
||||||
|
, @roomtype nvarchar(50)
|
||||||
|
, @UpperFloorSum nvarchar(32)
|
||||||
|
, @UpperFloorNum nvarchar(32)
|
||||||
|
, @area decimal(28, 2)
|
||||||
|
, @towards nvarchar(50)
|
||||||
|
, @decora nvarchar(64)
|
||||||
|
, @price decimal(28, 2)
|
||||||
|
, @dueDate date
|
||||||
|
, @case_id varchar(32)
|
||||||
|
, @RentType tinyint
|
||||||
|
, @priceunit decimal(28, 2);
|
||||||
|
declare Record2Insert cursor for
|
||||||
|
SELECT case_id
|
||||||
|
,case_id
|
||||||
|
,case_community_name
|
||||||
|
,case_closing_date
|
||||||
|
,case_total_price
|
||||||
|
,case_area
|
||||||
|
,case_total_floor
|
||||||
|
,case_current_floor
|
||||||
|
,case_toward
|
||||||
|
,case_decoration
|
||||||
|
,uv_community_id
|
||||||
|
,uv_building_id
|
||||||
|
FROM dbo.TEMP_ODS_HOUSINGCASEDEAL_RENT_#yearMonth#_RAW;
|
||||||
|
open Record2Insert;
|
||||||
|
fetch next from Record2Insert
|
||||||
|
into @case_id
|
||||||
|
, @HouseholdsID_SRC
|
||||||
|
, @CaseName
|
||||||
|
, @dueDate
|
||||||
|
, @price
|
||||||
|
, @area
|
||||||
|
, @UpperFloorSum
|
||||||
|
, @UpperFloorNum
|
||||||
|
, @towards
|
||||||
|
, @decora
|
||||||
|
, @ProjectID
|
||||||
|
, @BuildingID;
|
||||||
|
set nocount on; --忽略行数显示
|
||||||
|
while @@fetch_status = 0
|
||||||
|
begin
|
||||||
|
begin
|
||||||
|
--租赁类型
|
||||||
|
set @RentType = case
|
||||||
|
when @area < 30 then
|
||||||
|
3
|
||||||
|
else
|
||||||
|
2
|
||||||
|
end; --散租
|
||||||
|
--面积
|
||||||
|
set @area = case
|
||||||
|
when @area <> 0 then
|
||||||
|
@area
|
||||||
|
end;
|
||||||
|
--单价
|
||||||
|
set @priceunit = @price * 1.0 / isnull(@area, 1.0);
|
||||||
|
--插入数据
|
||||||
|
insert into #HousingCaseListAdj(case_id,HouseholdsID_SRC,ProjectID_SRC,ProjectID,BuildingID,RentType,Area,Towards,
|
||||||
|
UpperFloorSum,UpperFloorNum,Decoration,PriceTotal,PriceUnit,PriceDateOut,CaseName)
|
||||||
|
values
|
||||||
|
(@case_id, @HouseholdsID_SRC, '-1', @ProjectID, @BuildingID, @RentType, @area
|
||||||
|
, @towards, @UpperFloorSum, @UpperFloorNum, @decora, @price, @priceunit, @dueDate, @CaseName);
|
||||||
|
end;
|
||||||
|
fetch next from Record2Insert
|
||||||
|
into @case_id
|
||||||
|
, @HouseholdsID_SRC
|
||||||
|
, @CaseName
|
||||||
|
, @dueDate
|
||||||
|
, @price
|
||||||
|
, @area
|
||||||
|
, @UpperFloorSum
|
||||||
|
, @UpperFloorNum
|
||||||
|
, @towards
|
||||||
|
, @decora
|
||||||
|
, @ProjectID
|
||||||
|
, @BuildingID;
|
||||||
|
end;
|
||||||
|
close Record2Insert;
|
||||||
|
deallocate Record2Insert;
|
||||||
|
set nocount off;
|
||||||
|
|
||||||
|
create table #HousingCaseListSTD
|
||||||
|
(
|
||||||
|
case_id varchar(32)
|
||||||
|
, HouseholdsID_SRC nvarchar(64)
|
||||||
|
, ProjectID_SRC nvarchar(64)
|
||||||
|
, ProjectID nvarchar(64)
|
||||||
|
, BuildingID nvarchar(64)
|
||||||
|
, 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.case_id
|
||||||
|
, A.HouseholdsID_SRC
|
||||||
|
, A.ProjectID_SRC
|
||||||
|
, A.ProjectID
|
||||||
|
, null
|
||||||
|
, D.CoefficientA * A.Area + D.CoefficientB as AreaCoff
|
||||||
|
, E.Coefficient as TowardsCoff
|
||||||
|
, F.Coefficient as FloorCoff
|
||||||
|
, G.Coefficient as DecorationRng
|
||||||
|
, null as YearCoff
|
||||||
|
, null as BuildingCoff
|
||||||
|
, NULL as RoomTypeCoff
|
||||||
|
, A.PriceUnit
|
||||||
|
, (A.PriceUnit - isnull(G.Coefficient, 0)) * 1.0 / isnull(D.CoefficientA * A.Area + D.CoefficientB, 1)
|
||||||
|
/ isnull(E.Coefficient, 1) / isnull(F.Coefficient, 1) PriceScatterRent
|
||||||
|
, (A.PriceUnit - isnull(G.Coefficient, 0)) * 1.0 / isnull(D.CoefficientA * A.Area + D.CoefficientB, 1)
|
||||||
|
/ isnull(E.Coefficient, 1) / isnull(F.Coefficient, 1) + isnull(G.Coefficient, 0) PriceEntireRent
|
||||||
|
, A.PriceTotal * 1.0 / isnull(F.Coefficient, 1) / isnull(E.Coefficient, 1) as PriceShareRent0
|
||||||
|
, null as PriceShareRent
|
||||||
|
from #HousingCaseListAdj A
|
||||||
|
left join
|
||||||
|
(select projectid,ProjectLevel from obpm_LianCheng_Data.dbo.V_RESIDENCE_COMMUNITY) C
|
||||||
|
on A.ProjectID = C.projectid
|
||||||
|
left join
|
||||||
|
(
|
||||||
|
select ProjectLevel
|
||||||
|
, UpperKey
|
||||||
|
, LowerKey
|
||||||
|
, CoefficientA
|
||||||
|
, CoefficientB
|
||||||
|
from obpm_LianCheng_Data.dbo.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 SingleKey
|
||||||
|
, Coefficient
|
||||||
|
from obpm_LianCheng_Data.dbo.DIM_PARAMETERS
|
||||||
|
where CoffType = '朝向(租金)'
|
||||||
|
and ProjectType = '公寓'
|
||||||
|
) E --朝向修正
|
||||||
|
on A.Towards = E.SingleKey
|
||||||
|
left join
|
||||||
|
(
|
||||||
|
select UpperKey
|
||||||
|
, LowerKey
|
||||||
|
, Elevator
|
||||||
|
, Coefficient
|
||||||
|
from obpm_LianCheng_Data.dbo.DIM_PARAMETERS
|
||||||
|
where CoffType = '楼层(租金)'
|
||||||
|
and ProjectType = '公寓'
|
||||||
|
) F --楼层修正
|
||||||
|
on F.Elevator is null
|
||||||
|
and A.UpperFloorSum = F.UpperKey
|
||||||
|
and A.UpperFloorNum = F.LowerKey
|
||||||
|
left join
|
||||||
|
(
|
||||||
|
select SingleKey
|
||||||
|
, Coefficient
|
||||||
|
from obpm_LianCheng_Data.dbo.DIM_PARAMETERS
|
||||||
|
where CoffType = '室内装修(租金)'
|
||||||
|
and ProjectType = '公寓'
|
||||||
|
) G --装修修正
|
||||||
|
on A.Decoration = G.SingleKey;
|
||||||
|
|
||||||
|
|
||||||
|
insert into ODS_HOUSINGCASEDEAL_RENT_#yearMonth#
|
||||||
|
select a.case_id
|
||||||
|
, A.HouseholdsID_SRC
|
||||||
|
, A.ProjectID_SRC
|
||||||
|
, A.ProjectID
|
||||||
|
, A.BuildingID
|
||||||
|
, A.RentType
|
||||||
|
, NULL
|
||||||
|
, NULL
|
||||||
|
, NULL
|
||||||
|
, A.Area
|
||||||
|
, A.Towards
|
||||||
|
, A.UpperFloorSum
|
||||||
|
, A.UpperFloorNum
|
||||||
|
, null Elevator
|
||||||
|
, A.Decoration
|
||||||
|
, null as 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
|
||||||
|
, null
|
||||||
|
, null
|
||||||
|
, null
|
||||||
|
, null
|
||||||
|
, 4 as Status
|
||||||
|
, null
|
||||||
|
, null
|
||||||
|
, null
|
||||||
|
, null
|
||||||
|
, null
|
||||||
|
, null
|
||||||
|
, null
|
||||||
|
, A.PriceTotal PriceTotalIn
|
||||||
|
, A.PriceTotal PriceTotalOut
|
||||||
|
, NULL
|
||||||
|
, A.PriceDateOut
|
||||||
|
, '太平洋'
|
||||||
|
, null
|
||||||
|
, null
|
||||||
|
, CaseName
|
||||||
|
from #HousingCaseListAdj A
|
||||||
|
left join #HousingCaseListSTD B
|
||||||
|
on A.HouseholdsID_SRC = B.HouseholdsID_SRC;
|
||||||
|
|
||||||
|
drop table #HousingCaseListAdj
|
||||||
|
, #HousingCaseListSTD;
|
@ -82,7 +82,7 @@ public class GenerateTableTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void generateBatchInsertSqL() {
|
public void generateBatchInsertSqL() {
|
||||||
Class targetClass = OriginalResidenceRentClosingCase.class;
|
Class targetClass = OtherResidenceRentClosingCase .class;
|
||||||
|
|
||||||
List<Field> fieldList = new ArrayList<>();
|
List<Field> fieldList = new ArrayList<>();
|
||||||
while (targetClass != null) {
|
while (targetClass != null) {
|
||||||
@ -224,5 +224,9 @@ public class GenerateTableTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@Test
|
||||||
|
public void printUUID(){
|
||||||
|
System.out.println(UUID.randomUUID().toString().replace("-",""));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import org.springframework.test.context.junit4.SpringRunner;
|
|||||||
|
|
||||||
@RunWith(SpringRunner.class)
|
@RunWith(SpringRunner.class)
|
||||||
@SpringBootTest(classes = RuoYiApplication.class)
|
@SpringBootTest(classes = RuoYiApplication.class)
|
||||||
@ActiveProfiles("uat")
|
@ActiveProfiles("dev")
|
||||||
public class ResidenceRentBasePriceTests {
|
public class ResidenceRentBasePriceTests {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
Reference in New Issue
Block a user