insert into person values
(0,
#{name},
#{idcard},
#{idcardType},
#{birth},
#{sex},
#{nation},
#{phone},
#{address},
#{houseId},
#{buildId},
#{unit},
#{holdId},
#{pic})
insert into person values
(0,
#{name},
#{idcard},
#{idcardType},
#{birth},
#{sex},
#{nation},
#{phone},
#{address},
#{houseId},
#{buildId},
#{unit},
#{holdId},
#{pic})
update person set
name = #{name},
idcard = #{idcard},
idcard_type = #{idcardType},
birth = #{birth},
sex = #{sex},
nation = #{nation},
phone = #{phone},
address = #{address},
house_id = #{houseId},
build_id = #{buildId},
unit = #{unit},
hold_id = #{holdId},
pic = #{pic}
where id = #{id}
update households set
person_num = person_num-1
where build_id = #{buildId}
and unit = #{unit} and hold_id = #{holdId}
update households set
person_num = person_num+1
where build_id = #{buildId}
and unit = #{unit} and hold_id = #{holdId}
delete from person where id = #{id}