insert into tb_dormitory(
no,
sex,
type,
capacity,
storey_id,
building_id
)values(
#{no},
#{sex},
#{type},
#{capacity},
#{storeyId},
#{buildingId}
)
delete from tb_dormitory where id = #{id}
delete from tb_dormitory where building_id = #{buildingId} and storey_id = #{storeyId}
update tb_dormitory set
no=#{no},
sex=#{sex},
type=#{type},
capacity=#{capacity},
storey_id=#{storeyId},
building_id=#{buildingId}
where id = #{id}
update tb_dormitory set
no = #{no},
sex = #{sex},
type = #{type},
capacity = #{capacity},
storey_id = #{storeyId},
building_id = #{buildingId}
where id = #{id}
and id = #{id}and no = #{no}and sex = #{sex}and type = #{type}and capacity = #{capacity}and storey_id = #{storeyId}and building_id = #{buildingId}