@dzhai
2017-11-15T14:05:13.000000Z
字数 1617
阅读 1321
中驰车福
代码 svn://172.16.21.5/com.autozi/autozi-bdp/trunk
文档 svn://172.16.21.5/document/trunk/project
本地访问地址 http://localhost:8081/search/search/oegoods_search.action
测试ES http://172.16.21.172:9200/_plugin/head/
测试环境数据库
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://172.16.21.173:3306/autozi_bdp?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true
jdbc.username=root
jdbc.password=123
线上境数据库
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://172.16.162.33:3306/autozi_bdp?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true
jdbc.username=root
jdbc.password=Lm63v3ggNNkkxN0n
线上ES http://172.16.162.104:9200/_plugin/head/
http://search.autozi.com
http://data.autozi.com
车组统计数据
SELECT
a.data_code AS '车组编码',
a.model_name AS '车组名称',
t1.total AS 'OE数量',
t2.total AS '分类数量'
FROM car_model_group a
LEFT JOIN
(
SELECT
a.car_model_group_id,
COUNT(1) AS total
FROM
oe_oe_goods a
GROUP BY a.car_model_group_id
)t1
ON a.id = t1.car_model_group_id
LEFT JOIN
(
SELECT
t2.car_model_group_id,
COUNT(1) AS total
FROM
(SELECT a.car_model_group_id, a.category_id FROM oe_oe_goods a GROUP BY a.car_model_group_id, a.category_id) t2
GROUP BY t2.car_model_group_id
) t2
ON a.id=t2.car_model_group_id
车型统计数据
SELECT
t.id,
t.model_name,
t.data_code,
t1.total AS oe_count,
t2.total AS category_count
FROM
car_model t
LEFT JOIN
(
SELECT
car_model_id,
COUNT(1) AS total
FROM
oe_oe_goods_car_model_relation
GROUP BY car_model_id
) t1
ON t.id=t1.car_model_id
LEFT JOIN
(
SELECT
t.car_model_id,
COUNT(1) total
FROM
(SELECT b.car_model_id, a.category_id FROM oe_oe_goods a INNER JOIN oe_oe_goods_car_model_relation b ON a.id = b.oe_goods_id GROUP BY b.car_model_id, a.category_id) t
GROUP BY t.car_model_id
) t2
ON t.id = t2.car_model_id