feature (办公作价): 成功导入办公作价

1. 修复Boolean名称赋值问题
2. 修复BigDecimal类型赋值问题
3. 优化导入逻辑
4. 优化弹窗关闭友好提示
This commit is contained in:
purple 2020-07-08 15:58:59 +08:00
parent 00d6aedf39
commit 991f21a96d
15 changed files with 898 additions and 60 deletions

View File

@ -1,6 +1,7 @@
server {
listen 80;
server_name localhost;
client_max_body_size 20m;
location / {
root /home/ruoyi/projects/ruoyi-ui;

View File

@ -127,7 +127,7 @@
v-hasPermi="['system:user:edit']"
>修改</el-button>
</template>
</el-table-column> -->
</el-table-column>-->
</el-table>
<pagination
@ -291,9 +291,15 @@
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog> -->
</el-dialog>-->
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-dialog
:title="upload.title"
:visible.sync="upload.open"
width="400px"
append-to-body
:before-close="handleClose"
>
<el-upload
ref="upload"
:limit="1"
@ -600,6 +606,14 @@ export default {
//
submitFileForm() {
this.$refs.upload.submit();
},
handleClose: function(done) {
this
.$confirm("确认关闭?")
.then(_ => {
done();
})
.catch(_ => {});
}
}
};

View File

@ -1,37 +1,32 @@
create type dbo.DWA_PROJECTBASEPRICE_OFFICE_MANU_Table as table
(
BuildingID nvarchar(20) null
, UnifiedID nvarchar(20) null
, ProjectID nvarchar(20) null
, BuildingID_P nvarchar(20) not null
, ProjectID_P nvarchar(20) null
, MainPrice decimal(38, 6) null
, MainPriceRent decimal(38, 6) null
, MainPricePst decimal(38, 6) null
, MainPriceRentPst decimal(38, 6) null
, MainPriceType varchar(2) null
, MainPriceRentType varchar(2) null
, ModifyDate date not null
, Status bit not null
, BuildingStd bit null
, AdjEvd nvarchar(1000) null
, MainPrice_1 decimal(18, 6) null
, MainPriceRent_1 decimal(18, 6) null
, AreaCoff decimal(18, 6) null
, YearCoff decimal(18, 6) null
, BuildingCoff decimal(18, 6) null
, ProjectName nvarchar(200) null
, ProjectAddr nvarchar(200) null
, BuildingAddr nvarchar(200) null
, County nvarchar(200) null
, Loop nvarchar(200) null
, Block nvarchar(200) null
, Street nvarchar(200) null
, Year int null
, AvgArea decimal(10, 2) null
, TotalFloorSum nvarchar(50) null
, UpperFloorSum nvarchar(50) null
, OfficeClass nvarchar(50) null
, Grade nvarchar(50) null
create type dbo.DWA_PROJECTBASEPRICE_OFFICE_MANU_Table as table(
id int not null,
BuildingID_P nvarchar(20) not null,
ProjectID_P nvarchar(20) null,
ProjectName nvarchar(200) null,
ProjectAddr nvarchar(200) null,
BuildingAddr nvarchar(200) null,
County nvarchar(200) null,
Loop nvarchar(200) null,
Block nvarchar(200) null,
Street nvarchar(200) null,
Year int null,
AvgArea decimal(10, 2) null,
TotalFloorSum nvarchar(50) null,
UpperFloorSum nvarchar(50) null,
OfficeClass nvarchar(50) null,
Grade nvarchar(50) null,
MainPrice_1 decimal(18, 6) null,
MainPriceRent_1 decimal(18, 6) null,
MainPrice decimal(18, 6) null,
MainPriceRent decimal(18, 6) null,
MainPricePst decimal(18, 6) null,
MainPriceRentPst decimal(18, 6) null,
MainPriceType varchar(2) null,
MainPriceRentType varchar(2) null,
AreaCoff decimal(18, 6) null,
YearCoff decimal(18, 6) null,
BuildingCoff decimal(18, 6) null,
BuildingStd bit null,
AdjEvd nvarchar(1000) null
)
go
go

View File

@ -17,6 +17,7 @@ import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.Cell;
@ -189,14 +190,15 @@ public class ExcelUtil<T> {
Row row = sheet.getRow(i);
T entity = null;
for (Map.Entry<Integer, Field> entry : fieldsMap.entrySet()) {
Object val = this.getCellValue(row, entry.getKey());
// 如果不存在实例则新建.
entity = (entity == null ? clazz.newInstance() : entity);
// 从map中得到对应列的field.
Field field = fieldsMap.get(entry.getKey());
// 取得类型,并根据对象类型设置值.
Class<?> fieldType = field.getType();
Object val = this.getCellValue(row, entry.getKey(), fieldType);
if (String.class == fieldType) {
String s = Convert.toStr(val);
if (StringUtils.endsWith(s, ".0")) {
@ -220,6 +222,10 @@ public class ExcelUtil<T> {
} else if (val instanceof Double) {
val = DateUtil.getJavaDate((Double) val);
}
} else if (Boolean.class == fieldType) {
if (val instanceof String) {
val = new Boolean(val.toString());
}
}
if (StringUtils.isNotNull(fieldType)) {
Excel attr = field.getAnnotation(Excel.class);
@ -705,8 +711,9 @@ public class ExcelUtil<T> {
if (HSSFDateUtil.isCellDateFormatted(cell)) {
val = DateUtil.getJavaDate((Double) val); // POI Excel 日期格式转换
} else {
// new BigDecimal(val.toString())
if ((Double) val % 1 > 0) {
val = new DecimalFormat("0.00").format(val);
val = new DecimalFormat("0.000000").format(val);
} else {
val = new DecimalFormat("0").format(val);
}
@ -725,4 +732,47 @@ public class ExcelUtil<T> {
}
return val;
}
public Object getCellValue(Row row, int column, Class<?> fieldType) {
if (row == null) {
return row;
}
Object val = "";
try {
Cell cell = row.getCell(column);
if (StringUtils.isNotNull(cell)) {
if (cell.getCellTypeEnum() == CellType.NUMERIC || cell.getCellTypeEnum() == CellType.FORMULA) {
val = cell.getNumericCellValue();
if (HSSFDateUtil.isCellDateFormatted(cell)) {
val = DateUtil.getJavaDate((Double) val); // POI Excel 日期格式转换
} else {
if (BigDecimal.class == fieldType) {
if (StringUtils.isNotEmpty(val.toString())) {
val = new BigDecimal(val.toString());
} else {
val = null;
}
} else {
if ((Double) val % 1 > 0) {
val = new DecimalFormat("0.00").format(val);
} else {
val = new DecimalFormat("0").format(val);
}
}
}
} else if (cell.getCellTypeEnum() == CellType.STRING) {
val = cell.getStringCellValue();
} else if (cell.getCellTypeEnum() == CellType.BOOLEAN) {
val = cell.getBooleanCellValue();
} else if (cell.getCellTypeEnum() == CellType.ERROR) {
val = cell.getErrorCellValue();
}
}
} catch (Exception e) {
return val;
}
return val;
}
}

View File

@ -0,0 +1,570 @@
package com.ruoyi.project.data.cases.domain;
import java.math.BigDecimal;
import java.util.Date;
/**
* 租赁汇总案例
*/
public class CleanResidenceRentAggregationCase {
private Integer yearMonth;
private String householdsIdSRC;
private String projectIdSRC;
private String communityId;
private String buildingId;
private Integer rentType;
private Integer roomNum;
private Integer hallNum;
private Integer bashRoomNum;
private BigDecimal area;
private String toward;
private String totalFloor;
private String currentFloor;
private Boolean elevator;
private String decoration;
private Integer year;
private BigDecimal areaCoefficient;
private BigDecimal towardCoefficient;
private BigDecimal floorCoefficient;
private Integer decorationCoefficient;
private BigDecimal yearCoefficient;
private BigDecimal buildingCoefficient;
private BigDecimal roomTypeCoefficient;
private BigDecimal totalPrice;
private BigDecimal unitPrice;
private BigDecimal priceScatterRent;
private BigDecimal priceEntireRent;
private BigDecimal priceShareRent0;
private BigDecimal priceShareRent;
private Integer visitedNum;
private Date firstVisitedDate;
private Integer visitedNum15;
private Integer visitedNum30;
private Integer status;
private BigDecimal adjustedValue;
private BigDecimal adjustedPst;
private BigDecimal adjustedCumValue;
private BigDecimal adjustedCumPst;
/**
* 累计挂牌总价绝对调整幅度
*/
private BigDecimal adjustedCumValueAbs;
/**
* 累计挂牌总价绝对调整比例
*/
private BigDecimal adjustedCumPstAbs;
/**
* 累计挂牌总价调价次数
*/
private BigDecimal adjustedCumNum;
/**
* 首次挂牌总价
*/
private BigDecimal priceTotalIn;
/**
* 下架时挂牌总价
*/
private BigDecimal priceTotalOut;
/**
* 首次挂牌日期
*/
private Date priceDateIn;
/**
* 下架日期
*/
private Date priceDateOut;
/**
* 案例来源
*/
private String origin;
/**
* 案例URL
*/
private String urlHouseholds;
/**
* 案例小区URL
*/
private String urlProjects;
/**
* 案例名称
*/
private String caseName;
/**
* 0=成交
* 1=挂牌
*/
private Integer caseType;
/**
* 平均租金上周期
*/
private BigDecimal rentPrice_1;
/**
* 案例涨跌幅
*/
private BigDecimal range;
/**
* 涨跌类型
*/
private Integer rangeFlag;
/**
* 平均租金
*/
private BigDecimal rentPrice;
/**
* 整租比
*/
private BigDecimal entireRentRatio;
/**
* 分租比
*/
private BigDecimal shareRentRatio;
public Integer getYearMonth() {
return yearMonth;
}
public void setYearMonth(Integer yearMonth) {
this.yearMonth = yearMonth;
}
public String getHouseholdsIdSRC() {
return householdsIdSRC;
}
public void setHouseholdsIdSRC(String householdsIdSRC) {
this.householdsIdSRC = householdsIdSRC;
}
public String getProjectIdSRC() {
return projectIdSRC;
}
public void setProjectIdSRC(String projectIdSRC) {
this.projectIdSRC = projectIdSRC;
}
public String getCommunityId() {
return communityId;
}
public void setCommunityId(String communityId) {
this.communityId = communityId;
}
public String getBuildingId() {
return buildingId;
}
public void setBuildingId(String buildingId) {
this.buildingId = buildingId;
}
public Integer getRentType() {
return rentType;
}
public void setRentType(Integer rentType) {
this.rentType = rentType;
}
public Integer getRoomNum() {
return roomNum;
}
public void setRoomNum(Integer roomNum) {
this.roomNum = roomNum;
}
public Integer getHallNum() {
return hallNum;
}
public void setHallNum(Integer hallNum) {
this.hallNum = hallNum;
}
public Integer getBashRoomNum() {
return bashRoomNum;
}
public void setBashRoomNum(Integer bashRoomNum) {
this.bashRoomNum = bashRoomNum;
}
public BigDecimal getArea() {
return area;
}
public void setArea(BigDecimal area) {
this.area = area;
}
public String getToward() {
return toward;
}
public void setToward(String toward) {
this.toward = toward;
}
public String getTotalFloor() {
return totalFloor;
}
public void setTotalFloor(String totalFloor) {
this.totalFloor = totalFloor;
}
public String getCurrentFloor() {
return currentFloor;
}
public void setCurrentFloor(String currentFloor) {
this.currentFloor = currentFloor;
}
public Boolean getElevator() {
return elevator;
}
public void setElevator(Boolean elevator) {
this.elevator = elevator;
}
public String getDecoration() {
return decoration;
}
public void setDecoration(String decoration) {
this.decoration = decoration;
}
public Integer getYear() {
return year;
}
public void setYear(Integer year) {
this.year = year;
}
public BigDecimal getAreaCoefficient() {
return areaCoefficient;
}
public void setAreaCoefficient(BigDecimal areaCoefficient) {
this.areaCoefficient = areaCoefficient;
}
public BigDecimal getTowardCoefficient() {
return towardCoefficient;
}
public void setTowardCoefficient(BigDecimal towardCoefficient) {
this.towardCoefficient = towardCoefficient;
}
public BigDecimal getFloorCoefficient() {
return floorCoefficient;
}
public void setFloorCoefficient(BigDecimal floorCoefficient) {
this.floorCoefficient = floorCoefficient;
}
public Integer getDecorationCoefficient() {
return decorationCoefficient;
}
public void setDecorationCoefficient(Integer decorationCoefficient) {
this.decorationCoefficient = decorationCoefficient;
}
public BigDecimal getYearCoefficient() {
return yearCoefficient;
}
public void setYearCoefficient(BigDecimal yearCoefficient) {
this.yearCoefficient = yearCoefficient;
}
public BigDecimal getBuildingCoefficient() {
return buildingCoefficient;
}
public void setBuildingCoefficient(BigDecimal buildingCoefficient) {
this.buildingCoefficient = buildingCoefficient;
}
public BigDecimal getRoomTypeCoefficient() {
return roomTypeCoefficient;
}
public void setRoomTypeCoefficient(BigDecimal roomTypeCoefficient) {
this.roomTypeCoefficient = roomTypeCoefficient;
}
public BigDecimal getTotalPrice() {
return totalPrice;
}
public void setTotalPrice(BigDecimal totalPrice) {
this.totalPrice = totalPrice;
}
public BigDecimal getUnitPrice() {
return unitPrice;
}
public void setUnitPrice(BigDecimal unitPrice) {
this.unitPrice = unitPrice;
}
public BigDecimal getPriceScatterRent() {
return priceScatterRent;
}
public void setPriceScatterRent(BigDecimal priceScatterRent) {
this.priceScatterRent = priceScatterRent;
}
public BigDecimal getPriceEntireRent() {
return priceEntireRent;
}
public void setPriceEntireRent(BigDecimal priceEntireRent) {
this.priceEntireRent = priceEntireRent;
}
public BigDecimal getPriceShareRent0() {
return priceShareRent0;
}
public void setPriceShareRent0(BigDecimal priceShareRent0) {
this.priceShareRent0 = priceShareRent0;
}
public BigDecimal getPriceShareRent() {
return priceShareRent;
}
public void setPriceShareRent(BigDecimal priceShareRent) {
this.priceShareRent = priceShareRent;
}
public Integer getVisitedNum() {
return visitedNum;
}
public void setVisitedNum(Integer visitedNum) {
this.visitedNum = visitedNum;
}
public Date getFirstVisitedDate() {
return firstVisitedDate;
}
public void setFirstVisitedDate(Date firstVisitedDate) {
this.firstVisitedDate = firstVisitedDate;
}
public Integer getVisitedNum15() {
return visitedNum15;
}
public void setVisitedNum15(Integer visitedNum15) {
this.visitedNum15 = visitedNum15;
}
public Integer getVisitedNum30() {
return visitedNum30;
}
public void setVisitedNum30(Integer visitedNum30) {
this.visitedNum30 = visitedNum30;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public BigDecimal getAdjustedValue() {
return adjustedValue;
}
public void setAdjustedValue(BigDecimal adjustedValue) {
this.adjustedValue = adjustedValue;
}
public BigDecimal getAdjustedPst() {
return adjustedPst;
}
public void setAdjustedPst(BigDecimal adjustedPst) {
this.adjustedPst = adjustedPst;
}
public BigDecimal getAdjustedCumValue() {
return adjustedCumValue;
}
public void setAdjustedCumValue(BigDecimal adjustedCumValue) {
this.adjustedCumValue = adjustedCumValue;
}
public BigDecimal getAdjustedCumPst() {
return adjustedCumPst;
}
public void setAdjustedCumPst(BigDecimal adjustedCumPst) {
this.adjustedCumPst = adjustedCumPst;
}
public BigDecimal getAdjustedCumValueAbs() {
return adjustedCumValueAbs;
}
public void setAdjustedCumValueAbs(BigDecimal adjustedCumValueAbs) {
this.adjustedCumValueAbs = adjustedCumValueAbs;
}
public BigDecimal getAdjustedCumPstAbs() {
return adjustedCumPstAbs;
}
public void setAdjustedCumPstAbs(BigDecimal adjustedCumPstAbs) {
this.adjustedCumPstAbs = adjustedCumPstAbs;
}
public BigDecimal getAdjustedCumNum() {
return adjustedCumNum;
}
public void setAdjustedCumNum(BigDecimal adjustedCumNum) {
this.adjustedCumNum = adjustedCumNum;
}
public BigDecimal getPriceTotalIn() {
return priceTotalIn;
}
public void setPriceTotalIn(BigDecimal priceTotalIn) {
this.priceTotalIn = priceTotalIn;
}
public BigDecimal getPriceTotalOut() {
return priceTotalOut;
}
public void setPriceTotalOut(BigDecimal priceTotalOut) {
this.priceTotalOut = priceTotalOut;
}
public Date getPriceDateIn() {
return priceDateIn;
}
public void setPriceDateIn(Date priceDateIn) {
this.priceDateIn = priceDateIn;
}
public Date getPriceDateOut() {
return priceDateOut;
}
public void setPriceDateOut(Date priceDateOut) {
this.priceDateOut = priceDateOut;
}
public String getOrigin() {
return origin;
}
public void setOrigin(String origin) {
this.origin = origin;
}
public String getUrlHouseholds() {
return urlHouseholds;
}
public void setUrlHouseholds(String urlHouseholds) {
this.urlHouseholds = urlHouseholds;
}
public String getUrlProjects() {
return urlProjects;
}
public void setUrlProjects(String urlProjects) {
this.urlProjects = urlProjects;
}
public String getCaseName() {
return caseName;
}
public void setCaseName(String caseName) {
this.caseName = caseName;
}
public Integer getCaseType() {
return caseType;
}
public void setCaseType(Integer caseType) {
this.caseType = caseType;
}
public BigDecimal getRentPrice_1() {
return rentPrice_1;
}
public void setRentPrice_1(BigDecimal rentPrice_1) {
this.rentPrice_1 = rentPrice_1;
}
public BigDecimal getRange() {
return range;
}
public void setRange(BigDecimal range) {
this.range = range;
}
public Integer getRangeFlag() {
return rangeFlag;
}
public void setRangeFlag(Integer rangeFlag) {
this.rangeFlag = rangeFlag;
}
public BigDecimal getRentPrice() {
return rentPrice;
}
public void setRentPrice(BigDecimal rentPrice) {
this.rentPrice = rentPrice;
}
public BigDecimal getEntireRentRatio() {
return entireRentRatio;
}
public void setEntireRentRatio(BigDecimal entireRentRatio) {
this.entireRentRatio = entireRentRatio;
}
public BigDecimal getShareRentRatio() {
return shareRentRatio;
}
public void setShareRentRatio(BigDecimal shareRentRatio) {
this.shareRentRatio = shareRentRatio;
}
}

View File

@ -0,0 +1,26 @@
package com.ruoyi.project.data.cases.mapper.sync;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.ruoyi.project.data.cases.domain.OriginalResidenceRentOpeningCase;
import org.apache.ibatis.annotations.Param;
/**
* @author lihe
*/
@DS("calc")
public interface SyncOriginalResidenceRentAggregationCaseMapper {
/**
* 创建挂牌案例表
* @param yearMonth
*/
int createTable(@Param("yearMonth") Integer yearMonth);
/**
*
* @param originalResidenceRentOpeningCase
* @return
*/
int insert(OriginalResidenceRentOpeningCase originalResidenceRentOpeningCase);
}

View File

@ -51,8 +51,8 @@ public class OriginalResidenceRentClosingCaseServiceImpl implements IOriginalRes
Integer computeTableRoute = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
calendar.get(Calendar.MONTH) + 1));
targetTableRoute = 202005;
computeTableRoute = 202007;
// targetTableRoute = 202005;
// computeTableRoute = 202007;
prepare(computeTableRoute);
List<OriginalResidenceRentClosingCase> list =

View File

@ -117,7 +117,7 @@ public class UltimateOfficeBasePriceController extends BaseController {
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
String operName = loginUser.getUsername();
String message = officeBasePriceUltimateService.batchImport(yearMonth, officeBasePriceUltimates, operName);
return AjaxResult.success(message);
return AjaxResult.success("");
}
}

View File

@ -80,7 +80,7 @@ public class UltimateOfficeBasePrice extends BaseEntity {
// @Excel(name = "状态")
private Boolean status;
@Excel(name = "是否标准楼栋")
private Boolean isStandardBuilding;
private Boolean standardBuilding;
// @Excel(name = "更改价格说明")
private String adjustPriceComment;
/**
@ -353,11 +353,11 @@ public class UltimateOfficeBasePrice extends BaseEntity {
}
public Boolean getStandardBuilding() {
return isStandardBuilding;
return standardBuilding;
}
public void setStandardBuilding(Boolean standardBuilding) {
isStandardBuilding = standardBuilding;
this.standardBuilding = standardBuilding;
}
public String getAdjustPriceComment() {

View File

@ -98,12 +98,27 @@ public interface UltimateOfficeBasePriceMapper {
*/
void initProcedure();
/**
* 备份价格表
*
* @param yearMonth
* @param operateDate
*/
void dumpTable(@Param("yearMonth") Integer yearMonth, @Param("operateDate") String operateDate);
/**
* @param yearMonth
* @return
*/
int prepareBachImport(@Param("yearMonth") Integer yearMonth);
/**
* 清空人工修正表
*
* @param yearMonth 表名
*/
void clearArtificialTable(@Param("yearMonth") Integer yearMonth);
/**
* 插入人工修正的办公基价
*

View File

@ -89,6 +89,12 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
Integer lastYearMonth = getLastYearMonth(yearMonth);
officeBasePriceUltimateMapper.initProcedure();
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
String operateDate = simpleDateFormat.format(calendar.getTime());
officeBasePriceUltimateMapper.dumpTable(yearMonth, operateDate);
officeBasePriceUltimateMapper.clearArtificialTable(yearMonth);
officeBasePriceUltimateMapper.prepareBachImport(yearMonth);
try {
@ -126,7 +132,7 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
sourceDataTable.addColumnMetadata("AreaCoff", java.sql.Types.DECIMAL);
sourceDataTable.addColumnMetadata("YearCoff", java.sql.Types.DECIMAL);
sourceDataTable.addColumnMetadata("BuildingCoff", java.sql.Types.DECIMAL);
sourceDataTable.addColumnMetadata("BuildingStd", java.sql.Types.NVARCHAR);
sourceDataTable.addColumnMetadata("BuildingStd", java.sql.Types.BIT);
sourceDataTable.addColumnMetadata("AdjEvd", java.sql.Types.NVARCHAR);
@ -184,7 +190,6 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
officeBasePriceUltimateMapper.initProcedure();
conn.close();
Calendar calendar = Calendar.getInstance();
int year = yearMonth / 100;
int month = yearMonth % 100;
calendar.set(year, month, 1);
@ -195,6 +200,7 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
after(yearMonth, lastYearMonth, valuePoint, lastValuePoint);
} catch (Exception e) {
log.error("办公导入异常", e);
e.printStackTrace();
}

View File

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

View File

@ -0,0 +1,154 @@
<?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.SyncOriginalResidenceRentAggregationCaseMapper">
<update id="createTable">
<bind name="targetTableName" value="'dbo.DW_HOUSINGCASE_RENT_COMM_' + yearMonth"/>
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
drop table ${targetTableName};
create TABLE ${targetTableName}
(
ID int NOT NULL IDENTITY(1, 1),
HouseholdsID_SRC nvarchar (64) NOT null primary key,
ProjectID_SRC nvarchar (64) NOT NULL,
ProjectID bigint NULL,
BuildingID bigint NULL,
RentType tinyint NULL,
Room tinyint NULL,
Hall tinyint NULL,
Bashroom tinyint NULL,
Area decimal (18, 2) NULL,
Towards nvarchar (64) NULL,
UpperFloorSum nvarchar (32) NULL,
UpperFloorNum nvarchar (32) NULL,
Elevator tinyint NULL,
Decoration nvarchar (64) NULL,
Year int NULL,
AreaCoff decimal (7, 4) NULL,
TowardsCoff decimal (7, 4) NULL,
FloorCoff decimal (7, 4) NULL,
DecorationRng int NULL,
YearCoff decimal (7, 4) NULL,
BuildingCoff decimal (7, 4) NULL,
RoomTypeCoff decimal (7, 4) NULL,
PriceTotal decimal (18, 2) NOT NULL,
PriceUnit decimal (18, 2) NOT NULL,
PriceScatterRent decimal (18, 2) NULL,
PriceEntireRent decimal (18, 2) NULL,
PriceShareRent0 decimal (18, 2) NULL,
PriceShareRent decimal (18, 2) NULL,
Visited_Num int NULL,
First_Visit_Time date NULL,
Visited_Num_15 int NULL,
Visited_Num_30 int NULL,
Status tinyint NULL,
AdjustedValue decimal (18, 2) NULL,
AdjustedPst decimal (18, 6) NULL,
AdjustedCumValue decimal (18, 2) NULL,
AdjustedCumPst decimal (18, 6) NULL,
AdjustedCumValueAbs decimal (18, 2) NULL,
AdjustedCumPstAbs decimal (18, 6) NULL,
AdjustedCumNum int NULL,
PriceTotalIn decimal (18, 2) NULL,
PriceTotalOut decimal (18, 2) NULL,
PriceDateIn date NULL,
PriceDateOut date NULL,
Origin nvarchar (64) NULL,
UrlHouseholds nvarchar (max) NULL,
UrlProjects nvarchar (max) NULL,
CaseName nvarchar (1024) NULL,
CaseType tinyint NULL,
RentPrice_1 decimal (18, 2) NULL,
Range decimal (18, 4) NULL,
RangeFlag int NULL,
RentPrice decimal (18, 2) NULL,
EntireRentRatio decimal (18, 6) NULL,
ShareRentRatio decimal (18, 6) NULL
)
</update>
<insert id="insert" parameterType="com.ruoyi.project.data.cases.domain.OriginalResidenceSaleOpeningCase">
insert into dbo.DW_HOUSINGCASE_RENT_COMM_${yearMonth}
(
HouseholdsID_SRC
, ProjectID_SRC
, ProjectID
, BuildingID
, RentType
, Room
, Hall
, Bashroom
, Area
, Towards
, UpperFloorSum
, UpperFloorNum
, Elevator
, Decoration
, Year
, AreaCoff
, TowardsCoff
, FloorCoff
, DecorationRng
, YearCoff
, BuildingCoff
, RoomTypeCoff
, PriceTotal
, PriceUnit
, PriceScatterRent
, PriceEntireRent
, PriceShareRent0
, PriceShareRent
, Visited_Num
, First_Visit_Time
, Visited_Num_15
, Visited_Num_30
, Status
, AdjustedValue
, AdjustedPst
, AdjustedCumValue
, AdjustedCumPst
, AdjustedCumValueAbs
, AdjustedCumPstAbs
, AdjustedCumNum
, PriceTotalIn
, PriceTotalOut
, PriceDateIn
, PriceDateOut
, Origin
, UrlHouseholds
, UrlProjects
, CaseName
, CaseType
, RentPrice_1
, Range
, RangeFlag
, RentPrice
, EntireRentRatio
, ShareRentRatio
) values
(
#{caseLianJiaId},
#{caseLianJiaCommunityId},
#{caseTitle},
#{caseApartmentLayout},
#{caseArea},
#{caseToward},
#{caseStorey},
#{caseLastDeal,jdbcType=DATE},
#{caseElevator},
#{caseDecoration},
#{caseYear},
#{caseAddress},
#{casePrice},
#{caseCommunityName},
#{caseVisitedNum},
#{caseFirstVisitTime,jdbcType=DATE},
#{caseVisitedNum15},
#{caseVisitedNum30},
#{caseUrl},
#{caseCommunityUrl},
#{caseGetDate,jdbcType=DATE}
)
</insert>
</mapper>

View File

@ -18,7 +18,7 @@
<result property="mainPriceRentType" column="MainPriceRentType"/>
<result property="updateDate" column="ModifyDate"/>
<result property="status" column="Status"/>
<result property="isStandardBuilding" column="BuildingStd"/>
<result property="standardBuilding" column="BuildingStd"/>
<result property="adjustPriceComment" column="AdjEvd"/>
<result property="areaCoefficient" column="AreaCoff"/>
<result property="yearCoefficient" column="YearCoff"/>
@ -88,8 +88,8 @@
<if test="status != null">
AND a.STATUS = #{status}
</if>
<if test="isStandardBuilding != null">
AND a.BuildingStd = #{isStandardBuilding}
<if test="standardBuilding != null">
AND a.BuildingStd = #{standardBuilding}
</if>
<if test="nameOrAddress != null">
AND (
@ -114,8 +114,8 @@
<if test="status != null">
AND a.STATUS = #{status}
</if>
<if test="isStandardBuilding != null">
AND a.BuildingStd = #{isStandardBuilding}
<if test="standardBuilding != null">
AND a.BuildingStd = #{standardBuilding}
</if>
<if test="nameOrAddress != null">
AND (
@ -203,7 +203,7 @@
,MainPriceType as mainPriceType
,MainPriceRentType as mainPriceRentType
,Status as status
,BuildingStd as isStandardBuilding
,BuildingStd as standardBuilding
,AdjEvd as adjustPriceComment
,${yearMonth} as yearMonth
from ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}
@ -221,7 +221,7 @@
,MainPriceType as mainPriceType
,MainPriceRentType as mainPriceRentType
,Status as status
,BuildingStd as isStandardBuilding
,BuildingStd as standardBuilding
,AdjEvd as adjustPriceComment
,${yearMonth} as yearMonth
FROM dbo.ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}
@ -326,4 +326,11 @@
from @table;
end;
</update>
<update id="dumpTable">
select * into ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}_${operateDate}_bak from
ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth};
</update>
<update id="clearArtificialTable">
truncate table DWA_PROJECTBASEPRICE_OFFICE_MANU_${yearMonth}
</update>
</mapper>

View File

@ -272,8 +272,8 @@ select row_number() over( order by newid() ) id
't5'
end as MainPriceRentType
, cast(getdate() as date) ModifyDate
, cast(1 as nvarchar) Status
, a.BuildingStd
, cast(1 as bit) as Status
, cast(a.BuildingStd as bit) as BuildingStd
, cast(null as nvarchar(1000)) as AdjEvd
, c.MainPrice as MainPrice_1
, c.MainPriceRent as MainPriceRent_1