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
56674fac
Commit
56674fac
authored
Aug 02, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
873a7efc
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
337 additions
and
11 deletions
+337
-11
create-index-query.sql
src/main/resources/sql/house/create-index-query.sql
+3
-3
delete-index-query.sql
src/main/resources/sql/house/delete-index-query.sql
+5
-4
update-index-query.sql
src/main/resources/sql/house/update-index-query.sql
+4
-4
create-index-query.sql
src/main/resources/sql/house190802/create-index-query.sql
+108
-0
delete-index-query.sql
src/main/resources/sql/house190802/delete-index-query.sql
+108
-0
update-index-query.sql
src/main/resources/sql/house190802/update-index-query.sql
+109
-0
No files found.
src/main/resources/sql/house/create-index-query.sql
View file @
56674fac
...
@@ -97,9 +97,9 @@ SELECT
...
@@ -97,9 +97,9 @@ SELECT
ChangeDate = a.dChangeDate,
ChangeDate = a.dChangeDate,
LastUpdateTime = a.dLastUpdateTime
LastUpdateTime = a.dLastUpdateTime
FROM tHouse a join tProperty p on a.nPropertyID = p.nPropertyID
FROM tHouse a join tProperty p on a.nPropertyID = p.nPropertyID
join tRoom r on a.nHouseID = r.nHouseID and r.nTag&1=0 and r.nRoomStatus = 2
left join tRoomType rt on a.nHouseID = rt.nHouseID AND a.nRoomTypeID = rt.nRoomTypeID
left join tRoomType rt on a.nHouseID = rt.nHouseID AND a.nRoomTypeID = rt.nRoomTypeID
left join tRoom r on a.nHouseID = r.nHouseID --and r.nTag&4=4 --整租属性
left join #__tmp1 f on f.sFileNO = convert(varchar, r.nRoomID)
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 --房源有效状态
AND r.nRoomID IS NOT NULL
AND r.nRoomID IS NOT NULL
...
...
src/main/resources/sql/house/delete-index-query.sql
View file @
56674fac
...
@@ -97,10 +97,11 @@ SELECT
...
@@ -97,10 +97,11 @@ SELECT
ChangeDate = a.dChangeDate,
ChangeDate = a.dChangeDate,
LastUpdateTime = a.dLastUpdateTime
LastUpdateTime = a.dLastUpdateTime
FROM tHouse a join tProperty p on a.nPropertyID = p.nPropertyID
FROM tHouse a join tProperty p on a.nPropertyID = p.nPropertyID
join tRoom r on a.nHouseID = r.nHouseID
left join tRoomType rt on a.nHouseID = rt.nHouseID AND a.nRoomTypeID = rt.nRoomTypeID
left join tRoomType rt on a.nHouseID = rt.nHouseID AND a.nRoomTypeID = rt.nRoomTypeID
left join
tRoom r on a.nHouseID = r.nHouseID --and r.nTag&4=4 --整租属性
left join
#__tmp1 f on f.sFileNO = convert(varchar, r.nRoomID)
left join #__tmp1 f on f.sFileNO = convert(varchar,a.nHouseID)
WHERE (a.nTag&1=1 or a.nHouseStatus <> 2
WHERE (a.nTag&1=1 or a.nHouse
Status <> 2) --房源无效状态
or r.nTag&1=1 or r.nRoom
Status <> 2) --房源无效状态
AND a.dLastUpdateTime >= ?
AND a.dLastUpdateTime >= ?
AND r.nRoomID IS NOT NULL
AND r.nRoomID IS NOT NULL
...
...
src/main/resources/sql/house/update-index-query.sql
View file @
56674fac
...
@@ -97,9 +97,9 @@ SELECT
...
@@ -97,9 +97,9 @@ SELECT
ChangeDate = a.dChangeDate,
ChangeDate = a.dChangeDate,
LastUpdateTime = a.dLastUpdateTime
LastUpdateTime = a.dLastUpdateTime
FROM tHouse a join tProperty p on a.nPropertyID = p.nPropertyID
FROM tHouse a join tProperty p on a.nPropertyID = p.nPropertyID
join tRoom r on a.nHouseID = r.nHouseID and r.nTag&1=0 and r.nRoomStatus = 2
left join tRoomType rt on a.nHouseID = rt.nHouseID AND a.nRoomTypeID = rt.nRoomTypeID
left join tRoomType rt on a.nHouseID = rt.nHouseID AND a.nRoomTypeID = rt.nRoomTypeID
left join tRoom r on a.nHouseID = r.nHouseID --and r.nTag&4=4 --整租属性
left join #__tmp1 f on f.sFileNO = convert(varchar, r.nRoomID)
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 --房源有效状态
AND a.dLastUpdateTime >= ?
AND a.dLastUpdateTime >= ?
...
...
src/main/resources/sql/house190802/create-index-query.sql
0 → 100644
View file @
56674fac
DECLARE
@
ChoiceOssKEY
VARCHAR
(
40
)
DECLARE
@
AliyunOssKey
VARCHAR
(
40
)
DECLARE
@
HttpUrl
VARCHAR
(
255
)
DECLARE
@
Value1
VARCHAR
(
100
)
DECLARE
@
Value5
VARCHAR
(
100
)
DECLARE
@
LangID
VARCHAR
(
20
)
SELECT
@
ChoiceOssKEY
=
sValue1
FROM
tSystemCtrl
WHERE
sCode
=
'ChoiceOssKEY'
SELECT
@
HttpUrl
=
''
SELECT
@
LangID
=
'936'
--自建OSS系统参数
IF
@
ChoiceOssKEY
=
'SelfOssKey'
BEGIN
SELECT
@
Value1
=
sValue1
FROM
tSystemCtrl
WHERE
sCode
=
'SelfOssKey'
--处理参数
IF
RIGHT
(
@
Value1
,
1
)
=
'/'
OR
RIGHT
(
@
Value1
,
1
)
=
'
\'
SELECT @Value1 = LEFT(@Value1, len(@Value1) - 1) + '
/
'
ELSE
SELECT @Value1 = @Value1 + '
/
'
SELECT @HttpUrl = @Value1
END
ELSE
--阿里OSS系统参数
IF @ChoiceOssKEY = '
AliyunOssKey
'
BEGIN
SELECT @Value5 = sValue5 FROM tSystemCtrl WHERE sCode = '
AliyunOssKey
'
--处理参数
IF RIGHT(@Value5,1) = '
/
' OR RIGHT(@Value5,1) = '
\
'
SELECT @Value5 = LEFT(@Value5, len(@Value5) - 1) + '
/
'
ELSE
SELECT @Value5 = @Value5 + '
/
'
SELECT @HttpUrl = @Value5
END
SELECT sFileNO, nItem, sURL
INTO #__tmp
FROM tFile WHERE nTag&1=0 AND sFileTypeID = '
Room
'
SELECT a.sFileNO, a.sURL
INTO #__tmp1
FROM #__tmp a, (
SELECT sFileNO, nItem = min(nItem)
FROM #__tmp
GROUP BY sFileNO) b
WHERE a.sFileNO = b.sFileNO
AND a.nItem = b.nItem
SELECT
id = r.nRoomID,
PropertyID = a.nPropertyID,
PropertyName = p.sPropertyName,
HouseID = a.nHouseID,
RoomID = r.nRoomID,
RoomTypeID = a.nRoomTypeID,
RoomTypeNO = rt.sRoomTypeNO,
RoomTypeName = rt.sRoomTypeName,
HouseNO = a.sHouseNO,
HouseName = a.sHouseName,
RoomNO = r.sRoomNO,
RoomName = r.sRoomName,
HouseAddress = a.sHouseAddress,
RentTypeID = case when isnull(a.sRentTypeID,
''
) <>
''
then a.sRentTypeID else
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, --出行描述
RentArea = r.nUseArea, --出租面积
TotalFloorsNum = a.nTotalFloorsNum, --总层数
Building = a.sBuilding, --楼栋
Cell = a.sCell, --单元
FloorNO = a.nFloor, --楼层
BedRooms = a.nBedRooms, --卧室
Kitchens = a.nKitchens, --厨房
LivingRooms = a.nLivingRooms, --客厅
Toilets = a.nToilets, --厕所
Balconys = a.nBalconys, --阳台
HousePrice = isnull(r.nHousePrice,0), --房价
Unit = '
月
',
AdultCount = r.nAdultCount,
ChildCount = r.nChildCount,
Longitude = a.sLongitude,
Latitude = a.sLatitude,
Province = a.sProvince,
City = a.sCity,
Area = a.sArea,
HouseTypeID = a.sHouseTypeID, --房源类型:办公、公寓
HouseType = (SELECT DISTINCT sComDesc FROM tCommon WHERE sLangID = @LangID AND sCommonNO = '
HouseType
' AND sComID = a.sHouseTypeID),
BrandTypeID = 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,
RoomStatusTypeID = r.sStatus, --当前房态
RoomStatusType = (SELECT DISTINCT sComDesc FROM tCommon where sCommonNO = '
RoomStatusType
'
AND sLangID = @LangID and sComID = r.sStatus),
CreateDate = a.dCreateDate,
ChangeDate = a.dChangeDate,
LastUpdateTime = a.dLastUpdateTime
FROM tHouse a join tProperty p on a.nPropertyID = p.nPropertyID
left join tRoomType rt on a.nHouseID = rt.nHouseID AND a.nRoomTypeID = rt.nRoomTypeID
left join tRoom r on a.nHouseID = r.nHouseID --and r.nTag&4=4 --整租属性
left join #__tmp1 f on f.sFileNO = convert(varchar,a.nHouseID)
WHERE a.nTag&1=0
AND a.nHouseStatus = 2 --房源有效状态
AND r.nRoomID IS NOT NULL
DROP TABLE #__tmp
DROP TABLE #__tmp1
src/main/resources/sql/house190802/delete-index-query.sql
0 → 100644
View file @
56674fac
DECLARE
@
ChoiceOssKEY
VARCHAR
(
40
)
DECLARE
@
AliyunOssKey
VARCHAR
(
40
)
DECLARE
@
HttpUrl
VARCHAR
(
255
)
DECLARE
@
Value1
VARCHAR
(
100
)
DECLARE
@
Value5
VARCHAR
(
100
)
DECLARE
@
LangID
VARCHAR
(
20
)
SELECT
@
ChoiceOssKEY
=
sValue1
FROM
tSystemCtrl
WHERE
sCode
=
'ChoiceOssKEY'
SELECT
@
HttpUrl
=
''
SELECT
@
LangID
=
'936'
--自建OSS系统参数
IF
@
ChoiceOssKEY
=
'SelfOssKey'
BEGIN
SELECT
@
Value1
=
sValue1
FROM
tSystemCtrl
WHERE
sCode
=
'SelfOssKey'
--处理参数
IF
RIGHT
(
@
Value1
,
1
)
=
'/'
OR
RIGHT
(
@
Value1
,
1
)
=
'
\'
SELECT @Value1 = LEFT(@Value1, len(@Value1) - 1) + '
/
'
ELSE
SELECT @Value1 = @Value1 + '
/
'
SELECT @HttpUrl = @Value1
END
ELSE
--阿里OSS系统参数
IF @ChoiceOssKEY = '
AliyunOssKey
'
BEGIN
SELECT @Value5 = sValue5 FROM tSystemCtrl WHERE sCode = '
AliyunOssKey
'
--处理参数
IF RIGHT(@Value5,1) = '
/
' OR RIGHT(@Value5,1) = '
\
'
SELECT @Value5 = LEFT(@Value5, len(@Value5) - 1) + '
/
'
ELSE
SELECT @Value5 = @Value5 + '
/
'
SELECT @HttpUrl = @Value5
END
SELECT sFileNO, nItem, sURL
INTO #__tmp
FROM tFile WHERE nTag&1=0 AND sFileTypeID = '
Room
'
SELECT a.sFileNO, a.sURL
INTO #__tmp1
FROM #__tmp a, (
SELECT sFileNO, nItem = min(nItem)
FROM #__tmp
GROUP BY sFileNO) b
WHERE a.sFileNO = b.sFileNO
AND a.nItem = b.nItem
SELECT
id = r.nRoomID,
PropertyID = a.nPropertyID,
PropertyName = p.sPropertyName,
HouseID = a.nHouseID,
RoomID = r.nRoomID,
RoomTypeID = a.nRoomTypeID,
RoomTypeNO = rt.sRoomTypeNO,
RoomTypeName = rt.sRoomTypeName,
HouseNO = a.sHouseNO,
HouseName = a.sHouseName,
RoomNO = r.sRoomNO,
RoomName = r.sRoomName,
HouseAddress = a.sHouseAddress,
RentTypeID = case when isnull(a.sRentTypeID,
''
) <>
''
then a.sRentTypeID else
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, --出行描述
RentArea = r.nUseArea, --出租面积
TotalFloorsNum = a.nTotalFloorsNum, --总层数
Building = a.sBuilding, --楼栋
Cell = a.sCell, --单元
FloorNO = a.nFloor, --楼层
BedRooms = a.nBedRooms, --卧室
Kitchens = a.nKitchens, --厨房
LivingRooms = a.nLivingRooms, --客厅
Toilets = a.nToilets, --厕所
Balconys = a.nBalconys, --阳台
HousePrice = isnull(r.nHousePrice,0), --房价
Unit = '
月
',
AdultCount = r.nAdultCount,
ChildCount = r.nChildCount,
Longitude = a.sLongitude,
Latitude = a.sLatitude,
Province = a.sProvince,
City = a.sCity,
Area = a.sArea,
HouseTypeID = a.sHouseTypeID, --房源类型:办公、公寓
HouseType = (SELECT DISTINCT sComDesc FROM tCommon WHERE sLangID = @LangID AND sCommonNO = '
HouseType
' AND sComID = a.sHouseTypeID),
BrandTypeID = 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,
RoomStatusTypeID = r.sStatus, --当前房态
RoomStatusType = (SELECT DISTINCT sComDesc FROM tCommon where sCommonNO = '
RoomStatusType
'
AND sLangID = @LangID and sComID = r.sStatus),
CreateDate = a.dCreateDate,
ChangeDate = a.dChangeDate,
LastUpdateTime = a.dLastUpdateTime
FROM tHouse a join tProperty p on a.nPropertyID = p.nPropertyID
left join tRoomType rt on a.nHouseID = rt.nHouseID AND a.nRoomTypeID = rt.nRoomTypeID
left join tRoom r on a.nHouseID = r.nHouseID --and r.nTag&4=4 --整租属性
left join #__tmp1 f on f.sFileNO = convert(varchar,a.nHouseID)
WHERE (a.nTag&1=1 or a.nHouseStatus <> 2) --房源无效状态
AND a.dLastUpdateTime >= ?
AND r.nRoomID IS NOT NULL
DROP TABLE #__tmp
DROP TABLE #__tmp1
src/main/resources/sql/house190802/update-index-query.sql
0 → 100644
View file @
56674fac
DECLARE
@
ChoiceOssKEY
VARCHAR
(
40
)
DECLARE
@
AliyunOssKey
VARCHAR
(
40
)
DECLARE
@
HttpUrl
VARCHAR
(
255
)
DECLARE
@
Value1
VARCHAR
(
100
)
DECLARE
@
Value5
VARCHAR
(
100
)
DECLARE
@
LangID
VARCHAR
(
20
)
SELECT
@
ChoiceOssKEY
=
sValue1
FROM
tSystemCtrl
WHERE
sCode
=
'ChoiceOssKEY'
SELECT
@
HttpUrl
=
''
SELECT
@
LangID
=
'936'
--自建OSS系统参数
IF
@
ChoiceOssKEY
=
'SelfOssKey'
BEGIN
SELECT
@
Value1
=
sValue1
FROM
tSystemCtrl
WHERE
sCode
=
'SelfOssKey'
--处理参数
IF
RIGHT
(
@
Value1
,
1
)
=
'/'
OR
RIGHT
(
@
Value1
,
1
)
=
'
\'
SELECT @Value1 = LEFT(@Value1, len(@Value1) - 1) + '
/
'
ELSE
SELECT @Value1 = @Value1 + '
/
'
SELECT @HttpUrl = @Value1
END
ELSE
--阿里OSS系统参数
IF @ChoiceOssKEY = '
AliyunOssKey
'
BEGIN
SELECT @Value5 = sValue5 FROM tSystemCtrl WHERE sCode = '
AliyunOssKey
'
--处理参数
IF RIGHT(@Value5,1) = '
/
' OR RIGHT(@Value5,1) = '
\
'
SELECT @Value5 = LEFT(@Value5, len(@Value5) - 1) + '
/
'
ELSE
SELECT @Value5 = @Value5 + '
/
'
SELECT @HttpUrl = @Value5
END
SELECT sFileNO, nItem, sURL
INTO #__tmp
FROM tFile WHERE nTag&1=0 AND sFileTypeID = '
Room
'
SELECT a.sFileNO, a.sURL
INTO #__tmp1
FROM #__tmp a, (
SELECT sFileNO, nItem = min(nItem)
FROM #__tmp
GROUP BY sFileNO) b
WHERE a.sFileNO = b.sFileNO
AND a.nItem = b.nItem
SELECT
id = r.nRoomID,
PropertyID = a.nPropertyID,
PropertyName = p.sPropertyName,
HouseID = a.nHouseID,
RoomID = r.nRoomID,
RoomTypeID = a.nRoomTypeID,
RoomTypeNO = rt.sRoomTypeNO,
RoomTypeName = rt.sRoomTypeName,
HouseNO = a.sHouseNO,
HouseName = a.sHouseName,
RoomNO = r.sRoomNO,
RoomName = r.sRoomName,
HouseAddress = a.sHouseAddress,
RentTypeID = case when isnull(a.sRentTypeID,
''
) <>
''
then a.sRentTypeID else
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, --出行描述
RentArea = r.nUseArea, --出租面积
TotalFloorsNum = a.nTotalFloorsNum, --总层数
Building = a.sBuilding, --楼栋
Cell = a.sCell, --单元
FloorNO = a.nFloor, --楼层
BedRooms = a.nBedRooms, --卧室
Kitchens = a.nKitchens, --厨房
LivingRooms = a.nLivingRooms, --客厅
Toilets = a.nToilets, --厕所
Balconys = a.nBalconys, --阳台
HousePrice = isnull(r.nHousePrice,0), --房价
Unit = '
月
',
AdultCount = r.nAdultCount,
ChildCount = r.nChildCount,
Longitude = a.sLongitude,
Latitude = a.sLatitude,
Province = a.sProvince,
City = a.sCity,
Area = a.sArea,
HouseTypeID = a.sHouseTypeID, --房源类型:办公、公寓
HouseType = (SELECT DISTINCT sComDesc FROM tCommon WHERE sLangID = @LangID AND sCommonNO = '
HouseType
' AND sComID = a.sHouseTypeID),
BrandTypeID = 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,
RoomStatusTypeID = r.sStatus, --当前房态
RoomStatusType = (SELECT DISTINCT sComDesc FROM tCommon where sCommonNO = '
RoomStatusType
'
AND sLangID = @LangID and sComID = r.sStatus),
CreateDate = a.dCreateDate,
ChangeDate = a.dChangeDate,
LastUpdateTime = a.dLastUpdateTime
FROM tHouse a join tProperty p on a.nPropertyID = p.nPropertyID
left join tRoomType rt on a.nHouseID = rt.nHouseID AND a.nRoomTypeID = rt.nRoomTypeID
left join tRoom r on a.nHouseID = r.nHouseID --and r.nTag&4=4 --整租属性
left join #__tmp1 f on f.sFileNO = convert(varchar,a.nHouseID)
WHERE a.nTag&1=0
AND a.nHouseStatus = 2 --房源有效状态
AND a.dLastUpdateTime >= ?
AND r.nRoomID IS NOT NULL
DROP TABLE #__tmp
DROP TABLE #__tmp1
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