insert into business_property(property_id,b_id,name,address,tel,nearby_landmarks,map_x,map_y,month,operate) values(#{propertyId},#{bId},#{name},#{address},#{tel},#{nearbyLandmarks},#{mapX},#{mapY},#{month},#{operate}) insert into business_property_attr(b_id,attr_id,property_id,spec_cd,value,month,operate) values(#{bId},#{attrId},#{propertyId},#{specCd},#{value},#{month},#{operate}) insert into business_property_photo(property_photo_id,b_id,property_id,property_photo_type_cd,photo,month,operate) values(#{propertyPhotoId},#{bId},#{propertyId},#{propertyPhotoTypeCd},#{photo},#{month},#{operate}) insert into business_property_cerdentials(property_cerdentials_id,b_id,property_id,credentials_cd,value,validity_period,positive_photo,negative_photo,month,operate) values(#{propertyCerdentialsId},#{bId},#{propertyId},#{credentialsCd},#{value},#{validityPeriod},#{positivePhoto},#{negativePhoto},#{month},#{operate}) insert into business_property_user(property_user_id,b_id,property_id,user_id,rel_cd,month,operate) values(#{propertyUserId},#{bId},#{propertyId},#{userId},#{relCd},#{month},#{operate}) insert into business_property_fee(fee_id,b_id,property_id,fee_type_cd,fee_money,fee_time,start_time,end_time,month,operate) values(#{feeId},#{bId},#{propertyId},#{feeTypeCd},#{feeMoney},#{feeTime},#{startTime},#{endTime},#{month},#{operate}) insert into business_property_house(house_id,property_id,b_id,house_num,house_name,house_phone,house_area,fee_type_cd,fee_price,month,operate) values(#{houseId},#{propertyId},#{bId},#{houseNum},#{houseName},#{housePhone},#{houseArea},#{feeTypeCd},#{feePrice},#{month},#{operate}) insert into business_property_house_attr(b_id,attr_id,house_id,spec_cd,value,month,operate) values(#{bId},#{attrId},#{houseId},#{specCd},#{value},#{month},#{operate}) insert into p_property(property_id,b_id,name,address,tel,nearby_landmarks,map_x,map_y,status_cd) select s.property_id,s.b_id,s.name,s.address,s.tel,s.nearby_landmarks,s.map_x,s.map_y,'0' from business_property s where s.operate = 'ADD' and s.b_id=#{bId} insert into p_property_attr(b_id,attr_id,property_id,spec_cd,value,status_cd) select sa.b_id,sa.attr_id,sa.property_id,sa.spec_cd,sa.value,'0' from business_property_attr sa where sa.operate = 'ADD' and sa.b_id=#{bId} insert into p_property_house(house_id,property_id,b_id,house_num,house_name,house_phone,house_area,fee_type_cd,fee_price,status_cd) select s.house_id,s.property_id,s.b_id,s.house_num,s.house_name,s.house_phone,s.house_area,s.fee_type_cd,s.fee_price,'0' from business_property_house s where s.operate = 'ADD' and s.b_id=#{bId} insert into p_property_house_attr(b_id,attr_id,house_id,spec_cd,value,status_cd) select sa.b_id,sa.attr_id,sa.house_id,sa.spec_cd,sa.value,'0' from business_property_house_attr sa where sa.operate = 'ADD' and sa.b_id=#{bId} insert into p_property_photo(property_photo_id,b_id,property_id,property_photo_type_cd,photo,status_cd) select sp.property_photo_id,sp.b_id,sp.property_id,sp.property_photo_type_cd,sp.photo,'0' from business_property_photo sp where sp.operate = 'ADD' and sp.b_id=#{bId} insert into p_property_cerdentials(property_cerdentials_id,b_id,property_id,credentials_cd,value,validity_period,positive_photo,negative_photo,status_cd) select sc.property_cerdentials_id,sc.b_id,sc.property_id,sc.credentials_cd,sc.value,sc.validity_period,sc.positive_photo,sc.negative_photo,'0' from business_property_cerdentials sc where sc.operate = 'ADD' and sc.b_id=#{bId} insert into p_property_user(property_user_id,b_id,property_id,user_id,rel_cd,status_cd) select sc.property_user_id,sc.b_id,sc.property_id,sc.user_id,sc.rel_cd,'0' from business_property_user sc where sc.operate = 'ADD' and sc.b_id=#{bId} insert into p_property_fee(fee_id,b_id,property_id,fee_type_cd,fee_money,fee_time,start_time,end_time,status_cd) select sc.fee_id,sc.b_id,sc.property_id,sc.fee_type_cd,sc.fee_money,sc.fee_time,sc.start_time,sc.end_time,'0' from business_property_fee sc where sc.operate = 'ADD' and sc.b_id=#{bId} update p_property s set s.status_cd = #{statusCd} ,s.b_id = #{newBId} ,s.name = #{name} ,s.address = #{address} ,s.tel = #{tel} ,s.nearby_landmarks = #{nearbyLandmarks} ,s.map_x = #{mapX} ,s.map_y = #{mapY} where 1=1 and s.b_id = #{bId} and s.property_id = #{propertyId} update p_property_attr sa set sa.status_cd = #{statusCd} ,sa.b_id = #{newBId} ,sa.value = #{value} where 1=1 and sa.b_id = #{bId} and sa.property_id = #{propertyId} and sa.spec_cd = #{specCd} and sa.attr_id = #{attrId} update p_property_house s set s.status_cd = #{statusCd} ,s.b_id = #{newBId} ,s.house_name = #{houseName} ,s.house_num = #{houseNum} ,s.house_phone = #{housePhone} ,s.house_area = #{houseArea} ,s.fee_type_cd = #{feeTypeCd} ,s.fee_price = #{feePrice} where 1=1 and s.b_id = #{bId} and s.property_id = #{propertyId} and s.house_id = #{houseId} update p_property_house_attr sa set sa.status_cd = #{statusCd} ,sa.b_id = #{newBId} ,sa.value = #{value} where 1=1 and sa.b_id = #{bId} and sa.house_id = #{houseId} and sa.spec_cd = #{specCd} and sa.attr_id = #{attrId} update p_property_photo sp set sp.status_cd = #{statusCd} ,sp.b_id = #{newBId} ,sp.property_photo_type_cd = #{propertyPhotoTypeCd} ,sp.photo = #{photo} where 1=1 and sp.b_id = #{bId} and sp.property_id = #{propertyId} and sp.property_photo_id = #{propertyPhotoId} update p_property_cerdentials sc set sc.status_cd = #{statusCd} ,sc.b_id = #{newBId} ,sc.credentials_cd = #{credentialsCd} ,sc.value = #{value} ,sc.validity_period = #{validityPeriod} ,sc.positive_photo = #{positivePhoto} ,sc.negative_photo = #{negativePhoto} where 1=1 and sc.b_id = #{bId} and sc.property_id = #{propertyId} and sc.property_cerdentials_id = #{propertyCerdentialsId} update p_property_user sc set sc.status_cd = #{statusCd} ,sc.b_id = #{newBId} ,sc.rel_cd = #{relCd} where 1=1 and sc.b_id = #{bId} and sc.property_id = #{propertyId} and sc.property_user_id = #{propertyUserId} update p_property_fee sc set sc.status_cd = #{statusCd} ,sc.b_id = #{newBId} ,sc.fee_money = #{feeMoney} ,sc.fee_time = #{feeTime} ,sc.start_time = #{startTime} ,sc.end_time = #{endTime} where 1=1 and sc.b_id = #{bId} and sc.property_id = #{propertyId} and sc.fee_id = #{feeId}