insert into tb_bed( bno, dormitory_id )values( #{bno}, #{dormitoryId} ) delete from tb_bed where id = #{id} delete from tb_bed where dormitory_id = #{dormitoryId} update tb_bed set bno=#{bno}, dormitory_id=#{dormitoryId} where id = #{id} update tb_bed set bno = #{bno}, dormitory_id = #{dormitoryId} where id = #{id} and id = #{id} and bno = #{bno} and dormitory_id = #{dormitoryId}