select id, projectId, unitId, unitId as deptId, unitType, unitName, unitName as deptName,unitPersonName, unitPersonPhone, createUser, createTime, del_flag from sur_project_unit_info insert into sur_project_unit_info projectId, unitId, unitType, unitName, unitPersonName, unitPersonPhone, createUser, createTime, del_flag, #{projectId}, #{unitId}, #{unitType}, #{unitName}, #{unitPersonName}, #{unitPersonPhone}, #{createUser}, #{createTime}, #{delFlag}, update sur_project_unit_info projectId = #{projectId}, unitId = #{unitId}, unitType = #{unitType}, unitName = #{unitName}, unitPersonName = #{unitPersonName}, unitPersonPhone = #{unitPersonPhone}, createUser = #{createUser}, createTime = #{createTime}, del_flag = #{delFlag}, where id = #{id} delete from sur_project_unit_info where id = #{id} delete from sur_project_unit_info where projectId = #{projectId} and unitId not in (select dept_id from sur_project_userinfo where project_id = #{projectId} and is_del=0) delete from sur_project_unit_info where id in #{id}