select r.id, r.tenant_id, r.project_id, r.building_id, r.floor_id, r.room_number,
r.room_digital_number, r.room_manage_number, r.building_area, r.rental_area,
r.billing_area, r.inner_area, r.is_virtual, r.delivery_time, r.owner_id,
r.property_nature, r.height, r.load_value, r.room_status, r.room_type,
r.create_time, r.last_mod_time, r.create_user_id, r.last_mod_user_id,
r.del_flag, r.remark, b.project_name, c.building_name, d.floor_name,rb.price,rb.price_unit,
rb.rental_status,rb.available_date,rb.business_status,rb.decoration_status
from TB_ROOM r, TB_PROJECT b,TB_BUILDING c,TB_FLOOR d,TB_ROOM_BUSINESS_INFO rb, TB_ROOM_EXTEND_INFO re
where r.project_id=b.id and r.building_id=c.id and r.floor_id=d.id
and r.id = rb.room_id and r.id=re.room_id
SELECT nextval('SEQ_ROOM_1')::VARCHAR as id
insert into TB_ROOM
id,
tenant_id,
project_id,
building_id,
floor_id,
room_number,
room_digital_number,
room_manage_number,
building_area,
rental_area,
billing_area,
inner_area,
is_virtual,
delivery_time,
owner_id,
property_nature,
height,
load_value,
room_status,
room_type,
create_user_id,
last_mod_user_id,
del_flag,
remark,
create_time,
last_mod_time
#{id},
#{tenantId},
#{projectId},
#{buildingId},
#{floorId},
#{roomNumber},
#{roomDigitalNumber},
#{roomManageNumber},
#{buildingArea},
#{rentalArea},
#{billingArea},
#{innerArea},
#{isVirtual},
#{deliveryTime},
#{ownerId},
#{propertyNature},
#{height},
#{loadValue},
#{roomStatus},
#{roomType},
#{createUserId},
#{lastModUserId},
#{delFlag},
#{remark},
CURRENT_TIMESTAMP,
CURRENT_TIMESTAMP
update TB_ROOM
room_number = #{roomNumber},
room_digital_number = #{roomDigitalNumber},
room_manage_number = #{roomManageNumber},
building_area = #{buildingArea},
rental_area = #{rentalArea},
billing_area = #{billingArea},
inner_area = #{innerArea},
is_virtual = #{isVirtual},
delivery_time = #{deliveryTime},
owner_id = #{ownerId},
property_nature = #{propertyNature},
height = #{height},
load_value = #{loadValue},
room_status = #{roomStatus},
room_type = #{roomType},
last_mod_user_id = #{lastModUserId},
remark = #{remark},
last_mod_time = CURRENT_TIMESTAMP
where id = #{id} and del_flag = '0'
update TB_ROOM set del_flag = '1' where id = #{id} and del_flag = '0'
update TB_ROOM set del_flag = '1' where id in
#{id}