Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yichengstreet-be
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yichengstreet
yichengstreet-be
Commits
e752ea69
Commit
e752ea69
authored
Jul 25, 2025
by
lixuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 房源
parent
f3ba8231
Pipeline
#145501
failed with stages
Changes
10
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
252 additions
and
70 deletions
+252
-70
HouseResourceBusinessEntityInfoMappingController.java
...use/HouseResourceBusinessEntityInfoMappingController.java
+52
-0
HouseResourceController.java
...m/ruoyi/web/controller/house/HouseResourceController.java
+2
-2
HouseResourceBusinessEntityInfoMapping.java
.../domain/house/HouseResourceBusinessEntityInfoMapping.java
+13
-0
AssociationBusinessEntityHouseResourceDto.java
...n/house/vo/AssociationBusinessEntityHouseResourceDto.java
+1
-1
HouseResourceBusinessEntityInfoMappingMapper.java
...r/house/HouseResourceBusinessEntityInfoMappingMapper.java
+16
-0
HouseResourceMapper.java
...va/com/ruoyi/system/mapper/house/HouseResourceMapper.java
+2
-0
HouseResourceService.java
.../com/ruoyi/system/service/house/HouseResourceService.java
+1
-2
HouseResourceServiceImpl.java
...i/system/service/house/impl/HouseResourceServiceImpl.java
+76
-19
HouseResourceBusinessEntityInfoMappingMapper.xml
...er/house/HouseResourceBusinessEntityInfoMappingMapper.xml
+27
-0
HouseResourceMapper.xml
...m/src/main/resources/mapper/house/HouseResourceMapper.xml
+62
-46
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/controller/house/HouseResourceBusinessEntityInfoMappingController.java
0 → 100644
View file @
e752ea69
package
com
.
ruoyi
.
web
.
controller
.
house
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.system.domain.house.BusinessEntityInfo
;
import
com.ruoyi.system.domain.house.HouseResourceBusinessEntityInfoMapping
;
import
com.ruoyi.system.mapper.house.BusinessEntityInfoMapper
;
import
com.ruoyi.system.mapper.house.HouseResourceBusinessEntityInfoMappingMapper
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
import
java.util.stream.Collectors
;
@RestController
@RequestMapping
(
"/api/houseResourceBusinessEntityInfoMapping"
)
public
class
HouseResourceBusinessEntityInfoMappingController
{
private
final
HouseResourceBusinessEntityInfoMappingMapper
houseResourceBusinessEntityInfoMappingMapper
;
private
final
BusinessEntityInfoMapper
businessEntityInfoMapper
;
public
HouseResourceBusinessEntityInfoMappingController
(
HouseResourceBusinessEntityInfoMappingMapper
houseResourceBusinessEntityInfoMappingMapper
,
BusinessEntityInfoMapper
businessEntityInfoMapper
)
{
this
.
houseResourceBusinessEntityInfoMappingMapper
=
houseResourceBusinessEntityInfoMappingMapper
;
this
.
businessEntityInfoMapper
=
businessEntityInfoMapper
;
}
@PostMapping
(
"/start"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
AjaxResult
start
()
{
List
<
BusinessEntityInfo
>
businessEntityInfos
=
businessEntityInfoMapper
.
selectAllBusinessEntityInfos
();
Map
<
String
,
List
<
BusinessEntityInfo
>>
group
=
businessEntityInfos
.
stream
().
collect
(
Collectors
.
groupingBy
(
BusinessEntityInfo:
:
getHouseResourceId
));
group
.
forEach
((
houseResourceId
,
businessEntityInfoList
)
->
{
System
.
out
.
println
(
"当前处理houseId = "
+
houseResourceId
);
if
(!
CollectionUtils
.
isEmpty
(
businessEntityInfoList
))
{
for
(
BusinessEntityInfo
businessEntityInfo
:
businessEntityInfoList
)
{
HouseResourceBusinessEntityInfoMapping
houseResourceBusinessEntityInfoMapping
=
new
HouseResourceBusinessEntityInfoMapping
();
houseResourceBusinessEntityInfoMapping
.
setId
(
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
));
houseResourceBusinessEntityInfoMapping
.
setHouseResourceId
(
houseResourceId
);
houseResourceBusinessEntityInfoMapping
.
setBusinessEntityInfoId
(
businessEntityInfo
.
getId
());
houseResourceBusinessEntityInfoMappingMapper
.
insert
(
houseResourceBusinessEntityInfoMapping
);
}
}
});
System
.
out
.
println
(
"数据处理完成"
);
return
AjaxResult
.
success
();
}
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/house/HouseResourceController.java
View file @
e752ea69
...
@@ -31,8 +31,8 @@ public class HouseResourceController {
...
@@ -31,8 +31,8 @@ public class HouseResourceController {
}
}
@GetMapping
@GetMapping
public
AjaxResult
query
HouseResourceById
(
@RequestParam
String
id
)
{
public
AjaxResult
get
HouseResourceById
(
@RequestParam
String
id
)
{
return
AjaxResult
.
success
(
houseResourceService
.
queryHouseResourceById
(
id
));
return
AjaxResult
.
success
(
houseResourceService
.
detail
(
id
));
}
}
// @PreAuthorize("@ss.hasPermi('system:house:edit')")
// @PreAuthorize("@ss.hasPermi('system:house:edit')")
...
...
ruoyi-system/src/main/java/com/ruoyi/system/domain/house/HouseResourceBusinessEntityInfoMapping.java
0 → 100644
View file @
e752ea69
package
com
.
ruoyi
.
system
.
domain
.
house
;
import
lombok.Data
;
@Data
public
class
HouseResourceBusinessEntityInfoMapping
{
private
String
id
;
private
String
houseResourceId
;
private
String
businessEntityInfoId
;
}
ruoyi-system/src/main/java/com/ruoyi/system/domain/house/vo/AssociationBusinessEntityHouseResourceDto.java
View file @
e752ea69
...
@@ -36,7 +36,7 @@ public class AssociationBusinessEntityHouseResourceDto {
...
@@ -36,7 +36,7 @@ public class AssociationBusinessEntityHouseResourceDto {
private
boolean
associationBusinessEntityFlag
;
private
boolean
associationBusinessEntityFlag
;
private
HouseResourcePage
houseResource
;
private
List
<
HouseResourcePage
>
houseResources
;
private
List
<
BusinessEntitySell
>
businessEntitySells
;
private
List
<
BusinessEntitySell
>
businessEntitySells
;
}
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/house/HouseResourceBusinessEntityInfoMappingMapper.java
0 → 100644
View file @
e752ea69
package
com
.
ruoyi
.
system
.
mapper
.
house
;
import
com.ruoyi.system.domain.house.HouseResourceBusinessEntityInfoMapping
;
import
java.util.List
;
public
interface
HouseResourceBusinessEntityInfoMappingMapper
{
void
insert
(
HouseResourceBusinessEntityInfoMapping
houseResourceBusinessEntityInfoMapping
);
void
deleteByHouseResourceIdBusinessEntityInfoId
(
String
houseResourceId
,
String
businessEntityInfoId
);
void
deleteByHouseResourceId
(
String
houseResourceId
);
List
<
HouseResourceBusinessEntityInfoMapping
>
selectByBusinessEntityInfoId
(
String
businessEntityInfoId
);
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/house/HouseResourceMapper.java
View file @
e752ea69
...
@@ -33,4 +33,6 @@ public interface HouseResourceMapper {
...
@@ -33,4 +33,6 @@ public interface HouseResourceMapper {
List
<
HouseResource
>
selectPageBusinessEntityStatistics
();
List
<
HouseResource
>
selectPageBusinessEntityStatistics
();
List
<
HouseResourcePage
>
selectForContrast
(
@Param
(
"two"
)
String
two
,
@Param
(
"name"
)
String
name
);
List
<
HouseResourcePage
>
selectForContrast
(
@Param
(
"two"
)
String
two
,
@Param
(
"name"
)
String
name
);
List
<
HouseResourcePage
>
selectByIdList
(
List
<
String
>
idList
);
}
}
ruoyi-system/src/main/java/com/ruoyi/system/service/house/HouseResourceService.java
View file @
e752ea69
package
com
.
ruoyi
.
system
.
service
.
house
;
package
com
.
ruoyi
.
system
.
service
.
house
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.ruoyi.system.domain.house.BusinessEntityInfo
;
import
com.ruoyi.system.domain.house.HouseResource
;
import
com.ruoyi.system.domain.house.HouseResource
;
import
com.ruoyi.system.domain.house.vo.*
;
import
com.ruoyi.system.domain.house.vo.*
;
...
@@ -11,7 +10,7 @@ public interface HouseResourceService {
...
@@ -11,7 +10,7 @@ public interface HouseResourceService {
void
saveHouseResource
(
HouseResourceSaveUpdateDto
dto
);
void
saveHouseResource
(
HouseResourceSaveUpdateDto
dto
);
HouseResourceDetail
queryHouseResourceById
(
String
id
);
HouseResourceDetail
detail
(
String
id
);
void
updateHouseResource
(
HouseResourceSaveUpdateDto
dto
);
void
updateHouseResource
(
HouseResourceSaveUpdateDto
dto
);
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/house/impl/HouseResourceServiceImpl.java
View file @
e752ea69
This diff is collapsed.
Click to expand it.
ruoyi-system/src/main/resources/mapper/house/HouseResourceBusinessEntityInfoMappingMapper.xml
0 → 100644
View file @
e752ea69
<?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.system.mapper.house.HouseResourceBusinessEntityInfoMappingMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.ruoyi.system.domain.house.HouseResourceBusinessEntityInfoMapping"
>
<id
property=
"houseResourceId"
column=
"house_resource_id"
jdbcType=
"VARCHAR"
/>
<id
property=
"businessEntityInfoId"
column=
"business_entity_info_id"
jdbcType=
"VARCHAR"
/>
</resultMap>
<insert
id=
"insert"
>
INSERT INTO house_resource_business_entity_info_mapping
(id, house_resource_id, business_entity_info_id)
VALUES
(#{id,jdbcType=VARCHAR}, #{houseResourceId,jdbcType=VARCHAR}, #{businessEntityInfoId,jdbcType=VARCHAR})
</insert>
<delete
id=
"deleteByHouseResourceIdBusinessEntityInfoId"
>
DELETE FROM house_resource_business_entity_info_mapping
WHERE house_resource_id = #{houseResourceId,jdbcType=VARCHAR}
AND business_entity_info_id = #{businessEntityInfoId,jdbcType=VARCHAR}
</delete>
<delete
id=
"deleteByHouseResourceId"
>
DELETE FROM house_resource_business_entity_info_mapping
WHERE house_resource_id = #{houseResourceId,jdbcType=VARCHAR}
</delete>
<select
id=
"selectByBusinessEntityInfoId"
resultType=
"com.ruoyi.system.domain.house.HouseResourceBusinessEntityInfoMapping"
>
SELECT * FROM house_resource_business_entity_info_mapping WHERE business_entity_info_id = #{businessEntityInfoId,jdbcType=VARCHAR}
</select>
</mapper>
ruoyi-system/src/main/resources/mapper/house/HouseResourceMapper.xml
View file @
e752ea69
...
@@ -125,17 +125,18 @@
...
@@ -125,17 +125,18 @@
SELECT
SELECT
t2.wg_name AS wgName4,
t2.wg_name AS wgName4,
t1.*,
t1.*,
SUM(t
4
.year_sell) AS income,
SUM(t
5
.year_sell) AS income,
t
3
.nature,
t
4
.nature,
t
3
.industry_classification,
t
4
.industry_classification,
ROUND(IFNULL(t1.unit_price,0) * 10000 / 365 / t1.house_area, 1) AS dayPrice,
ROUND(IFNULL(t1.unit_price,0) * 10000 / 365 / t1.house_area, 1) AS dayPrice,
t
3
.name,
t
4
.name,
t
4
.year
t
5
.year
FROM
FROM
house_resource t1
house_resource t1
LEFT JOIN grid_region t2 ON t2.wg_code = t1.four
LEFT JOIN grid_region t2 ON t2.wg_code = t1.four
LEFT JOIN business_entity_info t3 ON t1.id = t3.house_resource_id
LEFT JOIN house_resource_business_entity_info_mapping t3 ON t3.house_resource_id = t1.id
LEFT JOIN business_entity_sell t4 ON t4.business_entity_info_id = t3.id
LEFT JOIN business_entity_info t4 ON t3.business_entity_info_id = t4.id
LEFT JOIN business_entity_sell t5 ON t5.business_entity_info_id = t4.id
<where>
<where>
<if
test=
"query.wgType != null"
>
<if
test=
"query.wgType != null"
>
and t1.type = #{query.wgType}
and t1.type = #{query.wgType}
...
@@ -292,17 +293,18 @@
...
@@ -292,17 +293,18 @@
SELECT
SELECT
t2.wg_name AS wgName4,
t2.wg_name AS wgName4,
t1.*,
t1.*,
SUM(t
4
.year_sell) AS income,
SUM(t
5
.year_sell) AS income,
t
3
.nature,
t
4
.nature,
t
3
.industry_classification,
t
4
.industry_classification,
ROUND(IFNULL(t1.unit_price,0) * 10000 / 365 / t1.house_area, 1) AS dayPrice,
ROUND(IFNULL(t1.unit_price,0) * 10000 / 365 / t1.house_area, 1) AS dayPrice,
t
3
.name,
t
4
.name,
t
4
.year
t
5
.year
FROM
FROM
house_resource t1
house_resource t1
LEFT JOIN grid_region t2 ON t2.wg_code = t1.four
LEFT JOIN grid_region t2 ON t2.wg_code = t1.four
LEFT JOIN business_entity_info t3 ON t1.id = t3.house_resource_id
LEFT JOIN house_resource_business_entity_info_mapping t3 ON t3.house_resource_id = t1.id
LEFT JOIN business_entity_sell t4 ON t4.business_entity_info_id = t3.id
LEFT JOIN business_entity_info t4 ON t3.business_entity_info_id = t4.id
LEFT JOIN business_entity_sell t5 ON t5.business_entity_info_id = t4.id
<where>
<where>
<if
test=
"query.wgType != null"
>
<if
test=
"query.wgType != null"
>
and t1.type = #{query.wgType}
and t1.type = #{query.wgType}
...
@@ -456,14 +458,18 @@
...
@@ -456,14 +458,18 @@
SELECT
SELECT
t2.wg_name AS wgName4,
t2.wg_name AS wgName4,
t1.*,
t1.*,
t4.year_sell,
SUM(t5.year_sell) AS income,
t3.nature,
t4.nature,
ROUND(IFNULL(t1.unit_price,0) * 10000 / 365 / t1.house_area, 1) AS dayPrice
t4.industry_classification,
ROUND(IFNULL(t1.unit_price,0) * 10000 / 365 / t1.house_area, 1) AS dayPrice,
t4.name,
t5.year
FROM
FROM
house_resource t1
house_resource t1
LEFT JOIN grid_region t2 ON t2.wg_code = t1.four
LEFT JOIN grid_region t2 ON t2.wg_code = t1.four
LEFT JOIN business_entity_info t3 ON t1.id = t3.house_resource_id
LEFT JOIN house_resource_business_entity_info_mapping t3 ON t3.house_resource_id = t1.id
LEFT JOIN business_entity_sell t4 ON t4.business_entity_info_id = t3.id
LEFT JOIN business_entity_info t4 ON t3.business_entity_info_id = t4.id
LEFT JOIN business_entity_sell t5 ON t5.business_entity_info_id = t4.id
<where>
<where>
<if
test=
"query.wgType != null"
>
<if
test=
"query.wgType != null"
>
and t1.type = #{query.wgType}
and t1.type = #{query.wgType}
...
@@ -629,26 +635,27 @@
...
@@ -629,26 +635,27 @@
t1.ownership,
t1.ownership,
t1.house_resource_equity_tel,
t1.house_resource_equity_tel,
t1.unit_price,
t1.unit_price,
t
3
.nature,
t
4
.nature,
t
3
.NAME,
t
4
.NAME,
t
3
.principal_tel,
t
4
.principal_tel,
t
3
.business,
t
4
.business,
t
3
.worker_number,
t
4
.worker_number,
t
3
.registration_place_flag,
t
4
.registration_place_flag,
t
3
.registered_address,
t
4
.registered_address,
t
3
.industry_classification,
t
4
.industry_classification,
t
3
.gs,
t
4
.gs,
t1.remark,
t1.remark,
t
3
.name AS businessEntityInfoName,
t
4
.name AS businessEntityInfoName,
t
3
.principal,
t
4
.principal,
ROUND(IFNULL(t1.unit_price,0) * 10000 / 365 / t1.house_area, 1) AS dayPrice,
ROUND(IFNULL(t1.unit_price,0) * 10000 / 365 / t1.house_area, 1) AS dayPrice,
t1.house_resource_url,
t1.house_resource_url,
t1.business_license_url
t1.business_license_url
FROM
FROM
house_resource t1
house_resource t1
LEFT JOIN grid_region t2 ON t2.wg_code = t1.four
LEFT JOIN grid_region t2 ON t2.wg_code = t1.four
LEFT JOIN business_entity_info t3 ON t1.id = t3.house_resource_id
LEFT JOIN house_resource_business_entity_info_mapping t3 ON t3.house_resource_id = t1.id
LEFT JOIN business_entity_sell t4 ON t4.business_entity_info_id = t3.id
LEFT JOIN business_entity_info t4 ON t3.business_entity_info_id = t4.id
LEFT JOIN business_entity_sell t5 ON t5.business_entity_info_id = t4.id
<where>
<where>
<if
test=
"query.wgType != null"
>
<if
test=
"query.wgType != null"
>
and t1.type = #{query.wgType}
and t1.type = #{query.wgType}
...
@@ -778,8 +785,9 @@
...
@@ -778,8 +785,9 @@
FROM
FROM
house_resource t1
house_resource t1
LEFT JOIN grid_region t2 ON t2.wg_code = t1.four
LEFT JOIN grid_region t2 ON t2.wg_code = t1.four
LEFT JOIN business_entity_info t3 ON t1.id = t3.house_resource_id
LEFT JOIN house_resource_business_entity_info_mapping t3 ON t3.house_resource_id = t1.id
LEFT JOIN business_entity_sell t4 ON t4.business_entity_info_id = t3.id
LEFT JOIN business_entity_info t4 ON t3.business_entity_info_id = t4.id
LEFT JOIN business_entity_sell t5 ON t5.business_entity_info_id = t4.id
GROUP BY t1.id, t3.id
GROUP BY t1.id, t3.id
</select>
</select>
<select
id=
"selectForContrast"
resultType=
"com.ruoyi.system.domain.house.vo.HouseResourcePage"
>
<select
id=
"selectForContrast"
resultType=
"com.ruoyi.system.domain.house.vo.HouseResourcePage"
>
...
@@ -797,22 +805,30 @@
...
@@ -797,22 +805,30 @@
t1.ownership,
t1.ownership,
t1.house_resource_equity_tel,
t1.house_resource_equity_tel,
t1.unit_price,
t1.unit_price,
t
3
.nature,
t
4
.nature,
t
3
.NAME,
t
4
.NAME,
t
3
.principal_tel,
t
4
.principal_tel,
t
3
.business,
t
4
.business,
t
3
.worker_number,
t
4
.worker_number,
t
3
.registration_place_flag,
t
4
.registration_place_flag,
t
3
.registered_address,
t
4
.registered_address,
t
3
.industry_classification,
t
4
.industry_classification,
t
3
.gs,
t
4
.gs,
t1.remark,
t1.remark,
t
3
.name AS businessEntityInfoName,
t
4
.name AS businessEntityInfoName,
t
3
.principal
t
4
.principal
FROM
FROM
house_resource t1
house_resource t1
LEFT JOIN grid_region t2 ON t2.wg_code = t1.four
LEFT JOIN grid_region t2 ON t2.wg_code = t1.four
LEFT JOIN business_entity_info t3 ON t1.id = t3.house_resource_id
LEFT JOIN house_resource_business_entity_info_mapping t3 ON t3.house_resource_id = t1.id
LEFT JOIN business_entity_info t4 ON t3.business_entity_info_id = t4.id
LEFT JOIN business_entity_sell t5 ON t5.business_entity_info_id = t4.id
WHERE t1.two = #{two} AND t3.NAME = #{name}
WHERE t1.two = #{two} AND t3.NAME = #{name}
</select>
</select>
<select
id=
"selectByIdList"
resultType=
"com.ruoyi.system.domain.house.vo.HouseResourcePage"
>
SELECT * FROM house_resource WHERE id IN
<foreach
item=
"item"
index=
"index"
collection=
"idList"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</select>
</mapper>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment