feature(住宅租赁作价):实现excel导入修改基价
This commit is contained in:
@ -0,0 +1,8 @@
|
|||||||
|
package com.ruoyi.project.data.cases.service;
|
||||||
|
|
||||||
|
public interface IOriginalOfficeCaseService {
|
||||||
|
/**
|
||||||
|
* 计算
|
||||||
|
*/
|
||||||
|
void compute();
|
||||||
|
}
|
@ -0,0 +1,81 @@
|
|||||||
|
package com.ruoyi.project.data.cases.service.impl;
|
||||||
|
|
||||||
|
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.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.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class OriginalOfficeCaseServiceImpl implements IOriginalOfficeCaseService {
|
||||||
|
@Autowired
|
||||||
|
private JdbcTemplate jdbcTemplate;
|
||||||
|
@Autowired
|
||||||
|
private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
|
||||||
|
@Autowired
|
||||||
|
private DownloadOriginalOfficeCaseMapper downloadOriginalOfficeCaseMapper;
|
||||||
|
@Autowired
|
||||||
|
private OriginalOfficeCaseMapper originalOfficeCaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
// @Scheduled(cron = "")
|
||||||
|
public void compute() {
|
||||||
|
Date date = new Date();
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), 15);
|
||||||
|
Date startDate = calendar.getTime();
|
||||||
|
Integer lastYearMonth = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
|
||||||
|
calendar.get(Calendar.MONTH) + 1));
|
||||||
|
calendar.add(Calendar.MONTH, 1);
|
||||||
|
Date endDate = calendar.getTime();
|
||||||
|
Integer yearMonth = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
|
||||||
|
calendar.get(Calendar.MONTH) + 1));
|
||||||
|
|
||||||
|
before(yearMonth, startDate, endDate);
|
||||||
|
running(yearMonth, lastYearMonth);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建表
|
||||||
|
*
|
||||||
|
* @param yearMonth
|
||||||
|
*/
|
||||||
|
private void before(Integer yearMonth, Date startDate, Date endDate) {
|
||||||
|
// 创建表
|
||||||
|
originalOfficeCaseMapper.createTable(yearMonth);
|
||||||
|
originalOfficeCaseMapper.createArtificialTable(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," +
|
||||||
|
":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);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void running(Integer yearMonth, Integer lastYearMonth) {
|
||||||
|
|
||||||
|
String rawSql = LoadUtil.loadContent("sql-template/compute_office_price.sql");
|
||||||
|
String sql = rawSql.replace("#yearMonth#", yearMonth.toString())
|
||||||
|
.replace("#lastYearMonth#", lastYearMonth.toString());
|
||||||
|
|
||||||
|
jdbcTemplate.execute(sql);
|
||||||
|
}
|
||||||
|
}
|
@ -94,7 +94,7 @@ public class ResidenceRentBasePriceController extends BaseController {
|
|||||||
List<ComputeResidenceRentBasePrice> list =
|
List<ComputeResidenceRentBasePrice> list =
|
||||||
computeResidenceRentPriceService.selectPageList(computeResidenceRentBasePrice);
|
computeResidenceRentPriceService.selectPageList(computeResidenceRentBasePrice);
|
||||||
ExcelUtil<ComputeResidenceRentBasePrice> util = new ExcelUtil<>(ComputeResidenceRentBasePrice.class);
|
ExcelUtil<ComputeResidenceRentBasePrice> util = new ExcelUtil<>(ComputeResidenceRentBasePrice.class);
|
||||||
return util.exportExcel(list, "住宅租赁基价");
|
return util.exportExcel(list, "住宅租赁基价初始化-" + computeResidenceRentBasePrice.getYearMonth());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,12 +54,6 @@ public interface IUltimateOfficeBasePriceService {
|
|||||||
*/
|
*/
|
||||||
List<VueSelectModel> getYearMonthList();
|
List<VueSelectModel> getYearMonthList();
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 计算
|
|
||||||
*/
|
|
||||||
void compute();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import com.baomidou.dynamic.datasource.annotation.DS;
|
|||||||
import com.microsoft.sqlserver.jdbc.SQLServerCallableStatement;
|
import com.microsoft.sqlserver.jdbc.SQLServerCallableStatement;
|
||||||
import com.microsoft.sqlserver.jdbc.SQLServerDataTable;
|
import com.microsoft.sqlserver.jdbc.SQLServerDataTable;
|
||||||
import com.microsoft.sqlserver.jdbc.SQLServerException;
|
import com.microsoft.sqlserver.jdbc.SQLServerException;
|
||||||
|
import com.ruoyi.common.utils.LoadUtil;
|
||||||
import com.ruoyi.project.common.VueSelectModel;
|
import com.ruoyi.project.common.VueSelectModel;
|
||||||
import com.ruoyi.project.data.price.domain.ArtificialResidenceRentBasePrice;
|
import com.ruoyi.project.data.price.domain.ArtificialResidenceRentBasePrice;
|
||||||
import com.ruoyi.project.data.price.domain.ArtificialResidenceSaleBasePrice;
|
import com.ruoyi.project.data.price.domain.ArtificialResidenceSaleBasePrice;
|
||||||
@ -14,10 +15,12 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.sql.*;
|
import java.sql.*;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -39,6 +42,9 @@ public class ArtificialResidenceRentPriceServiceImpl implements IArtificialResid
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ArtificialResidenceRentPriceMapper artificialResidenceRentPriceMapper;
|
private ArtificialResidenceRentPriceMapper artificialResidenceRentPriceMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private JdbcTemplate jdbcTemplate;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ArtificialResidenceRentBasePrice selectById(Integer yearMonth, String id) {
|
public ArtificialResidenceRentBasePrice selectById(Integer yearMonth, String id) {
|
||||||
ArtificialResidenceRentBasePrice residenceRentBasePrice =
|
ArtificialResidenceRentBasePrice residenceRentBasePrice =
|
||||||
@ -94,6 +100,10 @@ public class ArtificialResidenceRentPriceServiceImpl implements IArtificialResid
|
|||||||
Date valuePoint = calendar.getTime();
|
Date valuePoint = calendar.getTime();
|
||||||
calendar.add(Calendar.MONTH, -1);
|
calendar.add(Calendar.MONTH, -1);
|
||||||
Date lastValuePoint = calendar.getTime();
|
Date lastValuePoint = calendar.getTime();
|
||||||
|
String lastYearMonth = String.format("%d%02d", calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH) + 1);
|
||||||
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
String priceDate = simpleDateFormat.format(valuePoint);
|
||||||
|
String lastPriceDate = simpleDateFormat.format(lastValuePoint);
|
||||||
|
|
||||||
artificialResidenceRentPriceMapper.prepareBachImport(yearMonth);
|
artificialResidenceRentPriceMapper.prepareBachImport(yearMonth);
|
||||||
CopyOnWriteArrayList<ArtificialResidenceRentBasePrice> copyOnWriteArrayList = new CopyOnWriteArrayList<>();
|
CopyOnWriteArrayList<ArtificialResidenceRentBasePrice> copyOnWriteArrayList = new CopyOnWriteArrayList<>();
|
||||||
@ -162,6 +172,14 @@ public class ArtificialResidenceRentPriceServiceImpl implements IArtificialResid
|
|||||||
// 删除存储过程,还原环境
|
// 删除存储过程,还原环境
|
||||||
statement.execute("drop procedure BatchImportOfArtificialResidenceRent");
|
statement.execute("drop procedure BatchImportOfArtificialResidenceRent");
|
||||||
conn.close();
|
conn.close();
|
||||||
|
// 人工修正导入
|
||||||
|
// yearMonth, lastYearMonth, lastPriceDate, priceDate
|
||||||
|
String rawSql = LoadUtil.loadContent("sql-template/update_rent_price.sql");
|
||||||
|
String sql = rawSql.replace("#yearMonth#", yearMonth.toString())
|
||||||
|
.replace("#lastYearMonth#", lastYearMonth)
|
||||||
|
.replace("#priceDate#", priceDate)
|
||||||
|
.replace("#lastPriceDate#", lastPriceDate);
|
||||||
|
jdbcTemplate.update(sql);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,6 @@ import com.ruoyi.common.utils.StringUtils;
|
|||||||
import com.ruoyi.framework.config.UVConfig;
|
import com.ruoyi.framework.config.UVConfig;
|
||||||
import com.ruoyi.project.common.UVResponse;
|
import com.ruoyi.project.common.UVResponse;
|
||||||
import com.ruoyi.project.common.VueSelectModel;
|
import com.ruoyi.project.common.VueSelectModel;
|
||||||
import com.ruoyi.project.data.cases.domain.OriginalOfficeCase;
|
|
||||||
import com.ruoyi.project.data.cases.mapper.OriginalOfficeCaseMapper;
|
import com.ruoyi.project.data.cases.mapper.OriginalOfficeCaseMapper;
|
||||||
import com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalOfficeCaseMapper;
|
import com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalOfficeCaseMapper;
|
||||||
import com.ruoyi.project.data.price.domain.OfficeBasePriceModifyModel;
|
import com.ruoyi.project.data.price.domain.OfficeBasePriceModifyModel;
|
||||||
@ -40,21 +39,12 @@ import org.springframework.web.client.RestTemplate;
|
|||||||
@DS("compute")
|
@DS("compute")
|
||||||
public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePriceService {
|
public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePriceService {
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
|
private static final Logger log = LoggerFactory.getLogger(UltimateOfficeBasePriceServiceImpl.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UltimateOfficeBasePriceMapper officeBasePriceUltimateMapper;
|
private UltimateOfficeBasePriceMapper officeBasePriceUltimateMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private UVConfig uvConfig;
|
|
||||||
@Autowired
|
|
||||||
private JdbcTemplate jdbcTemplate;
|
private JdbcTemplate jdbcTemplate;
|
||||||
@Autowired
|
|
||||||
private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
|
|
||||||
@Autowired
|
|
||||||
private DownloadOriginalOfficeCaseMapper downloadOriginalOfficeCaseMapper;
|
|
||||||
@Autowired
|
|
||||||
private OriginalOfficeCaseMapper originalOfficeCaseMapper;
|
|
||||||
|
|
||||||
|
|
||||||
private static Integer getLastYearMonth(Integer yearMonth) {
|
private static Integer getLastYearMonth(Integer yearMonth) {
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
@ -250,61 +240,4 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
|
|||||||
|
|
||||||
return officeBasePriceModifyModel;
|
return officeBasePriceModifyModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 计算
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
// @Scheduled(cron = "")
|
|
||||||
public void compute() {
|
|
||||||
|
|
||||||
Date date = new Date();
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
|
||||||
calendar.setTime(date);
|
|
||||||
calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), 15);
|
|
||||||
Date startDate = calendar.getTime();
|
|
||||||
Integer lastYearMonth = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
|
|
||||||
calendar.get(Calendar.MONTH) + 1));
|
|
||||||
calendar.add(Calendar.MONTH, 1);
|
|
||||||
Date endDate = calendar.getTime();
|
|
||||||
Integer yearMonth = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
|
|
||||||
calendar.get(Calendar.MONTH) + 1));
|
|
||||||
|
|
||||||
before(yearMonth, startDate, endDate);
|
|
||||||
running(yearMonth, lastYearMonth);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建表
|
|
||||||
*
|
|
||||||
* @param yearMonth
|
|
||||||
*/
|
|
||||||
private void before(Integer yearMonth, Date startDate, Date endDate) {
|
|
||||||
// 创建表
|
|
||||||
originalOfficeCaseMapper.createTable(yearMonth);
|
|
||||||
originalOfficeCaseMapper.createArtificialTable(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," +
|
|
||||||
":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);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void running(Integer yearMonth, Integer lastYearMonth) {
|
|
||||||
|
|
||||||
String rawSql = LoadUtil.loadContent("sql-template/compute_office_price.sql");
|
|
||||||
String sql = rawSql.replace("#yearMonth#", yearMonth.toString())
|
|
||||||
.replace("#lastYearMonth#", lastYearMonth.toString());
|
|
||||||
|
|
||||||
jdbcTemplate.execute(sql);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void after() {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
<result property="projectLevel" column="projectLevel"/>
|
<result property="projectLevel" column="projectLevel"/>
|
||||||
<result property="propertyDevPeriod" column="propertyDevPeriod"/>
|
<result property="propertyDevPeriod" column="propertyDevPeriod"/>
|
||||||
<result property="bindClassID" column="bindClassID"/>
|
<result property="bindClassID" column="bindClassID"/>
|
||||||
<result property="mainCoefficientRent" column="mainCoffRent"/>
|
<result property="mainCoefficientRent" column="mainCoff_Rent"/>
|
||||||
<result property="rentPriceDft" column="rentPriceDft"/>
|
<result property="rentPriceDft" column="rentPriceDft"/>
|
||||||
<result property="mainRentPriceDft" column="mainRentPriceDft"/>
|
<result property="mainRentPriceDft" column="mainRentPriceDft"/>
|
||||||
<result property="rentPrice_1" column="rentPrice_1"/>
|
<result property="rentPrice_1" column="rentPrice_1"/>
|
||||||
|
@ -49,44 +49,28 @@
|
|||||||
<update id="createArtificialTable">
|
<update id="createArtificialTable">
|
||||||
<bind name="targetTableName" value="'dbo.DWA_PROJECTBASEPRICE_OFFICE_MANU_' + yearMonth"/>
|
<bind name="targetTableName" value="'dbo.DWA_PROJECTBASEPRICE_OFFICE_MANU_' + yearMonth"/>
|
||||||
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
||||||
drop table ${targetTableName};
|
drop table ${targetTableName};
|
||||||
|
|
||||||
CREATE TABLE ${targetTableName}
|
CREATE TABLE ${targetTableName}
|
||||||
(
|
(
|
||||||
id uniqueidentifier not null,
|
BuildingID bigint NOT NULL,
|
||||||
BuildingID bigint NOT NULL,
|
ProjectID bigint NULL,
|
||||||
UnifiedID bigint NULL,
|
County nvarchar (512) NULL,
|
||||||
ProjectID bigint NOT NULL,
|
Loop nvarchar (512) NULL,
|
||||||
BuildingID_P nvarchar (20) NOT NULL,
|
Block nvarchar (512) NULL,
|
||||||
ProjectID_P bigint NULL,
|
ProjectAddr nvarchar (1024) NULL,
|
||||||
MainPrice decimal (38, 6) NULL,
|
ProjectName nvarchar (1024) NULL,
|
||||||
MainPriceRent decimal (38, 6) NULL,
|
Year int NULL,
|
||||||
MainPricePst decimal (38, 6) NULL,
|
AvgArea decimal (18, 2) NULL,
|
||||||
MainPriceRentPst decimal (38, 6) NULL,
|
TotalFloorSum nvarchar (32) NULL,
|
||||||
MainPriceType varchar (2) NULL,
|
UpperFloorSum nvarchar (32) NULL,
|
||||||
MainPriceRentType varchar (2) NULL,
|
OfficeClass nvarchar (256) NULL,
|
||||||
ModifyDate date NULL,
|
Grade nvarchar (64) NULL,
|
||||||
Status nvarchar (30) NULL,
|
MainPrice_1 decimal (18, 2) NULL,
|
||||||
BuildingStd tinyint NULL,
|
MainPriceRent_1 decimal (18, 2) NULL,
|
||||||
AdjEvd nvarchar (1000) NULL,
|
MainPrice decimal (18, 2) NULL,
|
||||||
MainPrice_1 decimal (38, 6) NULL,
|
MainPriceRent decimal (18, 2) NULL,
|
||||||
MainPriceRent_1 decimal (38, 6) NULL,
|
ModifyDate date NULL
|
||||||
AreaCoff decimal (7, 4) NULL,
|
|
||||||
YearCoff decimal (7, 4) NULL,
|
|
||||||
BuildingCoff decimal (7, 4) NULL,
|
|
||||||
ProjectName nvarchar (1024) NULL,
|
|
||||||
ProjectAddr nvarchar (1024) NULL,
|
|
||||||
BuildingAddr nvarchar (1024) NULL,
|
|
||||||
County nvarchar (512) NULL,
|
|
||||||
Loop nvarchar (512) NULL,
|
|
||||||
Block nvarchar (512) NULL,
|
|
||||||
Street nvarchar (512) NULL,
|
|
||||||
Year int NULL,
|
|
||||||
AvgArea decimal (18, 2) NULL,
|
|
||||||
TotalFloorSum nvarchar (32) NULL,
|
|
||||||
UpperFloorSum nvarchar (32) NULL,
|
|
||||||
OfficeClass nvarchar (256) NULL,
|
|
||||||
Grade nvarchar (64) NULL
|
|
||||||
);
|
);
|
||||||
</update>
|
</update>
|
||||||
</mapper>
|
</mapper>
|
@ -5,312 +5,297 @@
|
|||||||
<mapper namespace="com.ruoyi.project.data.cases.mapper.OriginalResidenceRentOpeningCaseMapper">
|
<mapper namespace="com.ruoyi.project.data.cases.mapper.OriginalResidenceRentOpeningCaseMapper">
|
||||||
|
|
||||||
<update id="createTable">
|
<update id="createTable">
|
||||||
<bind name="targetTableName" value="'dbo.original_residence_rent_opening_case_' + yearMonth" />
|
<bind name="targetTableName" value="'dbo.original_residence_rent_opening_case_' + yearMonth"/>
|
||||||
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
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_id varchar (32) NOT NULL,
|
||||||
case_no nvarchar (32) NULL,
|
case_no nvarchar (32) NULL,
|
||||||
case_lianjia_id nvarchar (50) NOT null primary key,
|
case_lianjia_id nvarchar (50) NOT null primary key,
|
||||||
case_lianjia_community_id nvarchar (50) NOT NULL,
|
case_lianjia_community_id nvarchar (50) NOT NULL,
|
||||||
case_title nvarchar (500) NOT NULL,
|
case_title nvarchar (500) NOT NULL,
|
||||||
clean_property_type nvarchar (20) NULL,
|
clean_property_type nvarchar (20) NULL,
|
||||||
case_apartment_layout nvarchar (500) NOT NULL,
|
case_apartment_layout nvarchar (500) NOT NULL,
|
||||||
case_house_structure nvarchar (50) NULL,
|
case_house_structure nvarchar (50) NULL,
|
||||||
case_area decimal (10, 2) NOT NULL,
|
case_area decimal (10, 2) NOT NULL,
|
||||||
case_total_area decimal (10, 2) NOT NULL,
|
case_total_area decimal (10, 2) NOT NULL,
|
||||||
case_rent_type nvarchar (20) NULL,
|
case_rent_type nvarchar (20) NULL,
|
||||||
case_status nvarchar (20) NULL,
|
case_status nvarchar (20) NULL,
|
||||||
case_block nvarchar (20) NULL,
|
case_block nvarchar (20) NULL,
|
||||||
case_county nvarchar (20) NULL,
|
case_county nvarchar (20) NULL,
|
||||||
case_loop nvarchar (20) NULL,
|
case_loop nvarchar (20) NULL,
|
||||||
case_hall_num int NULL,
|
case_hall_num int NULL,
|
||||||
case_room_num int NULL,
|
case_room_num int NULL,
|
||||||
case_underground_area decimal (10, 2) NULL,
|
case_underground_area decimal (10, 2) NULL,
|
||||||
case_toward nvarchar (50) NOT NULL,
|
case_toward nvarchar (50) NOT NULL,
|
||||||
clean_toward nvarchar (50) NULL,
|
clean_toward nvarchar (50) NULL,
|
||||||
case_storey nvarchar (20) NOT NULL,
|
case_storey nvarchar (20) NOT NULL,
|
||||||
clean_total_floor int NOT NULL,
|
clean_total_floor int NOT NULL,
|
||||||
clean_current_floor_desc nvarchar (20) NULL,
|
clean_current_floor_desc nvarchar (20) NULL,
|
||||||
case_elevator nvarchar (20) NULL,
|
case_elevator nvarchar (20) NULL,
|
||||||
clean_elevator nvarchar (20) NULL,
|
clean_elevator nvarchar (20) NULL,
|
||||||
case_tihu nvarchar (20) NULL,
|
case_tihu nvarchar (20) NULL,
|
||||||
case_decoration nvarchar (20) NULL,
|
case_decoration nvarchar (20) NULL,
|
||||||
clean_decoration nvarchar (50) NULL,
|
clean_decoration nvarchar (50) NULL,
|
||||||
case_year int NOT NULL,
|
case_year int NOT NULL,
|
||||||
clean_year int NOT NULL,
|
clean_year int NOT NULL,
|
||||||
case_address nvarchar (500) NULL,
|
case_address nvarchar (500) NULL,
|
||||||
case_vid nvarchar (500) NULL,
|
case_vid nvarchar (500) NULL,
|
||||||
case_chan_quan_xing_zhi nvarchar (200) NULL,
|
case_chan_quan_xing_zhi nvarchar (200) NULL,
|
||||||
case_price decimal (18, 2) NOT NULL,
|
case_price decimal (18, 2) NOT NULL,
|
||||||
clean_unit_price decimal (18, 2) NOT NULL,
|
clean_unit_price decimal (18, 2) NOT NULL,
|
||||||
clean_total_price decimal (18, 2) NOT NULL,
|
clean_total_price decimal (18, 2) NOT NULL,
|
||||||
case_community_name nvarchar (500) NULL,
|
case_community_name nvarchar (500) NULL,
|
||||||
case_visited_num int NOT NULL,
|
case_visited_num int NOT NULL,
|
||||||
case_visited_num_15 int NOT NULL,
|
case_visited_num_15 int NOT NULL,
|
||||||
case_visited_num_30 int NOT NULL,
|
case_visited_num_30 int NOT NULL,
|
||||||
case_latest_deal_date date NULL,
|
case_latest_deal_date date NULL,
|
||||||
case_latest_visited_date date NULL,
|
case_latest_visited_date date NULL,
|
||||||
case_first_visited_date date NULL,
|
case_first_visited_date date NULL,
|
||||||
case_url nvarchar (500) NOT NULL,
|
case_url nvarchar (500) NOT NULL,
|
||||||
case_community_url nvarchar (500) NOT NULL,
|
case_community_url nvarchar (500) NOT NULL,
|
||||||
case_get_date date NOT NULL,
|
case_get_date date NOT NULL,
|
||||||
case_provider nvarchar (50) NOT NULL,
|
case_provider nvarchar (50) NOT NULL,
|
||||||
uv_community_name nvarchar (500) NULL,
|
uv_community_name nvarchar (500) NULL,
|
||||||
uv_community_address nvarchar (1024) NULL,
|
uv_community_address nvarchar (1024) NULL,
|
||||||
uv_community_id nvarchar (20) NULL,
|
uv_community_id nvarchar (20) NULL,
|
||||||
uv_building_id nvarchar (20) NULL,
|
uv_building_id nvarchar (20) NULL,
|
||||||
uv_county nvarchar (50) NULL,
|
uv_county nvarchar (50) NULL,
|
||||||
uv_block nvarchar (50) NULL,
|
uv_block nvarchar (50) NULL,
|
||||||
uv_loop nvarchar (50) NULL,
|
uv_loop nvarchar (50) NULL,
|
||||||
area_coefficient decimal (18, 6) NULL,
|
area_coefficient decimal (18, 6) NULL,
|
||||||
toward_coefficient decimal (18, 6) NULL,
|
toward_coefficient decimal (18, 6) NULL,
|
||||||
floor_coefficient decimal (18, 6) NULL,
|
floor_coefficient decimal (18, 6) NULL,
|
||||||
decoration_coefficient int NULL,
|
decoration_coefficient int NULL,
|
||||||
year_coefficient decimal (18, 6) NULL,
|
year_coefficient decimal (18, 6) NULL,
|
||||||
building_coefficient decimal (18, 6) NULL,
|
building_coefficient decimal (18, 6) NULL,
|
||||||
adjust_unit_price decimal (18, 2) NULL,
|
adjust_unit_price decimal (18, 2) NULL,
|
||||||
clean_project_level nvarchar (50) NULL,
|
clean_project_level nvarchar (50) NULL,
|
||||||
create_time datetime NOT NULL
|
create_time datetime NOT NULL
|
||||||
);
|
);
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="createCleanTable">
|
<update id="createCleanTable">
|
||||||
<bind name="targetTableName" value="'dbo.ODS_HOUSINGCASELISTED_LJ_' + yearMonth" />
|
<bind name="targetTableName" value="'dbo.ODS_HOUSINGCASELISTED_LJ_' + yearMonth"/>
|
||||||
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
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_id varchar(32) not null,
|
||||||
HouseholdsID_LJ bigint not null primary key,
|
HouseholdsID_LJ bigint not null primary key,
|
||||||
ProjectID_LJ bigint null,
|
ProjectID_LJ bigint null,
|
||||||
ProjectID bigint null,
|
ProjectID bigint null,
|
||||||
Roomtype nvarchar(64) null,
|
Roomtype nvarchar(64) null,
|
||||||
Area decimal(18, 2) null,
|
Area decimal(18, 2) null,
|
||||||
Towards nvarchar(64) null,
|
Towards nvarchar(64) null,
|
||||||
UpperFloorSum nvarchar(32) null,
|
UpperFloorSum nvarchar(32) null,
|
||||||
UpperFloorNum nvarchar(32) null,
|
UpperFloorNum nvarchar(32) null,
|
||||||
Elevator tinyint null,
|
Elevator tinyint null,
|
||||||
Decoration nvarchar(64) null,
|
Decoration nvarchar(64) null,
|
||||||
Year int null,
|
Year int null,
|
||||||
AreaCoff decimal(7, 4) null,
|
AreaCoff decimal(7, 4) null,
|
||||||
TowardsCoff decimal(7, 4) null,
|
TowardsCoff decimal(7, 4) null,
|
||||||
FloorCoff decimal(7, 4) null,
|
FloorCoff decimal(7, 4) null,
|
||||||
DecorationRng int null,
|
DecorationRng int null,
|
||||||
YearCoff decimal(7, 4) null,
|
YearCoff decimal(7, 4) null,
|
||||||
BuildingCoff decimal(7, 4) null,
|
BuildingCoff decimal(7, 4) null,
|
||||||
PriceTotal decimal(18, 2) null,
|
PriceTotal decimal(18, 2) null,
|
||||||
PriceUnit decimal(18, 2) not null,
|
PriceUnit decimal(18, 2) not null,
|
||||||
PriceUnitAdj decimal(18, 2) not null,
|
PriceUnitAdj decimal(18, 2) not null,
|
||||||
Visited_Num int null,
|
Visited_Num int null,
|
||||||
First_Visit_Time date null,
|
First_Visit_Time date null,
|
||||||
Visited_Num_15 int null,
|
Visited_Num_15 int null,
|
||||||
Visited_Num_30 int null,
|
Visited_Num_30 int null,
|
||||||
Status tinyint null,
|
Status tinyint null,
|
||||||
AdjustedValue decimal(18, 2) null,
|
AdjustedValue decimal(18, 2) null,
|
||||||
AdjustedPst decimal(18, 6) null,
|
AdjustedPst decimal(18, 6) null,
|
||||||
AdjustedCumValue decimal(18, 2) null,
|
AdjustedCumValue decimal(18, 2) null,
|
||||||
AdjustedCumPst decimal(18, 6) null,
|
AdjustedCumPst decimal(18, 6) null,
|
||||||
AdjustedCumValueAbs decimal(18, 2) null,
|
AdjustedCumValueAbs decimal(18, 2) null,
|
||||||
AdjustedCumPstAbs decimal(18, 6) null,
|
AdjustedCumPstAbs decimal(18, 6) null,
|
||||||
AdjustedCumNum int null,
|
AdjustedCumNum int null,
|
||||||
PriceTotalIn decimal(18, 2) null,
|
PriceTotalIn decimal(18, 2) null,
|
||||||
PriceTotalOut decimal(18, 2) null,
|
PriceTotalOut decimal(18, 2) null,
|
||||||
PriceDateIn date null,
|
PriceDateIn date null,
|
||||||
PriceDateOut date null
|
PriceDateOut date null
|
||||||
);
|
);
|
||||||
</update>
|
</update>
|
||||||
<update id="createAssembleTable">
|
<update id="createAssembleTable">
|
||||||
<bind name="targetTableName" value="'dbo.DW_HOUSINGCASE_COMM_' + yearMonth" />
|
<bind name="targetTableName" value="'dbo.DW_HOUSINGCASE_COMM_' + yearMonth"/>
|
||||||
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
||||||
drop table ${targetTableName};
|
drop table ${targetTableName};
|
||||||
|
|
||||||
create table ${targetTableName}
|
create table ${targetTableName}
|
||||||
(
|
(
|
||||||
SID int primary key identity
|
SID int primary key identity
|
||||||
, case_id varchar(32) not null
|
, case_id varchar(32) not null
|
||||||
, HouseholdsID_LJ bigint
|
, HouseholdsID_LJ bigint
|
||||||
, ProjectID_LJ bigint
|
, ProjectID_LJ bigint
|
||||||
, ProjectID bigint --modified
|
, ProjectID bigint --modified
|
||||||
, ProjectName nvarchar(1024)
|
, ProjectName nvarchar(1024)
|
||||||
, ProjectAddr nvarchar(1024)
|
, ProjectAddr nvarchar(1024)
|
||||||
, County nvarchar(512)
|
, County nvarchar(512)
|
||||||
, Block nvarchar(512)
|
, Block nvarchar(512)
|
||||||
, Loop nvarchar(512)
|
, Loop nvarchar(512)
|
||||||
, Roomtype nvarchar(64)
|
, Roomtype nvarchar(64)
|
||||||
, Area decimal(18, 2)
|
, Area decimal(18, 2)
|
||||||
, Towards nvarchar(64)
|
, Towards nvarchar(64)
|
||||||
, UpperFloorSum nvarchar(32)
|
, UpperFloorSum nvarchar(32)
|
||||||
, UpperFloorNum nvarchar(32)
|
, UpperFloorNum nvarchar(32)
|
||||||
, Elevator tinyint
|
, Elevator tinyint
|
||||||
, Decoration nvarchar(64)
|
, Decoration nvarchar(64)
|
||||||
, Year int
|
, Year int
|
||||||
, AreaCoff decimal(7, 4)
|
, AreaCoff decimal(7, 4)
|
||||||
, TowardsCoff decimal(7, 4)
|
, TowardsCoff decimal(7, 4)
|
||||||
, FloorCoff decimal(7, 4)
|
, FloorCoff decimal(7, 4)
|
||||||
, DecorationRng int
|
, DecorationRng int
|
||||||
, YearCoff decimal(7, 4)
|
, YearCoff decimal(7, 4)
|
||||||
, BuildingCoff decimal(7, 4)
|
, BuildingCoff decimal(7, 4)
|
||||||
, BasePrice_1 decimal(18, 2)
|
, BasePrice_1 decimal(18, 2)
|
||||||
, PriceTotal decimal(18, 2) not null
|
, PriceTotal decimal(18, 2) not null
|
||||||
, PriceUnit decimal(18, 2) not null
|
, PriceUnit decimal(18, 2) not null
|
||||||
, PriceUnitAdj decimal(18, 2) not null
|
, PriceUnitAdj decimal(18, 2) not null
|
||||||
, Visited_Num int
|
, Visited_Num int
|
||||||
, First_Visit_Time date
|
, First_Visit_Time date
|
||||||
, Visited_Num_15 int
|
, Visited_Num_15 int
|
||||||
, Visited_Num_30 int
|
, Visited_Num_30 int
|
||||||
, Status tinyint
|
, Status tinyint
|
||||||
, AdjustedValue decimal(18, 2)
|
, AdjustedValue decimal(18, 2)
|
||||||
, AdjustedPst decimal(18, 6)
|
, AdjustedPst decimal(18, 6)
|
||||||
, AdjustedCumValue decimal(18, 2)
|
, AdjustedCumValue decimal(18, 2)
|
||||||
, AdjustedCumPst decimal(18, 6)
|
, AdjustedCumPst decimal(18, 6)
|
||||||
, AdjustedCumValueAbs decimal(18, 2)
|
, AdjustedCumValueAbs decimal(18, 2)
|
||||||
, AdjustedCumPstAbs decimal(18, 6)
|
, AdjustedCumPstAbs decimal(18, 6)
|
||||||
, AdjustedCumNum int
|
, AdjustedCumNum int
|
||||||
, PriceTotalIn decimal(18, 2)
|
, PriceTotalIn decimal(18, 2)
|
||||||
, PriceDateIn date
|
, PriceDateIn date
|
||||||
, CaseType int
|
, CaseType int
|
||||||
, RangeFlag int
|
, RangeFlag int
|
||||||
);
|
);
|
||||||
</update>
|
</update>
|
||||||
<update id="createComputePriceTable">
|
<update id="createComputePriceTable">
|
||||||
<bind name="targetTableName" value="'dbo.DWA_PROJECTBASEPRICE_IMDT_' + yearMonth" />
|
<bind name="targetTableName" value="'dbo.DWA_PROJECTBASEPRICE_IMDT_' + yearMonth"/>
|
||||||
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
||||||
drop table ${targetTableName};
|
drop table ${targetTableName};
|
||||||
|
|
||||||
create table ${targetTableName}
|
create table ${targetTableName}
|
||||||
(
|
(
|
||||||
SID int not null identity(1,1)
|
SID int not null identity(1,1)
|
||||||
, ProjectID nvarchar(20) primary key
|
, ProjectID nvarchar(20) primary key
|
||||||
, ProjectName nvarchar(1024)
|
, ProjectName nvarchar(1024)
|
||||||
, ProjectAddr nvarchar(1024)
|
, ProjectAddr nvarchar(1024)
|
||||||
, County nvarchar(512)
|
, County nvarchar(512)
|
||||||
, Block nvarchar(512)
|
, Block nvarchar(512)
|
||||||
, Loop nvarchar(512)
|
, Loop nvarchar(512)
|
||||||
, IsIndxGen tinyint
|
, IsIndxGen tinyint
|
||||||
, IsPstCalc tinyint
|
, IsPstCalc tinyint
|
||||||
, StatusRun tinyint
|
, StatusRun tinyint
|
||||||
, ProjectSPLabel nvarchar(64)
|
, ProjectSPLabel nvarchar(64)
|
||||||
, PropertyType nvarchar(256)
|
, PropertyType nvarchar(256)
|
||||||
, ProjectType nvarchar(256)
|
, ProjectType nvarchar(256)
|
||||||
, ProjectTypeDtl nvarchar(256)
|
, ProjectTypeDtl nvarchar(256)
|
||||||
, ProjectLevel nvarchar(64)
|
, ProjectLevel nvarchar(64)
|
||||||
, Year int
|
, Year int
|
||||||
, MainArea decimal(18, 2)
|
, MainArea decimal(18, 2)
|
||||||
, AreaCoff decimal(7, 4)
|
, AreaCoff decimal(7, 4)
|
||||||
, YearCoff decimal(7, 4)
|
, YearCoff decimal(7, 4)
|
||||||
, PriceNote nvarchar(1024)
|
, PriceNote nvarchar(1024)
|
||||||
, BasePriceDft decimal(18, 2)
|
, BasePriceDft decimal(18, 2)
|
||||||
, MainPriceDft decimal(18, 2)
|
, MainPriceDft decimal(18, 2)
|
||||||
, BasePrice_1 decimal(18, 2)
|
, BasePrice_1 decimal(18, 2)
|
||||||
, PriceUnitAdj decimal(18, 2)
|
, PriceUnitAdj decimal(18, 2)
|
||||||
, Visited_Num int
|
, Visited_Num int
|
||||||
, First_Visit_Time date
|
, First_Visit_Time date
|
||||||
, Visited_Num_15 int
|
, Visited_Num_15 int
|
||||||
, Visited_Num_30 int
|
, Visited_Num_30 int
|
||||||
, PriceDealMean_1 decimal(18, 2)
|
, PriceDealMean_1 decimal(18, 2)
|
||||||
, PriceDealMax_1 decimal(18, 2)
|
, PriceDealMax_1 decimal(18, 2)
|
||||||
, SumDeal_1 int
|
, SumDeal_1 int
|
||||||
, PriceDealMean decimal(18, 2)
|
, PriceDealMean decimal(18, 2)
|
||||||
, PriceDealMax decimal(18, 2)
|
, PriceDealMax decimal(18, 2)
|
||||||
, SumDeal int
|
, SumDeal int
|
||||||
, PriceListedMin decimal(18, 2)
|
, PriceListedMin decimal(18, 2)
|
||||||
, PriceCase1_ToAI_Pst decimal(18, 6)
|
, PriceCase1_ToAI_Pst decimal(18, 6)
|
||||||
, PriceCase2_ToAI_Pst decimal(18, 6)
|
, PriceCase2_ToAI_Pst decimal(18, 6)
|
||||||
, PriceCase1_ToLst_Pst decimal(18, 6)
|
, PriceCase1_ToLst_Pst decimal(18, 6)
|
||||||
, PriceCase2_ToLst_Pst decimal(18, 6)
|
, PriceCase2_ToLst_Pst decimal(18, 6)
|
||||||
, PriceCase1 decimal(18, 2)
|
, PriceCase1 decimal(18, 2)
|
||||||
, PriceCase1AdjPst decimal(18, 6)
|
, PriceCase1AdjPst decimal(18, 6)
|
||||||
, SumCase1 int
|
, SumCase1 int
|
||||||
, PriceCase2 decimal(18, 2)
|
, PriceCase2 decimal(18, 2)
|
||||||
, PriceCase2AdjPst decimal(18, 6)
|
, PriceCase2AdjPst decimal(18, 6)
|
||||||
, SumCase2 int
|
, SumCase2 int
|
||||||
, VOPPBT varchar(64)
|
, VOPPBT varchar(64)
|
||||||
, VOPPB decimal(18, 6)
|
, VOPPB decimal(18, 6)
|
||||||
, BindProjID int
|
, BindProjID int
|
||||||
, Bind_Proj_Pst decimal(18, 6)
|
, Bind_Proj_Pst decimal(18, 6)
|
||||||
, Bind_Block_Class nvarchar(128)
|
, Bind_Block_Class nvarchar(128)
|
||||||
, Bind_Block_Class_Pst decimal(18, 6)
|
, Bind_Block_Class_Pst decimal(18, 6)
|
||||||
, Bind_Block_Plevel nvarchar(128)
|
, Bind_Block_Plevel nvarchar(128)
|
||||||
, Bind_Block_Plevel_Pst decimal(18, 6)
|
, Bind_Block_Plevel_Pst decimal(18, 6)
|
||||||
, Bind_Block_PType nvarchar(128)
|
, Bind_Block_PType nvarchar(128)
|
||||||
, Bind_Block_Ptype_Pst decimal(18, 6)
|
, Bind_Block_Ptype_Pst decimal(18, 6)
|
||||||
, Bind_County_PType nvarchar(128)
|
, Bind_County_PType nvarchar(128)
|
||||||
, Bind_County_Ptype_Pst decimal(18, 6)
|
, Bind_County_Ptype_Pst decimal(18, 6)
|
||||||
, VOPPAT varchar(64)
|
, VOPPAT varchar(64)
|
||||||
, VOPPA decimal(18, 6)
|
, VOPPA decimal(18, 6)
|
||||||
);
|
);
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<!-- 人工修正价格表和作价表一摸一样 -->
|
<!-- 人工修正表 -->
|
||||||
<update id="createArtificialPriceTable">
|
<update id="createArtificialPriceTable">
|
||||||
<bind name="targetTableName" value="'dbo.DWA_PROJECTBASEPRICE_MANU_' + yearMonth" />
|
<bind name="targetTableName" value="'dbo.DWA_PROJECTBASEPRICE_RENT_MANU_' + yearMonth"/>
|
||||||
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
||||||
drop table ${targetTableName};
|
drop table ${targetTableName};
|
||||||
|
|
||||||
create table ${targetTableName}
|
create table ${targetTableName}
|
||||||
(
|
(
|
||||||
SID int not null identity(1,1)
|
id uniqueidentifier not null
|
||||||
, ProjectID nvarchar(20) primary key
|
, ProjectID bigint primary key
|
||||||
, ProjectName nvarchar(1024)
|
, MainCoff_Rent decimal(7, 4)
|
||||||
, ProjectAddr nvarchar(1024)
|
, RentPrice decimal(18, 2)
|
||||||
, County nvarchar(512)
|
, MainRentPrice decimal(18, 2)
|
||||||
, Block nvarchar(512)
|
, RentPrice_1 decimal(18, 2)
|
||||||
, Loop nvarchar(512)
|
|
||||||
, IsIndxGen tinyint
|
|
||||||
, IsPstCalc tinyint
|
|
||||||
, StatusRun tinyint
|
|
||||||
, ProjectSPLabel nvarchar(64)
|
|
||||||
, PropertyType nvarchar(256)
|
|
||||||
, ProjectType nvarchar(256)
|
|
||||||
, ProjectTypeDtl nvarchar(256)
|
|
||||||
, ProjectLevel nvarchar(64)
|
|
||||||
, Year int
|
|
||||||
, MainArea decimal(18, 2)
|
|
||||||
, AreaCoff decimal(7, 4)
|
|
||||||
, YearCoff decimal(7, 4)
|
|
||||||
, PriceNote nvarchar(1024)
|
|
||||||
, BasePriceDft decimal(18, 2)
|
|
||||||
, MainPriceDft decimal(18, 2)
|
|
||||||
, BasePrice_1 decimal(18, 2)
|
|
||||||
, PriceUnitAdj decimal(18, 2)
|
|
||||||
, Visited_Num int
|
|
||||||
, First_Visit_Time date
|
|
||||||
, Visited_Num_15 int
|
|
||||||
, Visited_Num_30 int
|
|
||||||
, PriceDealMean_1 decimal(18, 2)
|
|
||||||
, PriceDealMax_1 decimal(18, 2)
|
|
||||||
, SumDeal_1 int
|
|
||||||
, PriceDealMean decimal(18, 2)
|
|
||||||
, PriceDealMax decimal(18, 2)
|
|
||||||
, SumDeal int
|
|
||||||
, PriceListedMin decimal(18, 2)
|
|
||||||
, PriceCase1_ToAI_Pst decimal(18, 6)
|
|
||||||
, PriceCase2_ToAI_Pst decimal(18, 6)
|
|
||||||
, PriceCase1_ToLst_Pst decimal(18, 6)
|
|
||||||
, PriceCase2_ToLst_Pst decimal(18, 6)
|
|
||||||
, PriceCase1 decimal(18, 2)
|
|
||||||
, PriceCase1AdjPst decimal(18, 6)
|
|
||||||
, SumCase1 int
|
|
||||||
, PriceCase2 decimal(18, 2)
|
|
||||||
, PriceCase2AdjPst decimal(18, 6)
|
|
||||||
, SumCase2 int
|
|
||||||
, VOPPBT varchar(64)
|
|
||||||
, VOPPB decimal(18, 6)
|
|
||||||
, BindProjID int
|
|
||||||
, Bind_Proj_Pst decimal(18, 6)
|
|
||||||
, Bind_Block_Class nvarchar(128)
|
|
||||||
, Bind_Block_Class_Pst decimal(18, 6)
|
|
||||||
, Bind_Block_Plevel nvarchar(128)
|
|
||||||
, Bind_Block_Plevel_Pst decimal(18, 6)
|
|
||||||
, Bind_Block_PType nvarchar(128)
|
|
||||||
, Bind_Block_Ptype_Pst decimal(18, 6)
|
|
||||||
, Bind_County_PType nvarchar(128)
|
|
||||||
, Bind_County_Ptype_Pst decimal(18, 6)
|
|
||||||
, VOPPAT varchar(64)
|
, VOPPAT varchar(64)
|
||||||
, VOPPA decimal(18, 6)
|
, VOPPA decimal(18, 6)
|
||||||
|
, ModifyDate date
|
||||||
|
);
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 核准住宅租赁基价 -->
|
||||||
|
<update id="createUltimateTable">
|
||||||
|
<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
|
||||||
|
(
|
||||||
|
id uniqueidentifier primary key
|
||||||
|
, ProjectID bigint not null
|
||||||
|
, PriceType int
|
||||||
|
, BasePrice_1 decimal(18, 2)
|
||||||
|
, RentPrice decimal(18, 2)
|
||||||
|
, SumCase1 int
|
||||||
|
, VOPPAT varchar(64)
|
||||||
|
, VOPPA decimal(18, 6)
|
||||||
|
, GF_1Room decimal(18, 2)
|
||||||
|
, GF_2Room decimal(18, 2)
|
||||||
|
, GY_2Room decimal(18, 2)
|
||||||
|
, GY_3Room decimal(18, 2)
|
||||||
|
, One_Room decimal(18, 2)
|
||||||
|
, Two_Room decimal(18, 2)
|
||||||
|
, Three_Room decimal(18, 2)
|
||||||
|
, EntireRentRatio decimal(18, 4)
|
||||||
|
, EntireRentNum int
|
||||||
|
, ShareRentRatio decimal(18, 4)
|
||||||
|
, ShareRentNum int
|
||||||
|
, SaleRentRatio decimal(18, 4)
|
||||||
|
, ModifyDate date
|
||||||
|
, Status bit
|
||||||
|
, AdjEvd nvarchar(1024)
|
||||||
);
|
);
|
||||||
</update>
|
</update>
|
||||||
</mapper>
|
</mapper>
|
@ -212,7 +212,8 @@
|
|||||||
<insert id="insertArtificialOfficeBasePrice"
|
<insert id="insertArtificialOfficeBasePrice"
|
||||||
parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice">
|
parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice">
|
||||||
insert into
|
insert into
|
||||||
dbo.DWA_PROJECTBASEPRICE_OFFICE_MANU_${yearMonth}(ID,BuildingID,ProjectID,County,"Loop",Block,ProjectAddr,ProjectName,Year,AvgArea,TotalFloorSum,UpperFloorSum,OfficeClass,Grade,MainPrice_1,MainPriceRent_1,MainPrice,MainPriceRent,ModifyDate) values(#{id},#{buildingId},#{communityId},#{countyName},#{loopName},#{blockName},#{communityAddress},#{communityName},#{year},#{avgArea},#{totalFloorSum},#{upperFloorSum},#{officeClass},#{officeLevel},#{mainPrice_1},#{mainPriceRent_1},#{mainPrice},#{mainPriceRent},getdate())
|
dbo.DWA_PROJECTBASEPRICE_OFFICE_MANU_${yearMonth}(ID,BuildingID,ProjectID,County,"Loop",Block,ProjectAddr,ProjectName,Year,AvgArea,TotalFloorSum,UpperFloorSum,OfficeClass,Grade,MainPrice_1,MainPriceRent_1,MainPrice,MainPriceRent,ModifyDate)
|
||||||
|
values(#{id},#{buildingId},#{communityId},#{countyName},#{loopName},#{blockName},#{communityAddress},#{communityName},#{year},#{avgArea},#{totalFloorSum},#{upperFloorSum},#{officeClass},#{officeLevel},#{mainPrice_1},#{mainPriceRent_1},#{mainPrice},#{mainPriceRent},getdate())
|
||||||
</insert>
|
</insert>
|
||||||
<!-- 更新状态 -->
|
<!-- 更新状态 -->
|
||||||
<update id="updateStatus">
|
<update id="updateStatus">
|
||||||
|
269
ruoyi/src/main/resources/sql-template/update_rent_price.sql
Normal file
269
ruoyi/src/main/resources/sql-template/update_rent_price.sql
Normal file
@ -0,0 +1,269 @@
|
|||||||
|
/***********************小区租金价格计算************************/
|
||||||
|
WITH STP AS(
|
||||||
|
SELECT A.ProjectID, 2 AS PriceType, B.BasePrice AS BasePrice_1, A.RentPriceDft as RentPrice, A.MainRentPriceDft as MainRentPrice,
|
||||||
|
A.SumCase1, A.VOPPAT, A.VOPPA,
|
||||||
|
CASE WHEN C.ProjectLevel = '工房1' THEN A.RentPriceDft*(1+24*0.012)*1.0/(1.0*(1+0.011*1.8))
|
||||||
|
WHEN C.ProjectLevel = '工房2' THEN A.RentPriceDft*(1+26*0.012)*1.0/(1.0*(1+0.011*1.8))
|
||||||
|
END AS GF_1Room,
|
||||||
|
CASE WHEN C.ProjectLevel = '工房1' THEN A.RentPriceDft*(1+16*0.012)*1.0/(1.0*(1+0.011*1.8))
|
||||||
|
WHEN C.ProjectLevel = '工房2' THEN A.RentPriceDft*(1+16*0.012)*1.0/(1.0*(1+0.011*1.8))
|
||||||
|
END AS GF_2Room,
|
||||||
|
CASE WHEN C.ProjectLevel = '低端公寓1' THEN A.RentPriceDft*1.0*(1+0.011*3.3)/(1.0*(1+0.011*1.8))
|
||||||
|
WHEN C.ProjectLevel IN ('中端公寓','低端公寓2') THEN A.RentPriceDft*1.0*(1+0.011*3.3)/(1.0*(1+0.011*1.8))
|
||||||
|
WHEN C.ProjectLevel IN ('高端公寓','超高端公寓') THEN A.RentPriceDft*(1+5*0.012)*(1+0.011*3.3)/((1.0+0.011*1.8))
|
||||||
|
END AS GY_2Room,
|
||||||
|
CASE WHEN C.ProjectLevel = '低端公寓1' THEN A.RentPriceDft*(1-3*0.012)*(1+0.011*4.25)/(1*(1+0.011*1.8))
|
||||||
|
WHEN C.ProjectLevel = '低端公寓2' THEN A.RentPriceDft*(1-4*0.012)*(1+0.011*4.25)/(1*(1+0.011*1.8))
|
||||||
|
WHEN C.ProjectLevel = '中端公寓' THEN A.RentPriceDft*(1-3*0.012)*(1+0.011*4.25)/(1*(1+0.011*1.8))
|
||||||
|
WHEN C.ProjectLevel IN ('高端公寓','超高端公寓') THEN A.RentPriceDft*(1+4*0.012)*(1+0.011*4.25)/((1+0.011*1.8))
|
||||||
|
END AS GY_3Room
|
||||||
|
FROM DWA_PROJECTBASEPRICE_RENT_IMDT_#yearMonth# A
|
||||||
|
LEFT JOIN ODS_PROJECT_PRICE_INFO_#lastYearMonth# B
|
||||||
|
ON A.ProjectID = B.ProjectID AND B.STATUS = 1
|
||||||
|
LEFT JOIN ResidenceCommunity C
|
||||||
|
ON A.ProjectID = C.CommunityId;
|
||||||
|
)
|
||||||
|
INSERT INTO ODS_PROJECT_RENT_PRICE_INFO_#yearMonth#
|
||||||
|
SELECT A.ProjectID, A.PriceType, A.BasePrice_1, A.RentPrice, A.SumCase1, A.VOPPAT, A.VOPPA, A.GF_1Room, A.GF_2Room, A.GY_2Room, A.GY_3Room,
|
||||||
|
A.GF_1Room*35 AS One_Room,
|
||||||
|
CASE WHEN A.GF_2Room IS NOT NULL THEN A.GF_2Room*50 ELSE GY_2Room*90 END AS Two_Room,
|
||||||
|
A.GY_3Room*105 AS Three_Three_Room, B.EntireRentRatio, B.EntireRentNum,
|
||||||
|
B.ShareRentRatio, B.ShareRentNum, A.RentPrice*12/A.BasePrice_1 AS SaleRentRatio, CONVERT(DATE,NULL) AS ModifyDate,
|
||||||
|
1 AS Status, NULL AdjEvd
|
||||||
|
FROM STP A
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT ProjectID,
|
||||||
|
AVG(CASE WHEN RangeFlag = 30 THEN EntireRentRatio END) AS EntireRentRatio,
|
||||||
|
SUM(CASE WHEN RangeFlag = 30 THEN 1 END) AS EntireRentNum,
|
||||||
|
AVG(CASE WHEN RangeFlag = 40 THEN ShareRentRatio END) AS ShareRentRatio,
|
||||||
|
SUM(CASE WHEN RangeFlag = 40 THEN 1 END) AS ShareRentNum
|
||||||
|
FROM DW_HOUSINGCASE_RENT_COMM_#yearMonth#
|
||||||
|
GROUP BY ProjectID
|
||||||
|
) B ON A.ProjectID = B.ProjectID;
|
||||||
|
|
||||||
|
|
||||||
|
drop table #InfoChg;
|
||||||
|
drop table #InfoChgCurr;
|
||||||
|
|
||||||
|
---价格调整
|
||||||
|
select a.ProjectID, a.RentPrice, a.RentPrice_1, a.VOPPAT, a.VOPPA, GETDATE() AS ModifyDate,
|
||||||
|
case when b.ProjectID is not null and isnull(a.RentPrice,0) <> isnull(b.RentPrice,0) then 1 else 0 end as RentPriceChg,
|
||||||
|
case when b.ProjectID is not null and isnull(a.VOPPAT,'') <> isnull(b.VOPPAT,'') then 1 else 0 end as VOPPATChg, -- 指当期价格涨跌幅类型字段变化
|
||||||
|
case when b.ProjectID is not null and isnull(a.VOPPA,0) <> isnull(b.VOPPA,0) then 1 else 0 end as VOPPAChg, -- 指当期价格涨跌幅字段变化
|
||||||
|
case when c.ProjectID is not null then 1 else 0 end as RentPrice_1Chg
|
||||||
|
into #InfoChg
|
||||||
|
from DWA_PROJECTBASEPRICE_RENT_MANU_#yearMonth# a
|
||||||
|
left join ODS_PROJECT_RENT_PRICE_INFO_#yearMonth# b
|
||||||
|
on a.ProjectID = b.ProjectID and b.status=1 and (
|
||||||
|
isnull(a.RentPrice,0) <> isnull(b.RentPrice,0) or
|
||||||
|
isnull(a.VOPPAT,'') <> isnull(b.VOPPAT,'') or
|
||||||
|
isnull(a.VOPPA,0) <> isnull(b.VOPPA,0))
|
||||||
|
left join ODS_PROJECT_RENT_PRICE_INFO_#lastYearMonth# c
|
||||||
|
on a.ProjectID = c.ProjectID and c.status=1 and isnull(a.RentPrice_1,0) <> isnull(c.RentPrice,0)
|
||||||
|
where b.ProjectID is not null or c.ProjectID is not null;
|
||||||
|
|
||||||
|
|
||||||
|
----当期价格调整
|
||||||
|
select a.ProjectID, a.PriceType, a.BasePrice_1, b.RentPrice, a.SumCase1, b.VOPPAT, b.VOPPA,
|
||||||
|
a.GF_1Room*b.RentPrice/a.RentPrice as GF_1Room,
|
||||||
|
a.GF_2Room*b.RentPrice/a.RentPrice as GF_2Room,
|
||||||
|
a.GY_2Room*b.RentPrice/a.RentPrice as GY_2Room,
|
||||||
|
a.GY_3Room*b.RentPrice/a.RentPrice as GY_3Room,
|
||||||
|
a.One_Room*b.RentPrice/a.RentPrice as One_Room,
|
||||||
|
a.Two_Room*b.RentPrice/a.RentPrice as Two_Room,
|
||||||
|
a.Three_Room*b.RentPrice/a.RentPrice as Three_Room,
|
||||||
|
a.EntireRentRatio*b.RentPrice/a.RentPrice as EntireRentRatio,
|
||||||
|
a.EntireRentNum,
|
||||||
|
a.ShareRentRatio*b.RentPrice/a.RentPrice as ShareRentRatio,
|
||||||
|
a.ShareRentNum,
|
||||||
|
a.SaleRentRatio*b.RentPrice/a.RentPrice as SaleRentRatio,
|
||||||
|
b.ModifyDate, 1 as Status,
|
||||||
|
case when RentPriceChg=0 then '' else 'RentPriceChg|' end +
|
||||||
|
case when VOPPATChg=0 then '' else 'VOPPATChg|' end +
|
||||||
|
case when VOPPAChg=0 then '' else 'VOPPAChg|' end as AdjEvd
|
||||||
|
into #InfoChgCurr
|
||||||
|
from ODS_PROJECT_RENT_PRICE_INFO_#yearMonth# a
|
||||||
|
inner join #InfoChg b
|
||||||
|
on a.ProjectID = b.ProjectID
|
||||||
|
where (b.RentPriceChg=1 or b.VOPPATChg=1 or b.VOPPAChg=1) and a.status=1;
|
||||||
|
|
||||||
|
update a
|
||||||
|
set a.Status = 0
|
||||||
|
from ODS_PROJECT_RENT_PRICE_INFO_#yearMonth# a
|
||||||
|
left join #InfoChgCurr b
|
||||||
|
on a.ProjectID = b.ProjectID
|
||||||
|
where b.ProjectID is not null and a.status=1;
|
||||||
|
|
||||||
|
insert into ODS_PROJECT_RENT_PRICE_INFO_#yearMonth#
|
||||||
|
select * from #InfoChgCurr
|
||||||
|
|
||||||
|
----上期价格调整
|
||||||
|
-----BUG修复:调整上期租金基价时,误使用了当期租金基价覆盖,已修正
|
||||||
|
-----口径修改:当期调整上期价格时,上期的涨跌幅因为已经发布出去,所以不做修改,只修改上期价格即可
|
||||||
|
select a.ProjectID, a.PriceType, a.BasePrice_1, b.RentPrice_1, a.SumCase1, a.VOPPAT, a.VOPPA,
|
||||||
|
a.GF_1Room*b.RentPrice_1/a.RentPrice as GF_1Room,
|
||||||
|
a.GF_2Room*b.RentPrice_1/a.RentPrice as GF_2Room,
|
||||||
|
a.GY_2Room*b.RentPrice_1/a.RentPrice as GY_2Room,
|
||||||
|
a.GY_3Room*b.RentPrice_1/a.RentPrice as GY_3Room,
|
||||||
|
a.One_Room*b.RentPrice_1/a.RentPrice as One_Room,
|
||||||
|
a.Two_Room*b.RentPrice_1/a.RentPrice as Two_Room,
|
||||||
|
a.Three_Room*b.RentPrice_1/a.RentPrice as Three_Room,
|
||||||
|
a.EntireRentRatio*b.RentPrice_1/a.RentPrice as EntireRentRatio,
|
||||||
|
a.EntireRentNum,
|
||||||
|
a.ShareRentRatio*b.RentPrice_1/a.RentPrice as ShareRentRatio,
|
||||||
|
a.ShareRentNum,
|
||||||
|
a.SaleRentRatio*b.RentPrice_1/a.RentPrice as SaleRentRatio,
|
||||||
|
b.ModifyDate, 1 as Status,
|
||||||
|
'RentPrice_1Chg|' as AdjEvd
|
||||||
|
into #InfoChgLst
|
||||||
|
from ODS_PROJECT_RENT_PRICE_INFO_#lastYearMonth# a
|
||||||
|
inner join #InfoChg b
|
||||||
|
on a.ProjectID = b.ProjectID
|
||||||
|
where b.RentPrice_1Chg=1 and a.status=1;
|
||||||
|
|
||||||
|
update a
|
||||||
|
set a.Status = 0
|
||||||
|
from ODS_PROJECT_RENT_PRICE_INFO_#lastYearMonth# a
|
||||||
|
left join #InfoChgLst b
|
||||||
|
on a.ProjectID = b.ProjectID
|
||||||
|
where b.ProjectID is not null and a.status=1;
|
||||||
|
|
||||||
|
insert into ODS_PROJECT_RENT_PRICE_INFO_#lastYearMonth#
|
||||||
|
select * from #InfoChgLst;
|
||||||
|
|
||||||
|
drop table #InfoChg, #InfoChgCurr, #InfoChgLst;
|
||||||
|
|
||||||
|
--插入新增小区价格信息
|
||||||
|
WITH STP AS(
|
||||||
|
SELECT A.ProjectID, 2 AS PriceType, NULL AS BasePrice_1, A.RentPrice, A.MainRentPrice,
|
||||||
|
NULL SumCase1, A.VOPPAT, A.VOPPA,
|
||||||
|
CASE WHEN C.ProjectLevel = '工房1' THEN A.RentPrice*(1+24*0.012)*1.0/(1.0*(1+0.011*1.8))
|
||||||
|
WHEN C.ProjectLevel = '工房2' THEN A.RentPrice*(1+26*0.012)*1.0/(1.0*(1+0.011*1.8))
|
||||||
|
END AS GF_1Room,
|
||||||
|
CASE WHEN C.ProjectLevel = '工房1' THEN A.RentPrice*(1+16*0.012)*1.0/(1.0*(1+0.011*1.8))
|
||||||
|
WHEN C.ProjectLevel = '工房2' THEN A.RentPrice*(1+16*0.012)*1.0/(1.0*(1+0.011*1.8))
|
||||||
|
END AS GF_2Room,
|
||||||
|
CASE WHEN C.ProjectLevel = '低端公寓1' THEN A.RentPrice*1.0*(1+0.011*3.3)/(1.0*(1+0.011*1.8))
|
||||||
|
WHEN C.ProjectLevel IN ('中端公寓','低端公寓2') THEN A.RentPrice*1.0*(1+0.011*3.3)/(1.0*(1+0.011*1.8))
|
||||||
|
WHEN C.ProjectLevel IN ('高端公寓','超高端公寓') THEN A.RentPrice*(1+5*0.012)*(1+0.011*3.3)/((1.0+0.011*1.8))
|
||||||
|
END AS GY_2Room,
|
||||||
|
CASE WHEN C.ProjectLevel = '低端公寓1' THEN A.RentPrice*(1-3*0.012)*(1+0.011*4.25)/(1*(1+0.011*1.8))
|
||||||
|
WHEN C.ProjectLevel = '低端公寓2' THEN A.RentPrice*(1-4*0.012)*(1+0.011*4.25)/(1*(1+0.011*1.8))
|
||||||
|
WHEN C.ProjectLevel = '中端公寓' THEN A.RentPrice*(1-3*0.012)*(1+0.011*4.25)/(1*(1+0.011*1.8))
|
||||||
|
WHEN B.ProjectLevel IN ('高端公寓','超高端公寓') THEN A.RentPrice*(1+4*0.012)*(1+0.011*4.25)/((1+0.011*1.8))
|
||||||
|
END AS GY_3Room
|
||||||
|
FROM DWA_PROJECTBASEPRICE_RENT_MANU_#yearMonth# A
|
||||||
|
LEFT JOIN ResidenceCommunity C
|
||||||
|
ON A.ProjectID = C.CommunityId
|
||||||
|
WHERE C.CommunityId IS NULL
|
||||||
|
)
|
||||||
|
INSERT INTO ODS_PROJECT_RENT_PRICE_INFO_#yearMonth#
|
||||||
|
SELECT A.ProjectID, A.PriceType, A.BasePrice_1, A.RentPrice, A.SumCase1, A.VOPPAT, A.VOPPA, A.GF_1Room, A.GF_2Room, A.GY_2Room, A.GY_3Room,
|
||||||
|
A.GF_1Room*35 AS One_Room, A.GF_2Room*50 AS Two_Room, A.GY_3Room*105 AS Three_Three_Room, NULL EntireRentRatio, NULL EntireRentNum,
|
||||||
|
NULL ShareRentRatio, NULL ShareRentNum, NULL SaleRentRatio, GETDATE() AS ModifyDate,
|
||||||
|
1 AS Status, 'NewAdded' AdjEvd
|
||||||
|
FROM STP A
|
||||||
|
|
||||||
|
-- 更新上月价格
|
||||||
|
update a
|
||||||
|
set a.ITEM_MAINAREAPRICE = b.RentPrice
|
||||||
|
from obpm_LianCheng_Data.dbo.TLK_基价信息 a
|
||||||
|
join dbo.ODS_PROJECT_RENT_PRICE_INFO_#lastYearMonth# b
|
||||||
|
on a.ITEM_AIRAID = b.ProjectID
|
||||||
|
where b.Status = 1
|
||||||
|
and a.ITEM_VALUEPOINT = '#lastPriceDate#'
|
||||||
|
and a.ITEM_PRICETYPE = '2'
|
||||||
|
and a.ITEM_PROJECTTYPE = '1'
|
||||||
|
and a.ITEM_MAINAREAPRICE <> b.RentPrice;
|
||||||
|
|
||||||
|
-- 插入新的价格
|
||||||
|
insert into obpm_LianCheng_Data.dbo.TLK_基价信息
|
||||||
|
(
|
||||||
|
ID
|
||||||
|
, LASTMODIFIED
|
||||||
|
, FORMNAME
|
||||||
|
, AUTHOR
|
||||||
|
, AUTHOR_DEPT_INDEX
|
||||||
|
, CREATED
|
||||||
|
, FORMID
|
||||||
|
, ISTMP
|
||||||
|
, VERSIONS
|
||||||
|
, APPLICATIONID
|
||||||
|
, LASTMODIFIER
|
||||||
|
, DOMAINID
|
||||||
|
, ITEM_PriceID
|
||||||
|
, ITEM_AIRAID
|
||||||
|
, ITEM_PROJECTTYPE
|
||||||
|
, ITEM_PRICETYPE
|
||||||
|
, ITEM_MAINAREAPRICE
|
||||||
|
, ITEM_VALUEPOINT
|
||||||
|
, ITEM_PRICEEXPLAIN
|
||||||
|
, ITEM_UPDATEPERSON
|
||||||
|
, ITEM_UPDATEDATE
|
||||||
|
, ITEM_PRICECHG
|
||||||
|
)
|
||||||
|
select newid()
|
||||||
|
, getdate()
|
||||||
|
, '物业信息管理/基价信息'
|
||||||
|
, 'amQRUkvYQAsAec1JGLp'
|
||||||
|
, 'amQRUkvYQAsAec1JGLp'
|
||||||
|
, getdate()
|
||||||
|
, 'ybte0OakLV17UzAyoVU'
|
||||||
|
, 0
|
||||||
|
, 1
|
||||||
|
, 'Ts7TykYmuEzzZgWhXHj'
|
||||||
|
, 'amQRUkvYQAsAec1JGLp'
|
||||||
|
, 'BclzHtmfLQoAA5ICTb5'
|
||||||
|
, newid()
|
||||||
|
, ProjectID
|
||||||
|
, 2
|
||||||
|
, 2
|
||||||
|
, RentPrice
|
||||||
|
, '#priceDate#'
|
||||||
|
, AdjEvd
|
||||||
|
, '李贺'
|
||||||
|
, getdate()
|
||||||
|
, VOPPA
|
||||||
|
from dbo.ODS_PROJECT_RENT_PRICE_INFO_#yearMonth#
|
||||||
|
where Status = 1;
|
||||||
|
|
||||||
|
|
||||||
|
insert into obpm_LianCheng_Data.dbo.T_DOCUMENT
|
||||||
|
(
|
||||||
|
ID
|
||||||
|
, LASTMODIFIED
|
||||||
|
, FORMNAME
|
||||||
|
, AUTHOR
|
||||||
|
, AUTHOR_DEPT_INDEX
|
||||||
|
, CREATED
|
||||||
|
, FORMID
|
||||||
|
, ISTMP
|
||||||
|
, VERSIONS
|
||||||
|
, APPLICATIONID
|
||||||
|
, LASTMODIFIER
|
||||||
|
, DOMAINID
|
||||||
|
, AUDITORLIST
|
||||||
|
, COAUDITORLIST
|
||||||
|
, MAPPINGID
|
||||||
|
)
|
||||||
|
select a.ID
|
||||||
|
, a.LASTMODIFIED
|
||||||
|
, a.FORMNAME
|
||||||
|
, a.AUTHOR
|
||||||
|
, a.AUTHOR_DEPT_INDEX
|
||||||
|
, a.CREATED
|
||||||
|
, a.FORMID
|
||||||
|
, a.ISTMP
|
||||||
|
, a.VERSIONS
|
||||||
|
, a.APPLICATIONID
|
||||||
|
, a.LASTMODIFIER
|
||||||
|
, a.DOMAINID
|
||||||
|
, a.AUDITORLIST
|
||||||
|
, a.COAUDITORLIST
|
||||||
|
, a.id
|
||||||
|
from obpm_LianCheng_Data.dbo.TLK_基价信息 a
|
||||||
|
left join obpm_LianCheng_Data.dbo.T_DOCUMENT b
|
||||||
|
on a.ID = b.ID
|
||||||
|
where a.ITEM_VALUEPOINT = '#priceDate#'
|
||||||
|
and a.ITEM_PROJECTTYPE = '1'
|
||||||
|
and a.ITEM_PRICETYPE = '2';
|
Reference in New Issue
Block a user