数据平台前后端分离
This commit is contained in:
@ -76,15 +76,15 @@ public class UltimateOfficeBasePriceController extends BaseController {
|
||||
return AjaxResult.success(officeBasePriceUltimateService.getById(yearMonth, id));
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 修改办公基价
|
||||
// */
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
// @Log(title = "办公基价", businessType = BusinessType.UPDATE)
|
||||
// @PutMapping
|
||||
// public AjaxResult edit(@RequestBody UltimateOfficeBasePrice officeBasePriceUltimate) {
|
||||
// return toAjax(officeBasePriceUltimateService.updateOfficeBasePriceUltimate(officeBasePriceUltimate));
|
||||
// }
|
||||
/**
|
||||
* 修改办公基价
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:user:edit')")
|
||||
@Log(title = "办公基价", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody UltimateOfficeBasePrice officeBasePriceUltimate) {
|
||||
return toAjax(officeBasePriceUltimateService.update(officeBasePriceUltimate));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出办公基价列表
|
||||
|
@ -0,0 +1,67 @@
|
||||
package com.ruoyi.project.data.price.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class OfficeBasePriceModifyModel {
|
||||
private Integer id;
|
||||
private Integer yearMonth;
|
||||
private BigDecimal mainPrice;
|
||||
private BigDecimal mainPricePst;
|
||||
private BigDecimal mainPriceRent;
|
||||
private BigDecimal mainPriceRentPst;
|
||||
private String comment;
|
||||
|
||||
public OfficeBasePriceModifyModel(Integer id, Integer yearMonth) {
|
||||
this.id = id;
|
||||
this.yearMonth = yearMonth;
|
||||
}
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Integer getYearMonth() {
|
||||
return yearMonth;
|
||||
}
|
||||
|
||||
public BigDecimal getMainPrice() {
|
||||
return mainPrice;
|
||||
}
|
||||
|
||||
public void setMainPrice(BigDecimal mainPrice) {
|
||||
this.mainPrice = mainPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getMainPricePst() {
|
||||
return mainPricePst;
|
||||
}
|
||||
|
||||
public void setMainPricePst(BigDecimal mainPricePst) {
|
||||
this.mainPricePst = mainPricePst;
|
||||
}
|
||||
|
||||
public BigDecimal getMainPriceRent() {
|
||||
return mainPriceRent;
|
||||
}
|
||||
|
||||
public void setMainPriceRent(BigDecimal mainPriceRent) {
|
||||
this.mainPriceRent = mainPriceRent;
|
||||
}
|
||||
|
||||
public BigDecimal getMainPriceRentPst() {
|
||||
return mainPriceRentPst;
|
||||
}
|
||||
|
||||
public void setMainPriceRentPst(BigDecimal mainPriceRentPst) {
|
||||
this.mainPriceRentPst = mainPriceRentPst;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return comment;
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
this.comment = comment;
|
||||
}
|
||||
}
|
@ -34,13 +34,13 @@ public class UltimateOfficeBasePrice extends BaseEntity {
|
||||
private String communityAddress;
|
||||
@Excel(name = "楼栋地址")
|
||||
private String buildingAddress;
|
||||
@Excel(name = "楼栋地址")
|
||||
@Excel(name = "区域")
|
||||
private String countyName;
|
||||
@Excel(name = "板块地址")
|
||||
@Excel(name = "板块")
|
||||
private String blockName;
|
||||
@Excel(name = "街道地址")
|
||||
@Excel(name = "街道")
|
||||
private String streetName;
|
||||
@Excel(name = "环线地址")
|
||||
@Excel(name = "环线")
|
||||
private String loopName;
|
||||
@Excel(name = "建成年代")
|
||||
private Integer year;
|
||||
|
@ -5,6 +5,7 @@ import java.util.List;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.ruoyi.project.common.VueSelectModel;
|
||||
import com.ruoyi.project.data.price.domain.OfficeBasePriceModifyModel;
|
||||
import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice;
|
||||
|
||||
/**
|
||||
@ -21,7 +22,14 @@ public interface UltimateOfficeBasePriceMapper {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
UltimateOfficeBasePrice getById(Integer yearMonth, Integer id);
|
||||
UltimateOfficeBasePrice getById(Integer yearMonth, Integer lastYearMonth, Integer id);
|
||||
|
||||
/**
|
||||
* @param yearMonth
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
UltimateOfficeBasePrice getByRouteId(Integer yearMonth, Integer id);
|
||||
|
||||
/**
|
||||
* @param yearMonth
|
||||
@ -47,16 +55,12 @@ public interface UltimateOfficeBasePriceMapper {
|
||||
Integer getCount(UltimateOfficeBasePrice officeBasePriceUltimate);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
* 更新当期基价
|
||||
*
|
||||
* @param yearMonth
|
||||
* @param id
|
||||
* @param mainPrice
|
||||
* @param mainPriceRent
|
||||
* @param officeBasePriceModifyModel
|
||||
* @return
|
||||
*/
|
||||
int update(Integer yearMonth, Integer lastYearMonth, int id, BigDecimal mainPrice, BigDecimal mainPriceRent);
|
||||
|
||||
int updateBasePrice(OfficeBasePriceModifyModel officeBasePriceModifyModel);
|
||||
|
||||
/**
|
||||
* 年月
|
||||
@ -65,13 +69,4 @@ public interface UltimateOfficeBasePriceMapper {
|
||||
*/
|
||||
List<VueSelectModel> getYearMonthList();
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param yearMonth
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int copyCreate(Integer yearMonth, Integer id);
|
||||
|
||||
}
|
||||
|
@ -24,29 +24,27 @@ public interface IUltimateOfficeBasePriceService {
|
||||
int selectOfficeBasePriceUltimateListCount(UltimateOfficeBasePrice officeBasePriceUltimate);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
UltimateOfficeBasePrice getById(Integer yearMonth, Integer id);
|
||||
|
||||
// /**
|
||||
// *
|
||||
// * @param officeBasePriceUltimate
|
||||
// * @return
|
||||
// */
|
||||
// int updateOfficeBasePriceUltimate(UltimateOfficeBasePrice officeBasePriceUltimate);
|
||||
/**
|
||||
* 可能修改当期的价格、也可能修改往期
|
||||
*
|
||||
* @param officeBasePriceUltimate
|
||||
* @return
|
||||
*/
|
||||
int update(UltimateOfficeBasePrice officeBasePriceUltimate);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param officeBasePriceUltimates
|
||||
* @param operName
|
||||
* @return
|
||||
*/
|
||||
String batchImport(Integer yearMonth, List<UltimateOfficeBasePrice> officeBasePriceUltimates,String operName);
|
||||
String batchImport(Integer yearMonth, List<UltimateOfficeBasePrice> officeBasePriceUltimates, String operName);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<VueSelectModel> getYearMonthList();
|
||||
|
@ -7,6 +7,7 @@ import java.util.List;
|
||||
import com.ruoyi.common.exception.CustomException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.project.common.VueSelectModel;
|
||||
import com.ruoyi.project.data.price.domain.OfficeBasePriceModifyModel;
|
||||
import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice;
|
||||
import com.ruoyi.project.data.price.mapper.UltimateOfficeBasePriceMapper;
|
||||
import com.ruoyi.project.data.price.service.IUltimateOfficeBasePriceService;
|
||||
@ -56,7 +57,8 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
|
||||
|
||||
@Override
|
||||
public UltimateOfficeBasePrice getById(Integer yearMonth, Integer id) {
|
||||
return officeBasePriceUltimateMapper.getById(yearMonth, id);
|
||||
Integer lastYearMonth = getLastYearMonth(yearMonth);
|
||||
return officeBasePriceUltimateMapper.getById(yearMonth, lastYearMonth, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -72,32 +74,29 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
Integer lastYearMonth = getLastYearMonth(yearMonth);
|
||||
|
||||
for (UltimateOfficeBasePrice officeBasePriceUltimate : officeBasePriceUltimates) {
|
||||
for (UltimateOfficeBasePrice inputModel : officeBasePriceUltimates) {
|
||||
try {
|
||||
// 验证是否存在这个用户
|
||||
UltimateOfficeBasePrice officeBasePriceUltimateInDb =
|
||||
officeBasePriceUltimateMapper.getById(yearMonth, officeBasePriceUltimate.getId());
|
||||
UltimateOfficeBasePrice currentUltimateOfficeBasePrice =
|
||||
officeBasePriceUltimateMapper.getById(yearMonth, lastYearMonth,
|
||||
inputModel.getId());
|
||||
UltimateOfficeBasePrice lastUltimateOfficeBasePrice =
|
||||
officeBasePriceUltimateMapper.getByBuildingId(lastYearMonth,
|
||||
officeBasePriceUltimate.getBuildingId());
|
||||
if (!StringUtils.isNotNull(officeBasePriceUltimateInDb)) {
|
||||
if (officeBasePriceUltimateInDb.getMainPrice().subtract(officeBasePriceUltimate.getMainPrice()).compareTo(BigDecimal.ZERO) != 0
|
||||
|| officeBasePriceUltimateInDb.getMainPriceRent().subtract(officeBasePriceUltimate.getMainPriceRent()).compareTo(BigDecimal.ZERO) != 0) {
|
||||
int id = officeBasePriceUltimateMapper.copyCreate(yearMonth, officeBasePriceUltimate.getId());
|
||||
|
||||
officeBasePriceUltimateMapper.update(yearMonth, lastYearMonth, id,
|
||||
officeBasePriceUltimate.getMainPrice(),
|
||||
officeBasePriceUltimate.getMainPriceRent());
|
||||
inputModel.getBuildingId());
|
||||
if (!StringUtils.isNotNull(currentUltimateOfficeBasePrice)) {
|
||||
if (currentUltimateOfficeBasePrice.getMainPrice().subtract(inputModel.getMainPrice()).compareTo(BigDecimal.ZERO) != 0
|
||||
|| currentUltimateOfficeBasePrice.getMainPriceRent().subtract(inputModel.getMainPriceRent()).compareTo(BigDecimal.ZERO) != 0) {
|
||||
updateBasePrice(inputModel, currentUltimateOfficeBasePrice, lastUltimateOfficeBasePrice);
|
||||
successNum++;
|
||||
successMsg.append("<br/>" + successNum + "、ID= " + officeBasePriceUltimate.getId() + " 更新成功");
|
||||
successMsg.append("<br/>" + successNum + "、ID= " + inputModel.getId() + " 更新成功");
|
||||
}
|
||||
} else {
|
||||
failureNum++;
|
||||
failureMsg.append("<br/>" + failureNum + "、ID= " + officeBasePriceUltimate.getId() + " 失败");
|
||||
failureMsg.append("<br/>" + failureNum + "、ID= " + inputModel.getId() + " 失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
failureNum++;
|
||||
String msg = "<br/>" + failureNum + "、ID= " + officeBasePriceUltimate.getId() + " 导入失败:";
|
||||
String msg = "<br/>" + failureNum + "、ID= " + inputModel.getId() + " 导入失败:";
|
||||
failureMsg.append(msg + e.getMessage());
|
||||
log.error(msg, e);
|
||||
}
|
||||
@ -115,4 +114,78 @@ public class UltimateOfficeBasePriceServiceImpl implements IUltimateOfficeBasePr
|
||||
public List<VueSelectModel> getYearMonthList() {
|
||||
return officeBasePriceUltimateMapper.getYearMonthList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param officeBasePriceUltimate
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int update(UltimateOfficeBasePrice officeBasePriceUltimate) {
|
||||
// 当期价格
|
||||
Integer lastYearMonth = getLastYearMonth(officeBasePriceUltimate.getYearMonth());
|
||||
UltimateOfficeBasePrice ultimateOfficeBasePrice =
|
||||
officeBasePriceUltimateMapper.getByRouteId(officeBasePriceUltimate.getYearMonth(),
|
||||
officeBasePriceUltimate.getId());
|
||||
// 上期价格
|
||||
UltimateOfficeBasePrice lastUltimateOfficeBasePrice =
|
||||
officeBasePriceUltimateMapper.getByBuildingId(lastYearMonth,
|
||||
officeBasePriceUltimate.getBuildingId());
|
||||
|
||||
updateBasePrice(officeBasePriceUltimate, ultimateOfficeBasePrice, lastUltimateOfficeBasePrice);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 基价更新
|
||||
*
|
||||
* @param inputModel
|
||||
* @param currentUltimateOfficeBasePrice
|
||||
* @param lastUltimateOfficeBasePrice
|
||||
*/
|
||||
private void updateBasePrice(UltimateOfficeBasePrice inputModel,
|
||||
UltimateOfficeBasePrice currentUltimateOfficeBasePrice,
|
||||
UltimateOfficeBasePrice lastUltimateOfficeBasePrice) {
|
||||
// 上期价格比较
|
||||
if (StringUtils.isNotNull(lastUltimateOfficeBasePrice) &&
|
||||
StringUtils.isNotNull(lastUltimateOfficeBasePrice.getMainPrice()) &&
|
||||
StringUtils.isNotNull(lastUltimateOfficeBasePrice.getMainPriceRent()) &&
|
||||
(lastUltimateOfficeBasePrice.getMainPrice().compareTo(inputModel.getMainPrice_1()) != 0 ||
|
||||
lastUltimateOfficeBasePrice.getMainPriceRent().compareTo(inputModel.getMainPriceRent_1()) != 0)) {
|
||||
OfficeBasePriceModifyModel officeBasePriceModifyModel =
|
||||
new OfficeBasePriceModifyModel(lastUltimateOfficeBasePrice.getId(),
|
||||
lastUltimateOfficeBasePrice.getYearMonth());
|
||||
officeBasePriceModifyModel.setMainPrice(inputModel.getMainPrice_1());
|
||||
officeBasePriceModifyModel.setMainPricePst(lastUltimateOfficeBasePrice.getMainPricePst());
|
||||
officeBasePriceModifyModel.setMainPriceRent(inputModel.getMainPriceRent_1());
|
||||
officeBasePriceModifyModel.setMainPriceRentPst(lastUltimateOfficeBasePrice.getMainPriceRentPst());
|
||||
// 上期价格
|
||||
officeBasePriceUltimateMapper.updateBasePrice(officeBasePriceModifyModel);
|
||||
}
|
||||
|
||||
// 本期价格比较
|
||||
if (StringUtils.isNotNull(currentUltimateOfficeBasePrice) &&
|
||||
StringUtils.isNotNull(currentUltimateOfficeBasePrice.getMainPrice()) &&
|
||||
StringUtils.isNotNull(currentUltimateOfficeBasePrice.getMainPriceRent()) &&
|
||||
(currentUltimateOfficeBasePrice.getMainPrice().compareTo(inputModel.getMainPrice()) != 0 ||
|
||||
currentUltimateOfficeBasePrice.getMainPriceRent().compareTo(inputModel.getMainPriceRent()) != 0)) {
|
||||
OfficeBasePriceModifyModel officeBasePriceModifyModel = new OfficeBasePriceModifyModel(inputModel.getId()
|
||||
, inputModel.getYearMonth());
|
||||
officeBasePriceModifyModel.setMainPrice(inputModel.getMainPrice());
|
||||
BigDecimal mainPricePst =
|
||||
inputModel.getMainPrice().divide(lastUltimateOfficeBasePrice.getMainPrice(), 4);
|
||||
officeBasePriceModifyModel.setMainPricePst(mainPricePst);
|
||||
officeBasePriceModifyModel.setMainPriceRent(inputModel.getMainPriceRent());
|
||||
BigDecimal mainPriceRentPst =
|
||||
inputModel.getMainPriceRent().divide(lastUltimateOfficeBasePrice.getMainPriceRent(),
|
||||
4);
|
||||
officeBasePriceModifyModel.setMainPriceRentPst(mainPriceRentPst);
|
||||
if(StringUtils.isNotNull(inputModel.getAdjustPriceComment()))
|
||||
officeBasePriceModifyModel.setComment(inputModel.getAdjustPriceComment());
|
||||
// 上期价格
|
||||
officeBasePriceUltimateMapper.updateBasePrice(officeBasePriceModifyModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,16 +33,13 @@ spring:
|
||||
testOnReturn: false
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 慢SQL记录
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
filters: stat,wall
|
||||
wall:
|
||||
multiStatementAllow: true
|
||||
stat:
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
primary: master
|
||||
datasource:
|
||||
# 主库数据源
|
||||
|
@ -23,7 +23,6 @@
|
||||
<result property="areaCoefficient" column="AreaCoff"/>
|
||||
<result property="yearCoefficient" column="YearCoff"/>
|
||||
<result property="buildingCoefficient" column="BuildingCoff"/>
|
||||
|
||||
<result property="communityName" column="ProjectName"/>
|
||||
<result property="communityAddress" column="ProjectAddr"/>
|
||||
<result property="buildingAddress" column="BuildingAddr"/>
|
||||
@ -41,7 +40,7 @@
|
||||
<result property="mainPriceRent_1" column="mainPriceRent_1"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOfficeBasePriceUltimateVo">
|
||||
<sql id="getById">
|
||||
SELECT a.ID
|
||||
,a.BuildingID_P
|
||||
,a.ProjectID_P
|
||||
@ -77,68 +76,81 @@
|
||||
FROM ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} a
|
||||
left join DIM_OFFICE_PROJECT_BUILDING_201909 b on a.BuildingID_P=b.BuildingID_P
|
||||
left join ODS_OFFICE_BUILDING_PRICE_INFO_${lastYearMonth} c on a.BuildingID_P = c.BuildingID_P
|
||||
WHERE b.EffDate <![CDATA[ <= ]]> getdate() AND b.ExpirDate <![CDATA[ > ]]> getdate() AND A.STATUS=1 AND
|
||||
c.Status=1
|
||||
WHERE b.EffDate <![CDATA[ <= ]]> getdate() AND b.ExpirDate <![CDATA[ > ]]> getdate() AND c.Status=1
|
||||
</sql>
|
||||
|
||||
<select id="getCount" parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice" resultType="int">
|
||||
select count(1) FROM ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} a
|
||||
left join DIM_OFFICE_PROJECT_BUILDING_201909 b on a.BuildingID_P=b.BuildingID_P
|
||||
left join ODS_OFFICE_BUILDING_PRICE_INFO_${lastYearMonth} c on a.BuildingID_P = c.BuildingID_P
|
||||
WHERE b.EffDate <![CDATA[ <= ]]> getdate() AND b.ExpirDate <![CDATA[ > ]]> getdate() AND A.STATUS=1 AND
|
||||
c.Status=1
|
||||
<where>
|
||||
<if test="communityId != null">
|
||||
AND a.PROJECTID_P = #{communityId}
|
||||
</if>
|
||||
<if test="buildingId != null">
|
||||
AND a.BUILDINGID_P = #{buildingId}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND a.STATUS = #{status}
|
||||
</if>
|
||||
</where>
|
||||
WHERE b.EffDate <![CDATA[ <= ]]> getdate() AND b.ExpirDate <![CDATA[ > ]]> getdate() AND c.Status=1
|
||||
<if test="communityId != null">
|
||||
AND a.PROJECTID_P = #{communityId}
|
||||
</if>
|
||||
<if test="buildingId != null">
|
||||
AND a.BUILDINGID_P = #{buildingId}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND a.STATUS = #{status}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getList" parameterType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice"
|
||||
resultMap="OfficeBasePriceUltimateResult">
|
||||
<include refid="selectOfficeBasePriceUltimateVo"/>
|
||||
<where>
|
||||
<if test="communityId != null">
|
||||
AND a.PROJECTID_P = #{communityId}
|
||||
</if>
|
||||
<if test="buildingId != null">
|
||||
AND a.BUILDINGID_P = #{buildingId}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND a.STATUS = #{status}
|
||||
</if>
|
||||
</where>
|
||||
<include refid="getById"/>
|
||||
<if test="communityId != null">
|
||||
AND a.PROJECTID_P = #{communityId}
|
||||
</if>
|
||||
<if test="buildingId != null">
|
||||
AND a.BUILDINGID_P = #{buildingId}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND a.STATUS = #{status}
|
||||
</if>
|
||||
order by a.BUILDINGID_P ASC,a.ID DESC OFFSET #{pageIndex} rows fetch next #{pageSize} rows only;
|
||||
</select>
|
||||
|
||||
<select id="getById" parameterType="String" resultMap="OfficeBasePriceUltimateResult">
|
||||
<include refid="selectOfficeBasePriceUltimateVo"/>
|
||||
where id = #{id}
|
||||
<select id="getById" resultMap="OfficeBasePriceUltimateResult">
|
||||
<include refid="getById"/>
|
||||
<if test="id != null">
|
||||
AND a.id=#{id}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="copyCreate">
|
||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into
|
||||
dbo.ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}(BuildingID,UnifiedID,ProjectID,BuildingID_P,ProjectID_P,MainPrice,MainPriceRent,MainPricePst,MainPriceRentPst,MainPriceType,MainPriceRentType,ModifyDate,Status,BuildingStd,AdjEvd)
|
||||
select BuildingID,UnifiedID,ProjectID,BuildingID_P,ProjectID_P,MainPrice,MainPriceRent,MainPricePst,MainPriceRentPst,MainPriceType,MainPriceRentType,ModifyDate,0,BuildingStd,AdjEvd
|
||||
from ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}
|
||||
where id=#{id}
|
||||
</insert>
|
||||
<!-- 更新 -->
|
||||
<update id="update">
|
||||
update a set ModifyDate=getdate(), mainPrice=#{mainPrice}, mainPriceRent=#{mainPriceRent},
|
||||
mainPricePst = #{mainPrice} * 1.0 / b.mainPrice, mainPriceRentPst = #{mainPriceRentPst} * 1.0 / b.mainPriceRentPst
|
||||
from ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} a join ODS_OFFICE_BUILDING_PRICE_INFO_${lastYearMonth} b on
|
||||
a.BuildingID_p=b.BuildingID_P
|
||||
where a.Status=1 and b.Status=1 and a.id=#{id}
|
||||
<!-- 更新基价 -->
|
||||
<update id="updateBasePrice" parameterType="com.ruoyi.project.data.price.domain.OfficeBasePriceModifyModel">
|
||||
update ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} set Status=0 where id=#{id};
|
||||
insert into ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}(BuildingID
|
||||
,UnifiedID
|
||||
,ProjectID
|
||||
,BuildingID_P
|
||||
,ProjectID_P
|
||||
,MainPrice
|
||||
,MainPriceRent
|
||||
,MainPricePst
|
||||
,MainPriceRentPst
|
||||
,MainPriceType
|
||||
,MainPriceRentType
|
||||
,ModifyDate
|
||||
,Status
|
||||
,BuildingStd
|
||||
,AdjEvd)
|
||||
select BuildingID
|
||||
,UnifiedID
|
||||
,ProjectID
|
||||
,BuildingID_P
|
||||
,ProjectID_P
|
||||
,#{mainPrice}
|
||||
,#{mainPriceRent}
|
||||
,#{mainPricePst}
|
||||
,#{mainPriceRentPst}
|
||||
,MainPriceType
|
||||
,MainPriceRentType
|
||||
,getdate()
|
||||
,1
|
||||
,BuildingStd
|
||||
,#{comment}
|
||||
from ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth} where id=#{id};
|
||||
</update>
|
||||
|
||||
<!-- 获取表名 -->
|
||||
@ -149,9 +161,39 @@
|
||||
order by cast(right(name,6) as int) desc
|
||||
</select>
|
||||
<!-- -->
|
||||
<select id="getByBuildingId" resultType="com.ruoyi.project.data.price.controller.UltimateOfficeBasePriceController">
|
||||
select id,MainPrice,MainPriceRent
|
||||
<select id="getByBuildingId" resultType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice">
|
||||
select ID
|
||||
,BuildingID_P as buildingId
|
||||
,ProjectID_P as communityId
|
||||
,MainPrice as mainPrice
|
||||
,MainPriceRent as mainPriceRent
|
||||
,MainPricePst as mainPricePst
|
||||
,MainPriceRentPst as mainPriceRentPst
|
||||
,MainPriceType as mainPriceType
|
||||
,MainPriceRentType as mainPriceRentType
|
||||
,Status as status
|
||||
,BuildingStd as isStandardBuilding
|
||||
,AdjEvd as adjustPriceComment
|
||||
,${yearMonth} as yearMonth
|
||||
from ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}
|
||||
where BuildingID_P=#{buildingI}
|
||||
where BuildingID_P=#{buildingId} AND status= 1
|
||||
</select>
|
||||
<!-- 查询价格 -->
|
||||
<select id="getByRouteId" resultType="com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice">
|
||||
SELECT ID
|
||||
,BuildingID_P as buildingId
|
||||
,ProjectID_P as communityId
|
||||
,MainPrice as mainPrice
|
||||
,MainPriceRent as mainPriceRent
|
||||
,MainPricePst as mainPricePst
|
||||
,MainPriceRentPst as mainPriceRentPst
|
||||
,MainPriceType as mainPriceType
|
||||
,MainPriceRentType as mainPriceRentType
|
||||
,Status as status
|
||||
,BuildingStd as isStandardBuilding
|
||||
,AdjEvd as adjustPriceComment
|
||||
,${yearMonth} as yearMonth
|
||||
FROM dbo.ODS_OFFICE_BUILDING_PRICE_INFO_${yearMonth}
|
||||
WHERE ID=#{id}
|
||||
</select>
|
||||
</mapper>
|
Reference in New Issue
Block a user