This commit is contained in:
kirito 2024-08-09 17:53:14 +08:00
parent 030eb5a929
commit 9ec6e25bf9
3 changed files with 49 additions and 41 deletions

View File

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

View File

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