Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
search
Project
Project
Details
Activity
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
曲欣亮
search
Commits
a0192f89
Commit
a0192f89
authored
Jul 15, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
b1a306e3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
21 deletions
+31
-21
create-index-query.sql
src/main/resources/sql/house/create-index-query.sql
+12
-8
delete-index-query.sql
src/main/resources/sql/house/delete-index-query.sql
+9
-6
update-index-query.sql
src/main/resources/sql/house/update-index-query.sql
+10
-7
No files found.
src/main/resources/sql/house/create-index-query.sql
View file @
a0192f89
...
@@ -48,7 +48,6 @@ FROM #__tmp a, (
...
@@ -48,7 +48,6 @@ FROM #__tmp a, (
AND a.nItem = b.nItem
AND a.nItem = b.nItem
SELECT
SELECT
id = r.nRoomID,
PropertyID = a.nPropertyID,
PropertyID = a.nPropertyID,
PropertyName = p.sPropertyName,
PropertyName = p.sPropertyName,
HouseID = a.nHouseID,
HouseID = a.nHouseID,
...
@@ -58,11 +57,15 @@ SELECT
...
@@ -58,11 +57,15 @@ SELECT
RoomTypeName = rt.sRoomTypeName,
RoomTypeName = rt.sRoomTypeName,
HouseNO = a.sHouseNO,
HouseNO = a.sHouseNO,
HouseName = a.sHouseName,
HouseName = a.sHouseName,
RoomNO = r.sRoomNO,
RoomName = r.sRoomName,
HouseAddress = a.sHouseAddress,
HouseAddress = a.sHouseAddress,
RentTypeID = a.sRentTypeID, --出租类型:1.整租;2.合租;3.不限
RentTypeID = case when isnull(a.sRentTypeID,
''
) <>
''
then a.sRentTypeID else
RentType = a.sRentType,
case when r.nTag&4=4 then '
1
' else '
2
' end end, --出租类型:整租、合租
RentType = case when isnull(a.sRentTypeID,
''
) <>
''
then a.sRentType else
case when r.nTag&4=4 then '
整租
' else '
合租
' end end,
TripDesc = p.sTripDesc, --出行描述
TripDesc = p.sTripDesc, --出行描述
RentArea =
a.nRentArea,
--出租面积
RentArea =
r.nUseArea,
--出租面积
TotalFloorsNum = a.nTotalFloorsNum, --总层数
TotalFloorsNum = a.nTotalFloorsNum, --总层数
Building = a.sBuilding, --楼栋
Building = a.sBuilding, --楼栋
Cell = a.sCell, --单元
Cell = a.sCell, --单元
...
@@ -72,7 +75,7 @@ SELECT
...
@@ -72,7 +75,7 @@ SELECT
LivingRooms = a.nLivingRooms, --客厅
LivingRooms = a.nLivingRooms, --客厅
Toilets = a.nToilets, --厕所
Toilets = a.nToilets, --厕所
Balconys = a.nBalconys, --阳台
Balconys = a.nBalconys, --阳台
HousePrice =
r.nHousePrice
, --房价
HousePrice =
isnull(r.nHousePrice,0)
, --房价
Unit = '
月
',
Unit = '
月
',
AdultCount = r.nAdultCount,
AdultCount = r.nAdultCount,
ChildCount = r.nChildCount,
ChildCount = r.nChildCount,
...
@@ -87,7 +90,8 @@ SELECT
...
@@ -87,7 +90,8 @@ SELECT
BrandType = (SELECT DISTINCT sComDesc FROM tCommon WHERE sLangID = @LangID AND sCommonNO = '
Brand
' AND sComID = a.sBrandTypeID),
BrandType = (SELECT DISTINCT sComDesc FROM tCommon WHERE sLangID = @LangID AND sCommonNO = '
Brand
' AND sComID = a.sBrandTypeID),
URL = @HttpUrl + CASE WHEN LEFT(f.sURL,1) = '
/
' THEN RIGHT(f.sURL,len(f.sURL) - 1) ELSE f.sURL END,
URL = @HttpUrl + CASE WHEN LEFT(f.sURL,1) = '
/
' THEN RIGHT(f.sURL,len(f.sURL) - 1) ELSE f.sURL END,
RoomStatusTypeID = r.sStatus, --当前房态
RoomStatusTypeID = r.sStatus, --当前房态
RoomStatusType = (SELECT DISTINCT sComDesc FROM tCommon where sCommonNO = '
RoomStatusType
' AND sLangID = @LangID and sComID = r.sStatus),
RoomStatusType = (SELECT DISTINCT sComDesc FROM tCommon where sCommonNO = '
RoomStatusType
'
AND sLangID = @LangID and sComID = r.sStatus),
CreateDate = a.dCreateDate,
CreateDate = a.dCreateDate,
ChangeDate = a.dChangeDate,
ChangeDate = a.dChangeDate,
LastUpdateTime = a.dLastUpdateTime
LastUpdateTime = a.dLastUpdateTime
...
@@ -97,6 +101,6 @@ SELECT
...
@@ -97,6 +101,6 @@ SELECT
left join #__tmp1 f on f.sFileNO = convert(varchar,a.nHouseID)
left join #__tmp1 f on f.sFileNO = convert(varchar,a.nHouseID)
WHERE a.nTag&1=0
WHERE a.nTag&1=0
AND a.nHouseStatus = 2 --房源有效状态
AND a.nHouseStatus = 2 --房源有效状态
DROP TABLE #__tmp
DROP TABLE #__tmp
DROP TABLE #__tmp1
DROP TABLE #__tmp1
\ No newline at end of file
src/main/resources/sql/house/delete-index-query.sql
View file @
a0192f89
...
@@ -48,7 +48,6 @@ FROM #__tmp a, (
...
@@ -48,7 +48,6 @@ FROM #__tmp a, (
AND a.nItem = b.nItem
AND a.nItem = b.nItem
SELECT
SELECT
id = r.nRoomID,
PropertyID = a.nPropertyID,
PropertyID = a.nPropertyID,
PropertyName = p.sPropertyName,
PropertyName = p.sPropertyName,
HouseID = a.nHouseID,
HouseID = a.nHouseID,
...
@@ -58,11 +57,15 @@ SELECT
...
@@ -58,11 +57,15 @@ SELECT
RoomTypeName = rt.sRoomTypeName,
RoomTypeName = rt.sRoomTypeName,
HouseNO = a.sHouseNO,
HouseNO = a.sHouseNO,
HouseName = a.sHouseName,
HouseName = a.sHouseName,
RoomNO = r.sRoomNO,
RoomName = r.sRoomName,
HouseAddress = a.sHouseAddress,
HouseAddress = a.sHouseAddress,
RentTypeID = a.sRentTypeID, --出租类型:1.整租;2.合租;3.不限
RentTypeID = case when isnull(a.sRentTypeID,
''
) <>
''
then a.sRentTypeID else
RentType = a.sRentType,
case when r.nTag&4=4 then '
1
' else '
2
' end end, --出租类型:整租、合租
RentType = case when isnull(a.sRentTypeID,
''
) <>
''
then a.sRentType else
case when r.nTag&4=4 then '
整租
' else '
合租
' end end,
TripDesc = p.sTripDesc, --出行描述
TripDesc = p.sTripDesc, --出行描述
RentArea =
a.nRentArea,
--出租面积
RentArea =
r.nUseArea,
--出租面积
TotalFloorsNum = a.nTotalFloorsNum, --总层数
TotalFloorsNum = a.nTotalFloorsNum, --总层数
Building = a.sBuilding, --楼栋
Building = a.sBuilding, --楼栋
Cell = a.sCell, --单元
Cell = a.sCell, --单元
...
@@ -72,7 +75,7 @@ SELECT
...
@@ -72,7 +75,7 @@ SELECT
LivingRooms = a.nLivingRooms, --客厅
LivingRooms = a.nLivingRooms, --客厅
Toilets = a.nToilets, --厕所
Toilets = a.nToilets, --厕所
Balconys = a.nBalconys, --阳台
Balconys = a.nBalconys, --阳台
HousePrice =
r.nHousePrice
, --房价
HousePrice =
isnull(r.nHousePrice,0)
, --房价
Unit = '
月
',
Unit = '
月
',
AdultCount = r.nAdultCount,
AdultCount = r.nAdultCount,
ChildCount = r.nChildCount,
ChildCount = r.nChildCount,
...
@@ -100,4 +103,4 @@ WHERE (a.nTag&1=1 or a.nHouseStatus <> 2) --房源无效状态
...
@@ -100,4 +103,4 @@ WHERE (a.nTag&1=1 or a.nHouseStatus <> 2) --房源无效状态
AND a.dLastUpdateTime >= ?
AND a.dLastUpdateTime >= ?
DROP TABLE #__tmp
DROP TABLE #__tmp
DROP TABLE #__tmp1
DROP TABLE #__tmp1
\ No newline at end of file
src/main/resources/sql/house/update-index-query.sql
View file @
a0192f89
...
@@ -48,7 +48,6 @@ FROM #__tmp a, (
...
@@ -48,7 +48,6 @@ FROM #__tmp a, (
AND a.nItem = b.nItem
AND a.nItem = b.nItem
SELECT
SELECT
id = r.nRoomID,
PropertyID = a.nPropertyID,
PropertyID = a.nPropertyID,
PropertyName = p.sPropertyName,
PropertyName = p.sPropertyName,
HouseID = a.nHouseID,
HouseID = a.nHouseID,
...
@@ -58,11 +57,15 @@ SELECT
...
@@ -58,11 +57,15 @@ SELECT
RoomTypeName = rt.sRoomTypeName,
RoomTypeName = rt.sRoomTypeName,
HouseNO = a.sHouseNO,
HouseNO = a.sHouseNO,
HouseName = a.sHouseName,
HouseName = a.sHouseName,
RoomNO = r.sRoomNO,
RoomName = r.sRoomName,
HouseAddress = a.sHouseAddress,
HouseAddress = a.sHouseAddress,
RentTypeID = a.sRentTypeID, --出租类型:1.整租;2.合租;3.不限
RentTypeID = case when isnull(a.sRentTypeID,
''
) <>
''
then a.sRentTypeID else
RentType = a.sRentType,
case when r.nTag&4=4 then '
1
' else '
2
' end end, --出租类型:整租、合租
RentType = case when isnull(a.sRentTypeID,
''
) <>
''
then a.sRentType else
case when r.nTag&4=4 then '
整租
' else '
合租
' end end,
TripDesc = p.sTripDesc, --出行描述
TripDesc = p.sTripDesc, --出行描述
RentArea =
a.nRentArea,
--出租面积
RentArea =
r.nUseArea,
--出租面积
TotalFloorsNum = a.nTotalFloorsNum, --总层数
TotalFloorsNum = a.nTotalFloorsNum, --总层数
Building = a.sBuilding, --楼栋
Building = a.sBuilding, --楼栋
Cell = a.sCell, --单元
Cell = a.sCell, --单元
...
@@ -72,7 +75,7 @@ SELECT
...
@@ -72,7 +75,7 @@ SELECT
LivingRooms = a.nLivingRooms, --客厅
LivingRooms = a.nLivingRooms, --客厅
Toilets = a.nToilets, --厕所
Toilets = a.nToilets, --厕所
Balconys = a.nBalconys, --阳台
Balconys = a.nBalconys, --阳台
HousePrice =
r.nHousePrice
, --房价
HousePrice =
isnull(r.nHousePrice,0)
, --房价
Unit = '
月
',
Unit = '
月
',
AdultCount = r.nAdultCount,
AdultCount = r.nAdultCount,
ChildCount = r.nChildCount,
ChildCount = r.nChildCount,
...
@@ -99,6 +102,6 @@ SELECT
...
@@ -99,6 +102,6 @@ SELECT
WHERE a.nTag&1=0
WHERE a.nTag&1=0
AND a.nHouseStatus = 2 --房源有效状态
AND a.nHouseStatus = 2 --房源有效状态
AND a.dLastUpdateTime >= ?
AND a.dLastUpdateTime >= ?
DROP TABLE #__tmp
DROP TABLE #__tmp
DROP TABLE #__tmp1
DROP TABLE #__tmp1
\ No newline at end of file
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