Commit 56674fac authored by Quxl's avatar Quxl

x

parent 873a7efc
......@@ -97,9 +97,9 @@ SELECT
ChangeDate = a.dChangeDate,
LastUpdateTime = a.dLastUpdateTime
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 tRoom r on a.nHouseID = r.nHouseID --and r.nTag&4=4 --整租属性
left join #__tmp1 f on f.sFileNO = convert(varchar,a.nHouseID)
left join #__tmp1 f on f.sFileNO = convert(varchar, r.nRoomID)
WHERE a.nTag&1=0
AND a.nHouseStatus = 2 --房源有效状态
AND r.nRoomID IS NOT NULL
......
......@@ -97,10 +97,11 @@ SELECT
ChangeDate = a.dChangeDate,
LastUpdateTime = a.dLastUpdateTime
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 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) --房源无效状态
left join #__tmp1 f on f.sFileNO = convert(varchar, r.nRoomID)
WHERE (a.nTag&1=1 or a.nHouseStatus <> 2
or r.nTag&1=1 or r.nRoomStatus <> 2) --房源无效状态
AND a.dLastUpdateTime >= ?
AND r.nRoomID IS NOT NULL
......
......@@ -97,9 +97,9 @@ SELECT
ChangeDate = a.dChangeDate,
LastUpdateTime = a.dLastUpdateTime
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 tRoom r on a.nHouseID = r.nHouseID --and r.nTag&4=4 --整租属性
left join #__tmp1 f on f.sFileNO = convert(varchar,a.nHouseID)
left join #__tmp1 f on f.sFileNO = convert(varchar, r.nRoomID)
WHERE a.nTag&1=0
AND a.nHouseStatus = 2 --房源有效状态
AND a.dLastUpdateTime >= ?
......
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
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
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment