This commit is contained in:
kirito 2024-08-09 17:53:14 +08:00 committed by yangkunan
parent 3da2de050a
commit f9cf79224e
3 changed files with 49 additions and 41 deletions

View File

@ -1,16 +1,24 @@
select
a.id
, a.project_id -- 项目id
, b.name project_name -- 项目名称
, a.building_code -- 楼栋代码
, a.name -- 名称
, case when a.type = 1 then '集中商业'
when a.type = 2 then '写字楼'
when a.type = 4 then '底商'
when a.type = 5 then '商业街'
end type -- 类型
, a.construction_area -- 建筑面积
from ods_bs_building_d a
left join ods_bs_project_d b
on a.project_id = b.id
where a.del_flag = 0
SELECT
a.id,
a.project_id -- 项目id
,b.NAME project_name -- 项目名称
,a.building_code -- 楼栋代码
,a.NAME -- 名称
,
CASE
WHEN a.type = 1 THEN
'集中商业'
WHEN a.type = 2 THEN
'写字楼'
WHEN a.type = 4 THEN
'底商'
WHEN a.type = 5 THEN
'商业街'
END type -- 类型
,
a.construction_area -- 建筑面积
FROM
ods_bs_building_d a
LEFT JOIN ods_bs_project_d b ON a.project_id = b.id
WHERE
a.del_flag = 0

View File

@ -1,7 +1,7 @@
select
SELECT
id
, name -- 类型名称
, parent_id -- 父id
, code -- 类型代码
from ods_bs_contract_type_d
where del_flag = 0
, name -- 类型名称
, parent_id -- 父id
, code -- 类型代码
FROM ods_bs_contract_type_d
WHERE del_flag = 0

View File

@ -1,24 +1,24 @@
select
a.orderNo
, from_unixtime(cast(left(a.createTime,10) as unsigned integer)) createTime -- 创建时间
, from_unixtime(cast(left(a.confirmTime,10) as unsigned integer)) confirmTime -- 收货时间
, a.orderStatus -- 订单状态
, a.vid -- 项目id
, a.vidName -- 项目名称
, b.salePrice -- 销售金额
, c.refundCash -- 退款金额
a.orderNo
, from_unixtime(cast(left(a.createTime,10) as unsigned integer)) createTime -- 创建时间
, from_unixtime(cast(left(a.confirmTime,10) as unsigned integer)) confirmTime -- 收货时间
, a.orderStatus -- 订单状态
, a.vid -- 项目id
, a.vidName -- 项目名称
, b.salePrice -- 销售金额
, c.refundCash -- 退款金额
from ods_weimob_order_listsearch_orderinfo_d a
left join (
select orderNo, sum(salePrice*skuNum) salePrice
from ods_weimob_order_listsearch_orderinfo_items_d
group by orderNo
left join (
select orderNo, sum(salePrice*skuNum) salePrice
from ods_weimob_order_listsearch_orderinfo_items_d
group by orderNo
) b
on a.orderNo = b.orderNo
left join (
select orderNo, sum(refundCash) refundCash
from ods_weimob_rights_list_d
where rightsstatus = '6'
group by orderNo
on a.orderNo = b.orderNo
left join (
select orderNo, sum(refundCash) refundCash
from ods_weimob_rights_list_d
where rightsstatus = '6'
group by orderNo
) c
on a.orderNo = c.orderNo
on a.orderNo = c.orderNo
where a.isDeleted = 0 and a.orderStatus != 9