-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jiangwei1995910
committed
Jul 30, 2019
1 parent
14d3945
commit bb93990
Showing
16 changed files
with
1,040 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,63 @@ | ||
// 这里是一些常用的查询语句 | ||
|
||
|
||
// 房价均价查询语句 | ||
|
||
db.lianjia.aggregate([ | ||
{'$match': {"address.0": {$exists: true}}}, | ||
{ | ||
$group: { | ||
_id: {"$arrayElemAt": ["$address", 0]}, | ||
count: {$sum: 1}, | ||
avg_UnitPrice: {$avg: "$UnitPrice"}, | ||
std: {$stdDevPop: "$UnitPrice"}, | ||
} | ||
}, | ||
{ | ||
$project: | ||
{ | ||
count: 1, //总数 | ||
avg_UnitPrice: 1, //每平米均价 | ||
std: 1, //标准差 | ||
ratio: {$divide: ["$std", "$avg_UnitPrice"]} //标准差与均价的比值 | ||
} | ||
}, | ||
{ | ||
'$sort': {count: -1} | ||
} | ||
{'$match': {"address.0": {$exists: true}}}, | ||
{ | ||
$group: { | ||
_id: {"$arrayElemAt": ["$address", 0]}, | ||
count: {$sum: 1}, | ||
avg_UnitPrice: {$avg: "$UnitPrice"}, | ||
std: {$stdDevPop: "$UnitPrice"}, | ||
} | ||
}, | ||
{ | ||
$project: | ||
{ | ||
count: 1, //总数 | ||
avg_UnitPrice: 1, //每平米均价 | ||
std: 1, //标准差 | ||
ratio: {$divide: ["$std", "$avg_UnitPrice"]} //标准差与均价的比值 | ||
} | ||
}, | ||
{ | ||
'$sort': {count: -1} | ||
} | ||
]); | ||
|
||
|
||
// 平均薪资查询语句 | ||
|
||
db.zhilian.aggregate([ | ||
{'$match': {"workingExp.name": "1-3年"}}, | ||
{ | ||
$group: { | ||
_id: {"$arrayElemAt": ["$city.items", 0]}, | ||
count: {$sum: 1}, | ||
avg: {$avg: "$avg"}, | ||
std: {$stdDevPop: "$avg"}, | ||
} | ||
}, | ||
{ | ||
$project: | ||
{ | ||
count: 1, //总数 | ||
avg: 1, //平均薪资 | ||
std: 1, //标准差 | ||
ratio: {$divide: ["$std", "$avg"]} //标准差与均价的比值 | ||
} | ||
}, | ||
{ | ||
'$sort': {count: -1} | ||
} | ||
]); | ||
{'$match': {"workingExp.name": "1-3年"}}, | ||
{ | ||
$group: { | ||
_id: {"$arrayElemAt": ["$city.items", 0]}, | ||
count: {$sum: 1}, | ||
avg: {$avg: "$avg"}, | ||
std: {$stdDevPop: "$avg"}, | ||
} | ||
}, | ||
{ | ||
$project: | ||
{ | ||
count: 1, //总数 | ||
avg: 1, //平均薪资 | ||
std: 1, //标准差 | ||
ratio: {$divide: ["$std", "$avg"]} //标准差与均价的比值 | ||
} | ||
}, | ||
{ | ||
'$sort': {count: -1} | ||
} | ||
]); | ||
|
||
|
||
// 当前进度 | ||
db.lianjia.aggregate([ | ||
{ | ||
'$sort': {detailCrawlTime: -1} | ||
} | ||
], {allowDiskUse: true}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,2 @@ | ||
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o bin/macos64/lianjia lianjia.go | ||
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o bin/macos64/zhilian zhilian.go | ||
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o bin/macos64/clean_status clean_status.go | ||
cp ./config.yaml ./bin/macos64/config.yaml | ||
|
||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/linux64/lianjia lianjia.go | ||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/linux64/zhilian zhilian.go | ||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o bin/linux64/clean_status clean_status.go | ||
cp ./config.yaml ./bin/linux64/config.yaml | ||
|
||
|
||
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o bin/windows64/lianjia.exe lianjia.go | ||
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o bin/windows64/zhilian.exe zhilian.go | ||
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o bin/windows64/clean_status.exe clean_status.go | ||
cp ./config.yaml ./bin/windows64/config.yaml | ||
xgo --targets=windows/*,darwin/*,linux/* -out ./bin/getAwayBSG ./ | ||
cp ./config.yaml ./bin/config.yaml |
Oops, something went wrong.