insert into business_building_room(
unit_price,section,remark,user_id,room_id,layer,built_up_area,operate,room_num,unit_id,b_id,apartment,state
) values (
#{unitPrice},#{section},#{remark},#{userId},#{roomId},#{layer},#{builtUpArea},#{operate},#{roomNum},#{unitId},#{bId},#{apartment},#{state}
)
insert into building_room(
unit_price,section,status_cd,remark,user_id,room_id,layer,built_up_area,room_num,unit_id,b_id,apartment,state
) select t.unit_price,t.section,'0',t.remark,t.user_id,t.room_id,t.layer,t.built_up_area,t.room_num,t.unit_id,t.b_id,t.apartment,t.state from business_building_room t where 1=1
and t.unit_price= #{unitPrice}
and t.section= #{section}
and t.remark= #{remark}
and t.user_id= #{userId}
and t.room_id= #{roomId}
and t.layer= #{layer}
and t.built_up_area= #{builtUpArea}
and t.operate= 'ADD'
and t.room_num= #{roomNum}
and t.unit_id= #{unitId}
and t.b_id= #{bId}
and t.apartment= #{apartment}
and t.state= #{state}
update building_room t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.unit_price= #{unitPrice}
, t.section= #{section}
, t.remark= #{remark}
, t.user_id= #{userId}
, t.layer= #{layer}
, t.built_up_area= #{builtUpArea}
, t.room_num= #{roomNum}
, t.unit_id= #{unitId}
, t.apartment= #{apartment}
, t.state= #{state}
where 1=1
and t.room_id= #{roomId}
and t.b_id= #{bId}