update tb_custom set custom_name = #{customName}, custom_type = #{customType}, custom_user = #{customUser}, custom_phone = #{customPhone}, update_time = now() where id = #{customId} insert into tb_custom(custom_name,dept_id,custom_type,custom_user,custom_phone,create_time,del_flag )values ( #{customName},0,#{customType},#{customUser},#{customPhone},now(),0 ) insert into tb_custom(custom_name,p_id,dept_id,custom_type,custom_user,custom_phone,create_time,del_flag )values ( #{customName},#{pId},1,#{customType},#{customUser},#{customPhone},now(),0 ) update tb_custom set del_flag = 1 where id = #{customId} update tb_custom set custom_status=#{customStatus} where id=#{customId} update tb_custom set p_id=#{id} where id=#{id} and dept_id = 0